crombieman/undercurrent-cortex/systematic-debugging
Claude Code and agent skill by crombieman/undercurrent-cortex
- community
Checking that the SKILL.md file is still in the repository.
This skill should be used when encountering any bug, test failure, or unexpected behavior, before proposing fixes — enforces 4-phase methodology with root cause documentation.
Install
npx vskill@latest install crombieman/undercurrent-cortex/systematic-debuggingSKILL.md
The same SKILL.md was published earlier as crombieman/undercurrent-cortex/systematic-debugging.
Systematic Debugging
TL;DR: 3 hypotheses before touching code. Trace to reproduce. Isolate minimal repro. Verify fix + regression test. Document root cause before committing.
This is a rigid methodology skill. Follow the phases in order. Do not skip phases.
Phase 1 — Hypothesize
Before reading ANY source code or making ANY changes:
- List 3 plausible root causes ranked by probability.
- Each hypothesis must be specific and falsifiable — not "something is wrong with auth" but "the JWT expiry check uses
<instead of<=, causing tokens to be rejected 1 second early." - Write the hypotheses to the session journal (
memory/YYYY-MM-DD.md). - Do NOT open source files yet. Form hypotheses from the error message, stack trace, and your knowledge of the system.
Why 3? Forces you to consider alternatives before anchoring on the first theory. The correct root cause is often hypothesis #2 or #3.
Phase 2 — Trace
For each hypothesis, gather evidence:
- Read error logs — exact error message, stack trace, timestamps.
- Reproduce the bug — find the minimal trigger. If you can't reproduce it, you can't verify your fix.
- Read the relevant code paths — trace execution from trigger to symptom.
- Mark each hypothesis: confirmed, refuted, or inconclusive.
- Narrow to the most likely root cause. If all 3 are refuted, generate 3 more.
Phase 3 — Isolate
- Identify the minimal reproduction — the smallest input/state that triggers the bug.
- The fix should be as small as possible. If the fix requires changes to more than 3 files, re-evaluate whether you found the true root cause.
- If you're tempted to "fix it and also clean up nearby code" — don't. Fix the bug. That's it.
Phase 4 — Verify
All 4 sub-steps are required:
- Write a regression test that fails without the fix and passes with it. This test proves the bug is dead and prevents regression.
- Run the full test suite. The fix must not break anything else.
- Document the root cause in
tasks/lessons.mdwith:
- Pattern: What went wrong and why
- Fix: What the solution is
- Rule: How to prevent this class of bug in the future
- The lessons.md edit sets
root_cause_documented=truein session state, satisfying the stop-gate.
Stop-Gate Enforcement
When the session has fix: commits, the stop-gate checks root_cause_documented:
- minimal profile: No enforcement.
- standard profile: Warning at session end — reminds you to document root cause.
- strict profile: Blocks session end until lessons.md is updated.
The existing 2-block escape hatch allows force-approval if needed.
Anti-Patterns
- Don't fix symptoms. If the fix is "add a null check," ask why the value is null in the first place.
- Don't guess-and-check. Changing code to "see if this helps" without a hypothesis wastes time and can introduce new bugs.
- Don't skip the regression test. A fix without a test is a fix that will break again.
- Don't commit without documenting. If you understood the bug well enough to fix it, you understand it well enough to write 3 lines in lessons.md.
- Don't expand scope. A bug fix is not an opportunity to refactor. Fix the bug, commit, then open a separate task for cleanup.
See Also
- tdd-enforcement — Debugging produces regression tests; TDD prevents the bug class from recurring [related]
- pattern-escalation — Recurring bug patterns discovered during debugging should be escalated [downstream]
Security
- Security scanPassed, 90 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/crombieman/undercurrent-cortex/systematic-debugging)