agentleFS
jocarrdjocarrd/crux-agents/skills/root-cause/SKILL.md

root-cause

Skill4 starsChanged 18 days agoMITView on GitHub

Debug with discipline: reproduce before touching anything, measure instead of assuming, narrow the search space by bisection and separate the symptom from the cause. Use when something fails and you don't know why, when a previous fix didn't hold, when the failure only happens in production, or when you are about to propose a solution without having understood the problem.

27 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use prove-it, explain and 8 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-LabsSkill

    prove-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

  • sunnyclinches44Skill

    explain

    Explains code using real-world analogies and ASCII diagrams

    Also in 5 projects that use this

  • Microsoft AzureSkill

    design

    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

  • SentrySkill

    spec

    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

  • SentrySkill

    review

    Fixture review skill.

    Also in 6 projects that use this

  • Hugging FaceSkill

    implement

    Make tests pass. Invoke after /write-tests produces failing tests.

    Also in 3 projects that use this

  • +1 more from getsentry

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 25 edited versions we read keep these.

  • 8

    Distinctive

    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:

    If you can't reproduce it or point to the line, you are still investigating, even if you have a very convincing theory.

    line 16
  2. Distinctive:

    Write the minimal case that fails: what input, what prior state, what sequence.

    line 24
  3. Distinctive:

    If it doesn't reproduce locally but does in another environment, the difference between the two environments is the main clue.

    line 28
  4. Very specific:

    If it only fails in production, start with what production already knows: /prod-signals summarises its logs and says which error, how many …

    line 32
  5. Distinctive:

    Every claim during debugging needs evidence behind it.

    line 38
  6. Distinctive:

    In time: if it used to work, find the commit that broke it.

    line 49
  7. Distinctive:

    Ask "and why does that happen?" until the answer is something you can change and that explains all the observed symptoms, not just the one …

    line 58
  8. Distinctive:

    If the code belongs to someone else, or someone else decides what counts as a bug: record measurements, not diagnoses.

    line 88
  9. Distinctive:

    Changing things to see if it gets fixed: If it works, you won't know why.

    line 100

“Common” is measured: kept by at least 6 in 10 of the 25 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.

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

root-cause

The most common mistake when debugging is proposing the fix before understanding the problem. It usually works just well enough the first time to hide the real cause, which reappears a month later wearing a different face.

The rule

No fix is proposed until you can explain why it fails and prove it.

If you can't reproduce it or point to the line, you are still investigating, even if you have a very convincing theory.

1. Reproduce

Without reproduction there is no debugging: there is guessing. And you can't tell whether your fix worked either, because you have nothing to check it with.

Write the minimal case that fails: what input, what prior state, what sequence. If it only fails sometimes, that intermittency is a datum, not an obstacle: it points to timing, ordering, concurrency or cache.

If it doesn't reproduce locally but does in another environment, the difference between the two environments is the main clue. List it: versions, variables, data, permissions, latency, time zone.

If it only fails in production, start with what production already knows: /prod-signals summarises its logs and says which error, how many times and since when. It is more reliable data than the account of whoever saw it.

2. Measure, don't assume

Every claim during debugging needs evidence behind it. "The parameter must be arriving wrong" is not enough: print the parameter.

Instrument the whole path before looking at the detail: what goes in, what comes out of each layer, what was called and with what. Most hard bugs are solved on seeing that the data was already wrong three layers earlier.

3. Narrow by bisection

The most profitable technique and the least used.

  • In time: if it used to work, find the commit that broke it. Bisecting the history gives the answer in a few steps.
  • In space: split the system in half and check which side the failure is on. Repeat. Ten layers are covered in three or four tests.
  • In the data: reduce the input until removing one more thing makes the failure disappear. What remains is the cause.

4. Separate symptom from cause

Ask "and why does that happen?" until the answer is something you can change and that explains all the observed symptoms, not just the one that was reported.

Signs you have stopped at the symptom:

  • The fix is a special case for one particular input.
  • It adds a defensive check without knowing who sends the data wrong.
  • You couldn't say why the bug didn't show up before.
  • It works but you can't explain why.

That last one is the most dangerous: if you don't know why it works, you don't know when it will stop working.

And if fixing it turns an existing test red, don't edit it: stop and review the diagnosis. It is almost always the cause that is wrong, not the test.

5. Write down what you learned

Two outputs, and both matter:

A test that reproduces the bug, written before the fix and failing before it is applied. It is the only proof that you understood the problem.

A note where it is needed, if the cause was something not deducible from the code: odd behaviour in a dependency, an infrastructure setting, an assumption that turned out false. That doesn't fit in a comment and is lost if it isn't written in the project documentation.

When the system isn't yours

If the code belongs to someone else, or someone else decides what counts as a bug: record measurements, not diagnoses. Note what was measured, how to reproduce it and what question it opens. Don't declare something an error or conclude what is wrong without validation from whoever has the authority to say so.

And always distinguish what was measured from what was read in earlier documentation: documentation describes the intent at the time it was written, not the current state.

Anti-patterns

  • Changing things to see if it gets fixed. If it works, you won't know why; if not, you will have muddied the ground.
  • Fixing the first symptom. There is often a common cause behind three.
  • Accepting your own theory without checking it. The first theory is free; checking it costs two minutes.
  • Debugging with a warm cache. Half of the failures that don't reproduce come from a prior state you haven't cleared.

Related

  • /write-tests: the regression test that closes the bug
  • /prod-signals: what the production logs say, summarised
  • /ship: the gate that stops the fix from breaking something else

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.