debug
Skill1 starsChanged 3 months agoMITView on GitHub
Systematic debugging — hypothesis before fix, root cause over symptom, scope decision before changing code. Use when a bug appears during implementation, in a log, or any time the answer isn't immediately obvious.
192 other projects use a version of this.
Adopted by
Most recently taken up by
- PeanutGT/NutsSkillstheir own version, first seen Nov 8, 2026
- jskswamy/skillstheir own version, first seen Nov 8, 2026
- Firzus/agent-skillstheir own version, first seen Nov 8, 2026
- domengabrovsek/agent-configtheir own version, first seen Nov 8, 2026
- domengabrovsek/claudetheir own version, first seen Nov 8, 2026
- microsoft/veronatheir own version, first seen Nov 8, 2026
Used with
Projects with it also use add-discord, add-slack and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkilladd-discord
Add Discord bot channel integration via Chat SDK.
Also in 11 projects that use this
MicrosoftSkilladd-slack
Add Slack channel integration via Chat SDK.
Also in 11 projects that use this
- +10 more from microsoft
Other versions192 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 192
- Yeachan-Heo/oh-my-claude-sisyphus★ 41ksame name
- Yeachan-Heo/oh-my-claudecode★ 41ksame name
- anthropics/knowledge-work-plugins★ 35ksame name
- gavrielc/nanoclaw★ 31ksame name
- nanocoai/nanoclaw★ 31ksame name
- qwibitai/nanoclaw★ 31ksame name
- openai/symphony★ 27ksame name
- FalkorDB/FalkorDB★ 10ksame name
- NVIDIA/TensorRT-Model-Optimizer★ 5.6ksame name
- NVIDIA/Model-Optimizer★ 5.6ksame name
182 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository17 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- architectureSkill
- code-reviewSkill
- commandsSkill
- conventionsSkill
- decisionSkill
- explainSkill
- isolateSkill
- issueSkill
- journeysSkill
- onboardSkill
- quick-workSkill
- safe-commitSkill
- safe-pushSkill
- scaffoldSkill
- todoSkill
- workSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. 0 are common, 19 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 175 edited versions we read keep these.
19
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Ask for, in order:
- Very specific: line 21
What changed recently?: If during /work implementation, it's the last code change.
- Distinctive: line 29
If yes, get the steps. The shorter the reproduction, the better.
- Distinctive: line 31
If no, this is a more dangerous bug (heisenbug).
- Distinctive: line 33
Add more logging at the suspect path and wait for next occurrence
- Distinctive: line 37
If no repro is possible after reasonable effort, stop and tell the user: "This needs more telemetry before fixing.
- Distinctive: line 45
Wait for an answer. If user says "I don't know", push: "Even an educated guess.
- Distinctive: line 73
Be honest if the user was wrong: Don't soften it. They want the truth, not validation.
- Distinctive: line 97
If out-of-scope: Stop. Tell the user:
- Distinctive: line 101
If yes, draft the issue title + body.
- Distinctive: line 110
No refactoring of surrounding code unless directly required
- Distinctive: line 111
No new dependencies unless absolutely necessary
- Distinctive: line 126
If a regression test isn't feasible (e.g., the bug is in infrastructure config), document this fact in the commit message and propose an …
- Very specific: line 134
Where it goes — the default never leaves
.claude/: Before writing, check whether the tooling here belongs to someone else: - Very specific: line 149
Never write outside .claude/ in this case, and never offer to.
- Very specific: line 151
Nothing tracked (a repo you own): Write .claude/lessons/mistakes/<YYYY-MM-DD>-<kebab-slug>.md, then offer the visible copy, once:
- Distinctive: line 155
Only on an explicit yes. Default is no.
- Distinctive: line 176
If the user declines, drop it without insisting.
- Very specific: line 180
If in-scope for /work: tell the user to invoke /safe-commit.
- Very specific: line 182
If out-of-scope (and they decided to fix anyway despite Phase 6): the fix is its own task.
- Distinctive: line 186
Don't accept "paste error → here's a fix" as a workflow.
- Distinctive: line 187
Don't fix without reproduction (Phase 2).
- Distinctive: line 188
Don't fix the symptom when the root cause is one layer deeper.
- Distinctive: line 189
Don't expand scope. Out-of-scope bugs are logged, not fixed.
- Distinctive: line 190
Don't skip the regression test.
- Very specific: line 191
Don't add Co-Authored-By: Claude to commits unless the repo opts in.
“Common” is measured: kept by at least 6 in 10 of the 175 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/debug — Hypothesis-driven debugging
You are Claude. The user has hit a bug. Your job is to prevent the "paste error → first fix → next error" loop, which drives bugs into hiding rather than resolving them.
Argument (optional): $ARGUMENTS may be the error message, the symptom, or a one-line description. If empty, ask: "What's the symptom?"
Phase 1 — Symptom capture
Ask for, in order:
- What is the exact error or wrong behavior? Full stack trace, full error text, exact output. Don't accept paraphrases like "it crashes" — that hides information.
- Where did it appear? Production log? Browser console? Test output? Cloud monitoring (which tool)? Local terminal during implementation?
- What did you expect to happen instead? This often reveals the gap between mental model and code reality.
- What changed recently? If during
/workimplementation, it's the last code change. If from a log alert, possibly an external dependency. Don't proceed until this is identified.
Phase 2 — Reproduction
Ask:
"Can you reproduce this on demand?"
If yes, get the steps. The shorter the reproduction, the better.
If no, this is a more dangerous bug (heisenbug). Note this fact prominently. Do not attempt to fix without reproduction. Without reproduction you can't verify the fix actually fixed anything. Strategies to get a repro:
- Add more logging at the suspect path and wait for next occurrence
- Reproduce in tests with the same inputs
- Mock the conditions (time, race, external service response)
If no repro is possible after reasonable effort, stop and tell the user: "This needs more telemetry before fixing. Suggest adding logging at X, Y, Z and revisiting when it triggers again." Don't guess-fix.
Phase 3 — User hypothesis (this step is non-negotiable)
Ask:
"Before I look — what's YOUR hypothesis on the cause? One line."
Wait for an answer. If user says "I don't know", push: "Even an educated guess. What's the most likely thing?"
This step is non-negotiable because:
- It forces them to engage their mental model
- It catches misconceptions early — if their hypothesis is wildly off, the bug points to a deeper misunderstanding
- It calibrates trust in the eventual fix (matching hypothesis = high confidence)
Phase 4 — Investigation
Now you investigate, NOT to fix, but to confirm or refute the user's hypothesis. Read the relevant code, logs, recent commits, type definitions, related tests. Capture:
- What the user's hypothesis predicted
- What the code actually shows
- The gap (or alignment)
Output:
USER HYPOTHESIS: <their guess>
WHAT THE CODE SHOWS:
- <observation 1, with file:line>
- <observation 2, with file:line>
- ...
DIAGNOSIS: <user's hypothesis was right / partially right / wrong; here's what's actually happening>Be honest if the user was wrong. Don't soften it. They want the truth, not validation.
Phase 5 — Root cause
Articulate the root cause in one paragraph. Use this template:
"The symptom is X because [proximate cause]. But the proximate cause exists because [deeper reason]. The actual fix should address [the deeper reason] to prevent the class of bugs, not just this instance."
Example anti-pattern (don't do this):
"The function returned null. Fix: add a null check."
Example senior pattern (do this):
"The function returned null because the upstream parser silently returns null on malformed input. The deeper issue is that we have no contract validation between parser and consumer. Fix: enforce a schema at the parser boundary so consumers get either valid data or a clear error, never null."
Phase 6 — Scope decision
Ask explicitly:
"Is this fix in-scope for your current
/worktask, or is it a separate problem you discovered?"
If in-scope: Continue to Phase 7. The fix becomes part of the current commit.
If out-of-scope: Stop. Tell the user:
"This is a separate problem. I'd suggest: (1) log it as a GitHub issue or in your STATUS.md TODOs, (2) note in code with a TODO comment if relevant, (3) return to the original
/worktask. The temptation to fix it now is real but it will blow up your scope. Want me to file the issue?"
If yes, draft the issue title + body. Otherwise, return to original work.
Resist the urge to fix out-of-scope bugs. This is the discipline.
Phase 7 — Minimal fix
Generate the smallest possible change that addresses the root cause from Phase 5. Constraints:
- No "while I'm here" cleanup
- No refactoring of surrounding code unless directly required
- No new dependencies unless absolutely necessary
- The fix should be reviewable as a single intent
Show the diff. State explicitly: "This fix addresses [the root cause] by [mechanism]. It does NOT touch [other things you might be tempted to change]."
Phase 8 — Regression test
Generate a test that would have caught this bug. Without this, the bug can recur.
The test must:
- Reproduce the EXACT conditions of the bug (from Phase 2)
- Fail without the fix (verify by mentally reverting)
- Pass with the fix
- Have a name that describes the bug (
it("returns 422 instead of null when parser hits malformed input"))
If a regression test isn't feasible (e.g., the bug is in infrastructure config), document this fact in the commit message and propose an alternative monitoring/alerting.
Phase 9 — Archive the lesson (optional, offer it)
The fix prevents this instance; the archive prevents the class. Offer:
"Want me to archive this in
.claude/lessons/? One file: symptom, root cause, prevention checklist. Takes 30 seconds and future sessions (and future you) can check it before repeating the pattern."
Where it goes — the default never leaves .claude/. Before writing, check whether the tooling here belongs to someone else:
git ls-files .claude CLAUDE.md 2>/dev/null | head -3Tracked results (a team repo). Your notes are personal, not team deliverables. Write
.claude/lessons/mistakes/<YYYY-MM-DD>-<kebab-slug>.local.mdand keep it out of theirgit status:grep -qF '.claude/**/*.local.md' .git/info/exclude 2>/dev/null || \ printf '# personal claude-workspace artifacts\n.claude/**/*.local.md\n' >> .git/info/exclude(Same line
/onboardwrites, and thegrepguard makes running both harmless.)Never write outside
.claude/in this case, and never offer to. A lesson file landing in the team's diff is exactly the leak this rule exists to prevent.Nothing tracked (a repo you own). Write
.claude/lessons/mistakes/<YYYY-MM-DD>-<kebab-slug>.md, then offer the visible copy, once:"Also drop a copy in
docs/mistakes/so the team finds it without knowing about.claude/?"Only on an explicit yes. Default is no.
The file, either way:
# <one-line symptom>
Date: <date> · Found in: <file/module>
## Root cause
<the Phase 5 paragraph — the deeper reason, not the proximate one>
## Fix
<one line + commit ref if available>
## Prevention checklist
- [ ] <check that would have caught this before it shipped>
- [ ] <second check if applicable>Before writing, glance at existing entries in .claude/lessons/mistakes/. If this is the second-plus occurrence of the same class of bug, say so and suggest promoting it: either a rule in the project's conventions file or a .claude/lessons/patterns/<slug>.md describing the correct approach — recurring mistakes are conventions waiting to be written. Patterns follow the same placement rule as mistakes.
If the user declines, drop it without insisting.
Phase 10 — Hand off
If in-scope for /work: tell the user to invoke /safe-commit. The commit message should reference: original spec + root cause + fix + test.
If out-of-scope (and they decided to fix anyway despite Phase 6): the fix is its own task. New /work spec retroactively, then /safe-commit.
What NOT to do
- Don't accept "paste error → here's a fix" as a workflow. Always run Phase 3.
- Don't fix without reproduction (Phase 2).
- Don't fix the symptom when the root cause is one layer deeper.
- Don't expand scope. Out-of-scope bugs are logged, not fixed.
- Don't skip the regression test. The test is the only thing that prevents recurrence.
- Don't add
Co-Authored-By: Claudeto commits unless the repo opts in.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

