0x2e/dev-skills/systematic-debugging
Claude Code and agent skill by 0x2e/dev-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Install
npx vskill@latest install 0x2e/dev-skills/systematic-debuggingSKILL.md
The same SKILL.md was published earlier as 0x2e/dev-skills/systematic-debugging.
Systematic Debugging
Find root cause before attempting fixes. Symptom fixes are failure.
Iron Law
- No automatic fixes. Never implement a fix without the user's explicit approval.
- No fixes without root cause investigation first. If you haven't completed Phase 1, you cannot propose fixes.
The Five Phases
Complete each phase before proceeding to the next.
Phase 1: Root Cause Investigation
- Read error messages carefully — stack traces, line numbers, error codes. Don't skip past warnings.
- Reproduce consistently — exact steps. If not reproducible, gather more data; don't guess.
- Check recent changes — git diff, recent commits, new dependencies, config changes.
- Trace data flow — where does the bad value originate? Trace backward through the call stack until you find the source. Fix at source, not at symptom.
- Multi-component systems — for each component boundary, add diagnostic instrumentation to log what enters and exits, then run once to see where it breaks.
Phase 2: Pattern Analysis
- Find working examples — locate similar working code in the same codebase.
- Compare against references — if implementing a pattern, read the reference implementation completely.
- Identify differences — list every difference between working and broken, however small.
- Understand dependencies — what other components, configs, or assumptions does this depend on?
Phase 3: Hypothesis and Testing
- Form a single hypothesis — "I think X is the root cause because Y." Be specific.
- Test minimally — smallest possible change, one variable at a time.
- Verify — did it work? Yes → Phase 4. No → form NEW hypothesis. Don't pile on more fixes.
- When you don't know — say "I don't understand X." Don't pretend.
Phase 4: Present Before Acting
Do not implement any fix yet. After root cause is confirmed, present to the user:
- Conclusion — What is the root cause, with clear evidence.
- Fix plan — What specific changes will be made, where, and why.
- Impact assessment — What else might be affected by this change.
Wait for the user's explicit approval. Only proceed to Phase 5 after the user says "go ahead", "approved", "implement it", or similar.
Phase 5: Implementation (only after user approval)
- Create a failing test that reproduces the bug (use the
test-driven-developmentskill for the bug-fix TDD flow). - Implement a single fix — address the root cause, one change at a time. No "while I'm here" extras.
- Verify — test passes? No other tests broken? Issue resolved?
- If fix doesn't work — stop. Count attempts:
- < 3: Return to Phase 1 with new information.
- ≥ 3: STOP. Question the architecture. Each fix revealing new problems in different places signals a fundamental architectural issue. Discuss with the user before attempting more fixes.
Red Flags — Return to Phase 1
If you catch yourself thinking any of these, stop and return to root cause investigation:
- "Quick fix for now, investigate later" — random fixes create new bugs
- "Just try changing X and see" — guessing is not debugging
- "It's probably X, let me fix that" — probability is not root cause
- "Let me just fix it directly" — never implement a fix without presenting the conclusion and fix plan to the user first
- "One more fix attempt" (after 2+ failures) — 3+ failures signals an architectural problem, not a debugging one
Gotchas
- Caching masks the real state. Build caches (Vite/Webpack), module caches (
node_modules,__pycache__,.gradle), Docker layers, and browser caches can serve stale code — making a fix look ineffective or a bug appear intermittent. After a fix that "didn't work," rule out a stale cache before forming a new hypothesis. - Flaky locally, consistent in CI (or vice versa) usually means a race or an environment delta. Suspect: timing/ordering between tests, different dependency versions, missing env vars, or a test polluter that runs earlier in the CI shard.
- A green test does not prove the code works. Over-mocked tests assert the mock's behavior, not the system's. A bug can hide behind a passing test — check that the test exercises real behavior.
- Silent failures are worse than loud ones. Swallowed exceptions, caught-and-ignored promises, and
|| defaultValuefallthroughs erase the evidence. Re-surface them temporarily to find the source. - Log to stderr, not the app logger, when debugging in tests. Application loggers are often muted in test runs; use
console.error/stderr so output appears. When a call chain can't be traced by reading code, capturenew Error().stackbefore the operation to name the triggering caller.
When Process Reveals No Root Cause
If systematic investigation reveals the issue is truly environmental, timing-dependent, or external:
- Document what you investigated.
- Implement appropriate handling (retry, timeout, error message).
- Add monitoring/logging for future investigation.
After Debugging
Once the root cause is identified and the fix is verified, return to the workflow step that was interrupted. If debugging was triggered by a subagent failure in executing-plans, re-dispatch the implementer with the root cause analysis to apply the fix. If debugging was triggered by a user directly asking about a bug, report the findings and fix.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/systematic-debugging/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/0x2e/dev-skills/systematic-debugging)