Debugging

From ratacat/claude-skills · View interactive version

Debugging is an AI agent skill from the GitHub repository ratacat/claude-skills. Systematic debugging that identifies root causes rather than treating symptoms. Uses sequential thinking for complex analysis, web search for research, and structured investigation to avoid circular reasoning and whack-a-mole fixes.

How to use this skill

Skill file

Debugging

Quickstart

  1. Capture exact repro, scope, and recent changes
  2. Isolate components/files; trace path to failure
  3. Research exact error; check official docs
  4. Compare failing vs working patterns; form a testable hypothesis
  5. Verify with minimal test; apply minimal fix across all instances; validate

When to Use This Skill

Use debugging when:

Skip this skill for:

Core Anti-Patterns to Avoid

Based on documented failures in AI debugging, explicitly avoid:

  1. Circular Reasoning: Never propose the same fix twice without learning why it failed
  2. Premature Victory: Always verify fixes were actually implemented and work
  3. Pattern Amnesia: Maintain awareness of established code patterns throughout the session
  4. Context Overload: Use the 50% rule - restart conversation when context reaches 50%
  5. Symptom Chasing: Resist fixing error messages without understanding root causes
  6. Implementation Before Understanding: Never jump to code changes before examining existing patterns

UNDERSTAND (10-step checklist)

Progress Tracking with TodoWrite

Use TodoWrite to track debugging progress through the UNDERSTAND checklist:

  1. At start: Create todos for each applicable step:

```

☐ U - Capture exact repro and scope

☐ N - Isolate failing component

☐ D - Research error message

☐ E - Compare with working patterns

☐ R - Root cause analysis (5 Whys)

☐ S - Write falsifiable hypothesis

☐ T - Verify with minimal test

☐ A - Apply fix across all occurrences

☐ N - Record insights

☐ D - Update docs/tests

```

  1. During debugging: Mark steps in_progress → completed as you work through them
  1. When stuck: TodoWrite makes it visible which step is blocked - helps identify if you're skipping steps or going in circles
  1. Skip steps only if: Bug is simple enough that checklist is overkill (see "Skip this skill for" above)

Tool Decision Tree

Context Management

Decision Framework

IF same fix proposed twice → Stop; use SequentialThinking:process_thought

IF error is unclear → Research via WebSearch → Parallel Search; verify with docs

IF area is unfamiliar → Explore with codebase_search; don't guess

IF fix seems too easy → Confirm it addresses root cause (not symptom)

IF context is cluttered → Restart at 50% with summary

IF multiple hypotheses exist → Evaluate explicitly (evidence for/against)

IF similar code works → Find and diff via codebase_search/read_file

IF declaring success → Show changed lines; test fail-before/pass-after

IF fix spans multiple files → Search and patch all occurrences

IF library behavior assumed → Check Context7:get-library-docs

Quality Checks Before Finishing

Before declaring a bug fixed, verify:

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.