agentleFS
CaduS0uzaCaduS0uza/qa-supreme/skills/root-cause-protocol/SKILL.md

root-cause-protocol

Skill1 starsChanged 2 months agoMITView on GitHub

Find the actual cause of a failure before changing any code — read the error, reproduce, bisect, form and test one hypothesis at a time. Use for any failing test, production incident, or unexplained behavior, especially when under time pressure.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the entire error: message, stack, cause chain, line numbers, request id, exit code.

    line 17
  2. Distinctive:

    Write the hypothesis as a falsifiable sentence: *"the second webhook is processed because the idempotency key is written after the charge, …

    line 39
  3. Very specific:

    Add the regression test before the fix if bug-repro has not already.

    line 49
  4. Distinctive:

    Ask "where else does this pattern exist?" — the same cause usually has siblings.

    line 51

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Root Cause Protocol

NO FIX WITHOUT A NAMED CAUSE.

Guess-and-check produces fixes that work by accident and break by surprise. Under pressure the protocol is faster than thrashing, because thrashing has no end condition.

Phase 1 — Read

Read the entire error: message, stack, cause chain, line numbers, request id, exit code. Most stack traces name the file and line of the actual problem, and most rushed engineers skip past them. Quote the relevant frame before you theorize.

Phase 2 — Reproduce

Reproduce deterministically, at the smallest scale (see bug-repro). Record the exact command. Intermittent? Amplify it (--repeat-each, load, parallelism) until the rate is measurable — you need a rate to prove the fix later.

Phase 3 — Locate

  • Bisect in time: git bisect run <command> — the fastest tool in this entire skill set when a thing used to work.
  • Bisect in space: disable half the input, half the config, half the middleware.
  • Compare the working case: same code, different environment/tenant/user — diff those, not the code.
  • Instrument at the boundary between "state is correct" and "state is wrong". Binary search on the data flow, not on your intuition.

Phase 4 — Hypothesize, one at a time

Write the hypothesis as a falsifiable sentence: "the second webhook is processed because the idempotency key is written after the charge, so a retry within the window sees no key."

Then design the cheapest experiment that could disprove it. Change one thing. If the experiment fails to disprove it, you have a cause. If you changed three things, you have nothing.

Phase 5 — Fix at the cause, then prove

  • Fix the cause, not the symptom. If you find yourself adding a retry, a sleep, a try/except: pass, or a null check to silence a crash — stop, you are at a symptom.
  • Add the regression test before the fix if bug-repro has not already.
  • Prove: the test was red, is now green, and the original reproduction no longer reproduces.
  • Ask "where else does this pattern exist?" — the same cause usually has siblings. Grep for them.

Output

SYMPTOM   duplicate charges, 3 reports this week
CAUSE     charges.ts:88 writes the idempotency key after the charge insert (non-atomic)
EVIDENCE  git bisect -> 8b1d07e; repro 2/2 within the 5s retry window; 0/20 after the fix
FIX       single transaction, key written first
SIBLINGS  same pattern in refunds.ts:41 (filed as a separate bug)

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.