systematic-debugging · dshakes — Claude Code skill for debugging
This skill guides an agent from reproducing a failure to proving its cause, making a small fix, and adding a regression test. Use it for failing tests, panics, or unexpected behavior.
npx skills add dshakes/compass --skill systematic-debugging -a claude-codeWhat systematic-debugging does
The agent first creates a reproducible case and states a specific explanation that can be checked. It gathers evidence by inspecting the code or adding logs before editing anything. The fix should address the confirmed cause with as few changes as possible.
Next, the agent reruns the reproduction, checks nearby tests, and adds a regression test. For a difficult case, the skill can hand off to the debugger subagent or the triage command. Without a reproducible failure, it treats a proposed fix as unverified; changing several things at once also makes it harder to tell what solved the problem.
What it helps with
- reproduce a failure before editing code
- test a specific theory about an error
- fix a confirmed root cause with minimal changes
- add a test to catch a regression
Example prompts for the agent
- Find out why this test fails: reproduce the issue and verify its cause first.
- Investigate this panic, make the smallest fix, and add a regression test.
- Trace this error step by step, and hand it to the
debuggersubagent if the case is difficult.
How to install systematic-debugging
1Skills CLI (Vercel)
npx skills add dshakes/compass --skill systematic-debugging -a claude-code2Manually: put the files in place
~/.claude/skills/systematic-debugging/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/systematic-debugging/
1Skills CLI (Vercel)
npx skills add dshakes/compass --skill systematic-debugging -a codex2Manually: put the files in place
.agents/skills/systematic-debugging/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dshakes/compass --skill systematic-debugging -a cursor2Manually: put the files in place
.cursor/skills/systematic-debugging/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dshakes/compass systematic-debugging2Manually: put the files in place
.github/skills/systematic-debugging/SKILL.md1Skills CLI (Vercel)
npx skills add dshakes/compass --skill systematic-debugging -a gemini-cli2Platform CLI
gemini skills install https://github.com/dshakes/compass --path claude/skills/systematic-debuggingManually: put the files in place
.devin/skills/systematic-debugging/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dshakes/compass --skill systematic-debugging -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about systematic-debugging
How do I install systematic-debugging in Claude Code?
Run npx skills add dshakes/compass --skill systematic-debugging -a claude-code. The skill file is at ~/.claude/skills/systematic-debugging/SKILL.md.
What does systematic-debugging do?
It guides the agent through reproducing a failure, verifying its cause, applying a minimal fix, and adding a regression test. The cause should be established before code changes begin.
When does systematic-debugging hand off to a subagent?
For a difficult debugging case, it can delegate to the debugger subagent or the triage command.
Source text
SKILL.md · MIT
---
name: systematic-debugging
description: Use when something is broken — a failing test, panic, stack trace, error log, or wrong behavior whose cause isn't obvious. Reproduce it, form a hypothesis, PROVE the cause before changing code, then make the minimal root-cause fix and guard it with a test. For deep cases, hand off to the debugger subagent.
allowed-tools: Read, Grep, Glob, Bash, Edit
---
# Systematic debugging
Fix the cause, not the symptom — and prove the cause before you touch code.
## The method
1. **Reproduce** — get a reliable, minimal repro (a failing test is ideal). No repro → no fix.
2. **Hypothesize** — one specific, falsifiable guess about the cause ("X is null because Y").
3. **Prove it** — instrument/log/inspect to confirm the hypothesis *before* editing. If the
evidence contradicts it, form a new hypothesis. Don't guess-and-change.
4. **Minimal fix** — change the smallest thing that addresses the proven root cause.
5. **Verify** — re-run the repro; it passes. Run the surrounding tests; nothing regressed.
(See `verification-before-completion`.)
6. **Guard** — add/extend a test that would have caught it, so it can't silently return.
For a nasty one, delegate to the **`debugger`** subagent (or the `triage` command) — it
forms a hypothesis, proves it, and proposes the minimal fix.
## Red flags — you're not debugging, you're flailing
- **Changing code before reproducing** the problem.
- **Fixing the symptom** (swallow the error, bump the timeout) instead of the cause.
- **Several changes at once** — you won't know which one mattered.
- "It went away" with **no explanation of why** — it'll come back.
- Re-running hoping for a different result without changing your hypothesis.
## Done means
Root cause **proven** (not assumed) · minimal fix · repro now green · a regression test
added · no new failures. Anything less is **UNVERIFIED**.
© dshakes · MIT · dshakes/compass
Similar skills
All skills for Testing and QA →systematic-debugging by other authors comes first.