root-cause-debugging
Skill98 starsChanged 2 months agoMITView on GitHub
Systematic debugging — reproduce, bisect, prove the cause with a falsifiable hypothesis, fix minimally, re-verify against the original repro. Use for any bug, test failure, regression, crash, wrong output, or flaky behavior, before proposing a fix — including "it used to work", "sometimes fails", and whenever a first fix didn't work. Not for pure environment failures (command-not-found, import errors) — see environment-first.
9 other projects use a version of this.
Adopted by
Most recently taken up by
- reddygopalkrishna/developer-agent-skillstheir own version, first seen Nov 8, 2026
- alfonsusenrico/pakemtheir own version, first seen Oct 25, 2026
- plori-ai/skillstheir own version, first seen Oct 22, 2026
- yuchi-chang/no-capetheir own version, first seen Oct 8, 2026
- AL-JANEF/janef-forgetheir own version, first seen Sep 19, 2026
- AL-JANEF/janefskillstheir own version, first seen Sep 19, 2026
Used with
Projects with it also use ui-ux-quality and security-audit.
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.
AL-JANEFSkillui-ux-quality
Make product flows clear and recoverable: primary action and next step obvious, forms with clear labels, validation timing, actionable errors, preserved input on failure, consistent navigation and terminology, and no hidden or surprising destructive actions. Use for user flows, forms, navigation, onboarding, dialogs, and interaction design.
Also in 3 projects that use this
CloudflareSkillsecurity-audit
Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.
Also in 4 projects that use this
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- reddygopalkrishna/developer-agent-skills★ 8same name
- 05-deepak-patidar/claude-skills★ 4same name
- yuchi-chang/no-cape★ 2same name
- AL-JANEF/janef-forge★ 1same name
- AL-JANEF/janefskills★ 1same name
- HEMANTH-A-7/engram★ 1same name
- alfonsusenrico/pakem★ 0same name
- nolotus/skills★ 0same name
- plori-ai/skills★ 0same name
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 repository38 other files it gives its agents.
- ambiguity-commitSkill
- api-surface-careSkill
- calibrated-recommendationSkill
- codebase-orientationSkill
- concurrency-reasoningSkill
- config-and-flagsSkill
- context-checkpointSkill
- cross-platform-careSkill
- data-loss-guardSkill
- data-migration-safetySkill
- dependency-changesSkill
- docs-as-contractSkill
- edge-case-sweepSkill
- environment-firstSkill
- error-message-qualitySkill
- escalate-vs-decideSkill
- estimation-and-scopingSkill
- explain-at-the-right-levelSkill
- generalize-the-correctionSkill
- git-hygieneSkill
- incident-diagnosisSkill
- leave-no-messSkill
- llm-app-codeSkill
- numerical-careSkill
- performance-investigationSkill
- perf-sanitySkill
- question-vs-taskSkill
- resource-lifecycleSkill
- reviewing-a-changeSkill
- security-reflexesSkill
- stop-thrashingSkill
- subagent-fanoutSkill
- surgical-refactoringSkill
- task-decompositionSkill
- test-designSkill
- untrusted-content-guardSkill
- verify-ui-visuallySkill
- workmanshipSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
If it does not reproduce, your job is to instrument until it does — not to fix blind.
- Distinctive: line 27
Before fixing, fill in: "The failure happens because [specific code] does [specific wrong thing] when [specific condition]." No …
- Distinctive: line 35
If the real fix is large and you ship a guard at the symptom, label it a mitigation in the report.
“Common” is measured: kept by at least 6 in 10 of the 8 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
Root-Cause Debugging
Weak debugging looks like: read the error → pattern-match to a familiar cause → apply a plausible fix → declare victory. Strong debugging proves the cause before touching the fix. Follow this sequence and do not skip stages.
Stage 1 — Reproduce before anything else
Run the failure on demand in the smallest command you can repeat (one test, one curl, one one-liner). Run it once before editing anything and record verbatim: the exact command, the observed output, the expected output. This is the acceptance test for the fix; every later claim is measured against it.
If it does not reproduce, your job is to instrument until it does — not to fix blind. Say in the report when you could not reproduce.
Stage 2 — Locate by bisection, not intuition
Cut the search space in half repeatedly:
- Pick one concrete value that ends up wrong and follow it backward from the symptom to the last place it was correct.
- Inspect at the midpoint of the suspected path (print/log/debugger), then midpoint again.
- Regression?
git log --oneline -- <file>,git bisect, or diff against last-known-good. - Distrust the error site. The line that throws is where bad state was noticed, rarely where it was created.
Stage 3 — State the cause as a falsifiable sentence
Before fixing, fill in: "The failure happens because [specific code] does [specific wrong thing] when [specific condition]." No placeholders — if you cannot name the code and the condition, return to stage 2.
Then try to break it: if this were true, what else would be broken, and what would a targeted check show? Predict the result before running the check. A prediction that misses means the hypothesis is wrong — back to stage 2. One hypothesis, one test; a hypothesis you haven't tried to break is a guess.
Stage 4 — Fix the cause, minimally
- Fix where the bad state is created, not where it is detected.
- Smallest diff that makes the stage-3 sentence false. If the fix touches code the sentence didn't name, stop — either the sentence is wrong or the diff is.
- If the real fix is large and you ship a guard at the symptom, label it a mitigation in the report. Never present a mitigation as a root-cause fix.
Stage 5 — Verify with the original reproduction
Re-run the exact stage-1 command and compare the output to the recorded expectation. Then run the surrounding suite for collateral damage. "The code looks right now" and "the new test passes" are not verification — the original repro passing is.
Report: the cause sentence, the repro command, before/after output, and any mitigation or unreproduced behavior. When the deliverable is a findings list rather than a fix, the reproduction-and-verification step is one of the findings, on its own line: name the exact action that shows the failure and the check that proves the fix. A list of causes with no way to confirm them is a hypothesis list.
When a fix attempt fails
Revert the failed fix before testing the next hypothesis — never test hypothesis B with fix A still applied. The failed fix is evidence: it falsified the sentence. Ask what its failure says about where the real cause is, then return to stage 3. Two failed fixes on the same failure means stop and zoom out (see stop-thrashing).
Flaky / intermittent failures
Don't average over the noise. Find the varying input: timing (race), ordering (test pollution, map iteration), environment (env var, port, clock), or data (random seed). Loop the repro (for i in $(seq 20); do ...; done) and record the failure rate before and after — "passed once" is not evidence for a flake fix.
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.

