root-cause
Skill4 starsChanged 8 days agoMITView on GitHub
Find and prove the cause of a bug, flake or slowdown before anyone fixes it. Builds a tight pass/fail loop that shows the reported symptom, shrinks it to a minimal reproduction, tests 3 to 5 ranked hypotheses that can each be proven false (in parallel worktrees when probes are slow), and ends with a diagnosis, meaning the cause at file and line, the failing test, fix options with their cost and risk, and where the work goes next (a pr-author fix PR, a roadmap fix node, an issue, or security-fix). Works alone or as a parallel-roadmap `diagnose` node. Use this skill whenever the user reports something broken, throwing, failing, flaky, wrong or slow, says "debug" or "why does", when a roadmap worker or pr-review reports "not reproduced" but the symptom stands, or when pr-author finds a bug whose cause is unclear, even if they do not say "root cause".
31 other projects use a version of this.
Adopted by
Most recently taken up by
- mkrz/skillstheir own version, first seen Nov 29, 2026
- crbnos/carbontheir own version, first seen Nov 29, 2026
- niksavis/basiclytheir own version, first seen Nov 27, 2026
- lalulali/vespyrtheir own version, first seen Nov 22, 2026
- AVP-Dev/pair-mailboxtheir own version, first seen Nov 22, 2026
- lifedever/skills-plugintheir own version, first seen Nov 16, 2026
Used with
Projects with it also use prove-it, grill 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.
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 4 projects that use this
renatorozasSkillgrill
Adversarial code review. Don't let me ship until the changes pass your scrutiny.
Also in 4 projects that use this
jasonmichaelbell78-creatorSkillskill-audit
Interactive behavioral quality audit for individual skills. Evaluates against 12 quality categories (including T25 convergence loop and completion verification) to surface attention management issues and produce actionable decisions. Includes self-audit verification that all decisions were actually implemented. Uses convergence loops in its own discovery phase. Produces a decision record and updated skill files.
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
SentrySkillspec
Produce a verified spec — problem, desired outcome, and acceptance criteria — before building. Use when given a GitHub/Linear issue link, when starting from a fuzzy in-conversation idea, or asked to "figure out what to do" / "scope this" / "what should I build" — whenever the *what* isn't yet pinned down. Grills the ambiguities, checks the premise against the code, and produces acceptance criteria you sign off on — then hands to design-first.
Also in 3 projects that use this
sunnyclinches44Skillexplain
Explains code using real-world analogies and ASCII diagrams
Also in 3 projects that use this
Other versions31 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 31
- crbnos/carbon★ 2.9ksame name
- formancehq/ledger★ 1.5ksame name
- jjanczur/tyran★ 78same name
- Vesely/skills★ 29same name
- composio-community/support-skills★ 18same name
- lifedever/skills-plugin★ 14same name
- lalulali/vespyr★ 11same name
- quocld/hephaestus-agent-skills★ 8same name
- nadirali1350/vetted★ 5same name
- Xnadir/vetted★ 5same name
21 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 repository15 other files it gives its agents.
- changesetsSkill
- docs-siteSkill
- goal-debateSkill
- issue-authorSkill
- landing-pageSkill
- parallel-roadmapSkill
- perf-passSkill
- plain-writingSkill
- pr-authorSkill
- pr-reviewSkill
- repo-setupSkill
- scoped-checksSkill
- security-fixSkill
- ts-styleSkill
- ui-styleSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 11 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 29 edited versions we read keep these.
11
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 32
Keep scratch files in .git/root-cause/<slug>/ (the diagnosis, the reproduction, captured traces).
- Distinctive: line 34
A vulnerability stops the run: Write nothing about it to the repo, an issue, a PR, a roadmap file or an inbox.
- Distinctive: line 35
Budget: Use the cap the user or the brief gives.
- Distinctive: line 41
Write down the exact symptom: the error text, the wrong value next to the right one, the timing, the rate of a flake.
- Very specific: line 49
Run each candidate through loop.py with --symptom:
- Distinctive: line 67
When the bug appeared between two known states (two commits, two versions, two datasets), run git bisect run with the loop in a worktree.
- Distinctive: line 71
Write 3 to 5 hypotheses before testing any.
- Distinctive: line 83
Prefer a debugger or REPL breakpoint over logs.
- Distinctive: line 84
Put logs at the boundaries that tell hypotheses apart.
- Distinctive: line 89
When every hypothesis is ruled out, write a new round from what the probes showed.
- Distinctive: line 100
Write each realistic fix as an option.
- Distinctive: line 124
Remove every temporary log: grep for the run's tag and expect no match.
- Very specific: line 125
Remove probe worktrees with wt.py remove.
- Distinctive: line 142
Write the diagnosis and all reports by the plain-writing rules if that skill is installed.
“Common” is measured: kept by at least 6 in 10 of the 29 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
A fix is only as good as its cause. This skill finds the cause with evidence and hands a fix-ready diagnosis to whatever ships the fix. It does not fix anything itself, except for the regression test it leaves ready.
The whole method rests on one thing: a command that goes red on this bug. With one, bisection, hypotheses and probes are mechanical. Without one, reading code produces guesses. So most of the effort goes into step 2.
Inputs
- A symptom from the user: an error, a wrong output, a flake, a slow path. Quote it exactly.
- A roadmap
diagnosenode: the brief's Goal holds the symptom and its Evidence line holds what is known. The diagnosis goes in the node'soutcome.md. - A "not reproduced" result from a roadmap worker or from pr-review, while the user or the report still shows the symptom.
- pr-author's "cause unclear": a bug found on the base with no clear cause.
Scripts
python3 <skill>/scripts/loop.py --runs 20 --symptom '<regex>' [--cwd <dir>] -- <command> # tight, slow, flaky, wrong-failure or green
python3 <skills>/pr-review/scripts/repro.py <base> <head> --copy <test> -- <command> # fails on base, passes on head?
python3 <skills>/pr-review/scripts/worktrees.py prepare --base <ref> --head <ref> # two checkouts side by side
python3 <skills>/perf-pass/scripts/bench.py --dir base=<path> --dir a=<path> -- <command> # slow paths: a cost beyond the noise
python3 <skills>/pr-author/scripts/wt.py new <branch> --base <ref> # one worktree per probeRules
- Work in worktrees, never in the user's checkout. Never run
git stash: every worktree shares one stash list. - Keep scratch files in
.git/root-cause/<slug>/(the diagnosis, the reproduction, captured traces). Git never commits that folder, so nothing leaks by accident. In a roadmap node, the diagnosis goes inoutcome.mdand the reproduction innodes/<id>/repro/instead. - Redact secrets in every command, output and artifact you show. Write
<REDACTED>. Build loops on environment variables so credentials stay out of what you show. - A vulnerability stops the run. Write nothing about it to the repo, an issue, a PR, a roadmap file or an inbox. Report it only to the user (or the orchestrator, as a subagent) and hand it to the security-fix skill.
- Budget. Use the cap the user or the brief gives. Without one, stop after five loop approaches that fail, or two rounds of hypotheses that are all ruled out. Report what you tried instead of guessing.
Steps
1. Pin the symptom
Write down the exact symptom: the error text, the wrong value next to the right one, the timing, the rate of a flake. Note where it was seen: commit, version, environment, input. A report is a lead. The code may have moved since.
"A cent too low" and "a missing item" are different bugs. Every later step checks against this exact symptom, so a different failure nearby is not mistaken for it.
2. Build the loop
Read references/loops.md for the kinds of loop and how to choose. In short, start with a failing test at the seam that reaches the bug. Then try a script against a running server, a CLI run diffed against known-good output, or a browser script. Later options are a replayed trace, a throwaway harness, a property loop, a bisection and a differential run.
Run each candidate through loop.py with --symptom:
- tight: red on every run, fast. Go on.
- slow: make it faster first. Cache setup, cut unrelated startup, narrow the test.
- flaky: raise the rate before debugging. Loop the trigger, add load, narrow timing windows. A 50% rate is debuggable and a 1% rate is not.
- wrong-failure: it fails for another reason. Fix the loop, not the code.
- green: it does not reproduce. Look for the input that does (step 2b).
For a slowdown, the loop is a benchmark: bench.py on the good and bad commits, with the cost beyond the noise. Logs do not find slowdowns. Measurements do.
2b. When nothing reproduces. The report is usually true and the loop uses the wrong input. Match the symptom: rounding errors point to floating point, ordering errors point to unstable sorts or races. Loop over a range of inputs against an exact computation, try boundaries (0, 1, empty, halves, the largest values), and try the inputs named in the report. If it still does not show after the budget, stop. Ask for access to the environment that shows it, a captured artifact (log, HAR file, core dump, recording with timestamps), or permission to add temporary instrumentation. Do not hypothesize without a loop.
Step 2 is done when you can name one command, already run, with its output shown, that loop.py calls tight (or flaky at a fixed, high rate).
3. Shrink it
Cut inputs, callers, config, data and steps one at a time, and rerun the loop after each cut. Keep only what the failure needs. Done when removing any remaining part turns the loop green. The minimal reproduction narrows the hypotheses and becomes the regression test.
When the bug appeared between two known states (two commits, two versions, two datasets), run git bisect run with the loop in a worktree. A first bad commit often names the cause outright.
4. Rank hypotheses
Write 3 to 5 hypotheses before testing any. One hypothesis anchors on the first idea that fits. Each one states its prediction:
If
<X>is the cause, then<changing Y>makes the loop green, and<changing Z>makes it worse.
A hypothesis with no prediction is a guess: sharpen it or drop it. Rank by likelihood and by how cheap the probe is.
Show the ranked list to the user before probing, or to the orchestrator as a roadmap worker. They often know which one changed last week, or which they already ruled out. Do not block on it: proceed with your ranking if no answer comes.
5. Probe
Each probe tests one prediction and changes one variable.
- Prefer a debugger or REPL breakpoint over logs.
- Put logs at the boundaries that tell hypotheses apart. Never log everything and grep.
- Tag every temporary log with one prefix per run, such as
[RC-a4f2], so one grep removes them all.
Parallel probes. When three or more hypotheses are left, they touch different code, and each probe takes minutes (a build, a long suite, a bisection), test them at once. Give each its own worktree with wt.py new and one agent, and send each agent only its hypothesis, the loop command and the prediction. Cheap probes run one after another: an agent that loads the repo costs more than a short probe. A roadmap worker is a subagent and cannot spawn agents, so it probes one at a time.
When every hypothesis is ruled out, write a new round from what the probes showed. After two rounds, stop and report (see Budget).
6. Confirm the cause
A cause is confirmed when three things hold. Changing it turns the loop green. Putting it back turns the loop red. It explains the exact symptom from step 1. Then:
- Cause, not symptom. Name the file, line and commit of the flaw. Search the other callers of that code and similar code for the same flaw.
- The seam. Find where a regression test reproduces the real pattern, as it happens at the call site. Turn the minimal reproduction into a test there. In a roadmap node it stays in
nodes/<id>/repro/until the fix node moves it into the suite. A failing test in the suite would break every check. Sometimes no seam reaches the real pattern, for example when a unit test cannot rebuild the chain of callers that triggers it. That is a finding: the architecture prevents locking this bug down.
7. Weigh the fix options
Write each realistic fix as an option. For each one give:
- Change: where and what, in one sentence.
- Reach: the callers, users or data the change touches. Count the call sites. Name the public API, file formats or stored data it changes.
- Cost: speed and size on a hot path, measured with
bench.pyorsize_diff.pywhen the changed code runs often or ships to a browser. A fix that trades speed or bytes for correctness says so with numbers. - Undo: can it be reverted alone, or does it change stored data, a format or a public API? Can it be tuned later (one constant, one flag) without another rewrite?
Recommend the option that fixes the cause at the smallest reach and cost. A workaround (a rounding step, a tolerance, a retry, a sleep, a special case for the reported input) is never the recommendation. List it only to say why not.
8. Write the diagnosis and route it
Fill in templates/diagnosis.md. Its Evidence part matches the Evidence line of a roadmap brief, so a fix node needs no new research.
| Verdict | Where it goes |
fix-small: clear cause, small fix | pr-author: a fix PR with the regression test, against the branch the policy gives for a fix |
fix-large: clear cause, large or risky fix | A roadmap fix node with a hard dependency on the diagnose node, or an issue when no roadmap runs, written with the issue-author skill. Ask the user before opening an issue. |
no-seam: no test can reach the real pattern | The fix as above, plus a refactor node or inbox entry for the seam |
vulnerability: reported, nothing written | security-fix, through the user only |
no-loop: nothing reproduces within the budget | The user, with what was tried and what to send |
not-a-bug: the code does what it should | The user, with the evidence. The report becomes a docs or feature question. |
9. Clean up
- Remove every temporary log: grep for the run's tag and expect no match.
- Remove probe worktrees with
wt.py remove. Keep.git/root-cause/<slug>/until the fix merges. - Rerun the loop on the fix branch when it exists. It must be green, and the regression test must pass.
- The fix's commit or PR names the confirmed hypothesis, so the next person learns from it.
What the user sees
Symptom: cart subtotal is 1 cent low for 3 x $6.665 ("expected 1999, got 1998")
Loop: python3 .git/root-cause/subtotal/repro.py, tight (20/20 red, 0.4s)
Minimal: one line item, price 6.665, quantity 3
Hypotheses: 4 ranked, 3 ruled out; confirmed: float multiply before rounding (src/cart.ts:42, since a1b2c3d)
Seam: src/cart.test.ts, test ready
Options: integer cents (recommended: 3 call sites, no speed change, reverts alone) | round per line (changes totals users have seen)
Verdict: fix-small, next step pr-author fix/subtotal-cents -> main
Cleanup: 0 [RC-a4f2] logs left, probe worktrees removedWrite the diagnosis and all reports by the plain-writing rules if that skill is installed.
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.

