root-cause
Skill1 starsChanged 11 days agoMITView on GitHub
Debug by reproducing first, isolating the mechanism, then fixing the cause rather than the symptom, and keeping the reproduction as a regression test. Use when asked to debug this, fix this bug, find out why something happens, investigate a failure, or work out what is going wrong, and when a test fails intermittently or flakily, behavior differs between environments, or someone proposes raising a timeout, adding a retry, or skipping a test to make a problem go away.
We split this skill into the rules it gives an agent
11 rules. 0 are common, 11 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 22 edited versions we read keep these.
11
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 12
No reproduction, no fix. A change that makes a symptom disappear without a reproduction has an unknown effect on the cause.
- Distinctive: line 21
If you reach step 4, say explicitly that the bug is not reproduced and that any fix is therefore a hypothesis.
- Distinctive: line 25
Before investigating the code, rule these out.
- Distinctive: line 35
Bisect through history: when the code used to work:
- Distinctive: line 44
Bisect through the data: when the failure depends on input: halve the input until the smallest failing case remains.
- Distinctive: line 46
Bisect through the call path: when neither applies: find the midpoint between where the data is known good and where it is known bad, …
- Distinctive: line 69
Keep the fix minimal. A bug fix that also restructures three files cannot be reviewed as a fix or reverted as one.
- Distinctive: line 75
Run the full suite and report pass, fail, and skip counts.
- Distinctive: line 76
Keep the reproduction as a regression test, named for the behavior rather than the ticket, so it still reads in two years.
- Distinctive: line 77
Look for the same mistake elsewhere.
- Distinctive: line 85
Verification: test red before, green after.
“Common” is measured: kept by at least 6 in 10 of the 22 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
Find the cause, then fix it
The fix is the easy part. Almost every bad fix comes from skipping straight to it.
Reproduce before anything else
No reproduction, no fix. A change that makes a symptom disappear without a reproduction has an unknown effect on the cause.
Work toward a reproduction in this order, stopping at the first one that works:
- A failing test. The best outcome: fast, specific, and it becomes the regression test.
- A single command that fails reliably.
- A manual sequence written down step by step, with the exact inputs.
- Conditions only, when the failure is rare: the inputs, environment, and timing under which it has been observed, plus the frequency.
If you reach step 4, say explicitly that the bug is not reproduced and that any fix is therefore a hypothesis. Do not present it as resolved.
Check the three cheap explanations
Before investigating the code, rule these out. Each takes under a minute and each accounts for a meaningful share of "impossible" bugs.
- Stale state: an old build, a cached dependency, a stale lockfile, a dev server that did not reload, a compiled artifact newer than nothing. Clean and rebuild.
- Environment difference: a different version of the runtime, a missing or different environment variable, a different OS path separator or line ending, a different locale, timezone, or filesystem case sensitivity. Diff the working environment against the broken one.
- You are not running the code you are reading: a shadowed module, an installed copy of the package taking precedence over the local one, the wrong branch, a different config file than the one you opened. Print a unique string from the file you believe is executing and confirm it appears.
Isolate the mechanism
The goal of this phase is one sentence: "X happens because Y". Until you can write it, you have not found the cause.
Bisect through history when the code used to work:
git bisect start HEAD <known-good-commit>
git bisect run <command-that-fails>This names the commit. It does not name the mechanism, so keep going.
Bisect through the data when the failure depends on input: halve the input until the smallest failing case remains. A one-field payload that still fails tells you more than the original 40-field one.
Bisect through the call path when neither applies: find the midpoint between where the data is known good and where it is known bad, inspect it there, and repeat. Three iterations covers an eight-layer stack.
Log the actual value, never the expected one. log("reached handler") tells you nothing. log({ userId, state: order.state, now }) tells you which assumption is false. Print types alongside values when a type is in question, since "0", 0, null, and undefined all read the same in most log output.
For an intermittent failure, suspect shared state between runs (a module-level cache, a database row left behind, a global), real time (a timeout, an ordering assumption, a date boundary), or concurrency (two things racing that usually finish in the convenient order). Run the single failing case in a loop to get the failure rate before and after any fix.
Then fix the cause
State the mechanism, then the fix, then why the fix addresses that mechanism and not just its symptom.
If the fix is a constant you cannot justify, you have not found the cause. Raising a timeout from 5 seconds to 30 because 30 works is a symptom fix: it leaves the real latency unexplained and fails again under load. Either explain why 30 is correct, with the measurement behind it, or keep looking.
Other symptom fixes, each of which hides the cause:
- A null check where the question is why the value is null.
- A retry around something that should not fail.
- A
try/catchthat makes an error stop appearing. - A sleep that makes a race usually resolve correctly.
- Widening a type to accept the wrong value that arrived.
- Disabling the test that caught it.
Any of these can be the right call under deadline pressure. When you choose one knowingly, say so, say what the real cause appears to be, and leave a comment that says why the workaround exists.
Keep the fix minimal. A bug fix that also restructures three files cannot be reviewed as a fix or reverted as one.
Close the loop
- Confirm the reproduction now passes.
- Confirm it failed before the fix: revert the fix, see it fail, reapply. Without this step you do not know your test covers the bug.
- Run the full suite and report pass, fail, and skip counts.
- Keep the reproduction as a regression test, named for the behavior rather than the ticket, so it still reads in two years.
- Look for the same mistake elsewhere. A bug found once in a pattern is usually in the pattern, not in the one site. Grep for it.
Report
- Symptom: what was observed.
- Reproduction: the command or steps, and the failure rate if intermittent.
- Mechanism: X happens because Y. One or two sentences.
- Fix: what changed and why it addresses Y.
- Verification: test red before, green after; suite counts including skips.
- Related sites: the same pattern elsewhere, fixed or flagged.
- Still unknown: anything you could not explain. Say it plainly rather than rounding up to solved.
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- crbnos/carbon★ 2.8ksame name
- formancehq/ledger★ 1.4ksame name
- jjanczur/tyran★ 81same name
- Vesely/skills★ 28same name
- composio-community/support-skills★ 18same name
- lalulali/vespyr★ 11same name
- nadirali1350/vetted★ 5same name
- Xnadir/vetted★ 5same name
- quocld/hephaestus-agent-skills★ 4same name
- MissingPackage/nightshift★ 3same name
14 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.
Used alongsideProjects with it also use prove-it, explain and 6 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.
Neko-Catpital-LabsSkillprove-it
Shared evidence rule for investigating, diagnosing, debugging, proving, or explaining what happened or why for any problem or situation: do not assert something is fixed, working, passing, merged, or running unless you personally observed it this turn and can show what you saw; do not assert it was caused by X until a repro and controlled isolation prove that cause.
Also in 3 projects that use this
sunnyclinches44Skillexplain
Explains code using real-world analogies and ASCII diagrams
Also in 5 projects that use this
renatorozasSkillgrill
Adversarial code review. Don't let me ship until the changes pass your scrutiny.
Also in 3 projects that use this
Microsoft AzureSkilldesign
Design rules and conventions for the API Center Portal. Use when editing detail pages, card components, badges, layout, navigation, sidebars, or headers. Covers badge styling, metadata placement, page navigation patterns, and layout alignment.
Also in 4 projects that use this
Hugging FaceSkillimplement
Make tests pass. Invoke after /write-tests produces failing tests.
Also in 3 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 3 projects that use this
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/audit-security.mdcCursor rule
- .cursor/rules/bump-deps.mdcCursor rule
- .cursor/rules/onboard-repo.mdcCursor rule
- .cursor/rules/perf-hunt.mdcCursor rule
- .cursor/rules/restructure.mdcCursor rule
- .cursor/rules/review-diff.mdcCursor rule
- .cursor/rules/root-cause.mdcCursor rule
- .cursor/rules/ship-pr.mdcCursor rule
- .cursor/rules/test-gaps.mdcCursor rule
- .cursor/rules/triage-ci.mdcCursor rule
- audit-securitySkill
- bump-depsSkill
- onboard-repoSkill
- perf-huntSkill
- restructureSkill
- review-diffSkill
- ship-prSkill
- test-gapsSkill
- triage-ciSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

