debug
Skill2 starsChanged 9 days agoMITView on GitHub
Find and fix the real cause of a bug. Reproduces it first, shrinks it, tests one hypothesis at a time against evidence, bisects when it used to work, fixes the cause instead of the symptom, and keeps a test that fails without the fix. Use when something is broken, a test fails, an error or crash shows up, behavior is wrong or only fails sometimes, or the human asks to debug or fix a bug.
190 other projects use a version of this.
Adopted by
Most recently taken up by
- sentimony/skillstheir own version, first seen Nov 29, 2026
- ByronFinn/dev-skillstheir own version, first seen Nov 29, 2026
- Rune-kit/runetheir own version, first seen Nov 29, 2026
- Bazza1982/HASHItheir own version, first seen Nov 29, 2026
- alexcollins/skillstheir own version, first seen Nov 29, 2026
- Sagargupta16/craftsmanshiptheir own version, first seen Nov 29, 2026
Used with
Projects with it also use update-nanoclaw, add-atomic-chat-tool 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.
MicrosoftSkillupdate-nanoclaw
Efficiently bring upstream NanoClaw updates into a customized install, with preview, selective cherry-pick, and low token usage.
Also in 9 projects that use this
MicrosoftSkilladd-atomic-chat-tool
Add Atomic Chat MCP server so the container agent can call local models served by the Atomic Chat desktop app via its OpenAI-compatible API.
Also in 8 projects that use this
- +10 more from microsoft
Other versions190 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 190
- Yeachan-Heo/oh-my-claude-sisyphus★ 41ksame name
- Yeachan-Heo/oh-my-claudecode★ 41ksame name
- anthropics/knowledge-work-plugins★ 37ksame name
- nanocoai/nanoclaw★ 31ksame name
- gavrielc/nanoclaw★ 31ksame name
- qwibitai/nanoclaw★ 31ksame name
- openai/symphony★ 27ksame name
- FalkorDB/FalkorDB★ 11ksame name
- NVIDIA/TensorRT-Model-Optimizer★ 5.7ksame name
- NVIDIA/Model-Optimizer★ 5.7ksame name
180 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 repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- feature-testSkill
- full-testSkill
- kickoffSkill
- loggerSkill
- securitySkill
- visibility-handlingSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 8 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 176 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
If you cannot reproduce it, or it fails only in production, follow references/reproduce.md.
- Very specific: line 27
Look before you guess. Read the whole error, the stack trace and the logs.
- Distinctive: line 31
If it used to work, find the commit that broke it:
- Very specific: line 41
Test one hypothesis at a time, as references/hypotheses.md says: say what you expect to see if it is true, then run the check that could …
- Distinctive: line 54
Write a test for it that fails now, for the right reason (the cause, not a typo or a missing import).
- Distinctive: line 58
If the fix is local and small, fix it.
- Distinctive: line 59
If it changes the design, an API, stored data, or many files, explain the cause and the fix and ask the human first.
- Distinctive: line 61
After three failed fixes, stop.
- Distinctive: line 69
Remove every temporary line, until this prints "none left":
- Distinctive: line 85
Never "fix" an intermittent bug with a sleep, a retry, a bigger timeout or a skipped test.
- Distinctive: line 87
Never edit, loosen or delete a test to make it pass, unless the test itself is wrong, and then say so.
“Common” is measured: kept by at least 6 in 10 of the 176 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
A plausible story is not a cause. The cause is proven when a check that could have shown it wrong did not, and the fix makes a failing test pass.
Steps
Reproduce it: one command that shows the bug. Run it and watch it fail. If it fails only sometimes, run it in a loop:
python3 "${CLAUDE_SKILL_DIR}/scripts/repeat_until_fail.py" \ --command "<command>" --root <project folder>If you cannot reproduce it, or it fails only in production, follow
references/reproduce.md. Never call a bug fixed you never saw fail.- Shrink it: the smallest input and fewest steps that still fail, as
references/reproduce.mdsays. - Look before you guess. Read the whole error, the stack trace and the
logs. Check the plug: versions, config, env values, caches, stale
builds (the list is in
references/hypotheses.md). If it used to work, find the commit that broke it:
python3 "${CLAUDE_SKILL_DIR}/scripts/find_bad_commit.py" --repo <project folder> \ --good <commit that worked> --test "<command>" [--setup "<install>"]It runs in a throwaway copy. Keep the test outside the repo, as
references/bisect.mdsays.Test one hypothesis at a time, as
references/hypotheses.mdsays: say what you expect to see if it is true, then run the check that could prove it wrong. Change one thing at a time, and undo changes that did not help. Keep a short list in the chat of what you tried and what it showed, so nothing is tried twice.Tag every temporary print or log with
DEBUG-TEMPin a comment on the same line.- Find the cause: keep asking "why" until the answer is something you can fix and that explains every symptom. Then search the code for the same mistake elsewhere.
- Write a test for it that fails now, for the right reason (the cause, not a typo or a missing import). Watch it fail.
- Fix the cause, not the symptom.
- If the fix is local and small, fix it.
- If it changes the design, an API, stored data, or many files, explain the cause and the fix and ask the human first.
- After three failed fixes, stop. The design may be wrong; bring what you learned to the human instead of trying a fourth.
- Prove the fix: the test passes. Undo the fix, watch the test fail,
then put the fix back. For a bug that failed only sometimes, run
repeat_until_fail.pywith--timesat least 5 times the runs it took to fail before (and at least 50). Remove every temporary line, until this prints "none left":
python3 "${CLAUDE_SKILL_DIR}/scripts/check_debug_prints.py" --repo <project folder>- Hand off to feature-test to prove the change works as a whole.
- Report to the human, within the reply length the project asks for:
- the cause, and the evidence that proves it;
- the fix, and the test that fails without it;
- the same mistake found elsewhere, if any;
- anything not run, marked "not checked yet".
Gotchas
- Never "fix" an intermittent bug with a sleep, a retry, a bigger timeout or a skipped test. That hides it.
- Never edit, loosen or delete a test to make it pass, unless the test itself is wrong, and then say so.
- Catching and swallowing the error, or adding a null check where the value should never be null, patches the symptom.
- Evidence must be able to prove you wrong. A log that would print the same either way proves nothing.
- Adding prints can change timing and hide a race. If the bug goes away when you watch it, suspect timing.
- Your last failed attempt pulls you toward small tweaks of it. After a failed fix, go back to the evidence, not the last error message.
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.

