agentleFS
AL-JANEFAL-JANEF/janefskills/skills/engineering/root-cause-debugging/SKILL.md

root-cause-debugging

Skill1 starsChanged 53 days agoMITView on GitHub

Diagnose regressions, flaky behavior, crashes, build errors, and unclear failures with an evidence loop: reproduce, bound, hypothesize, observe, fix the cause at the narrowest correct boundary, then add a regression test. Use for any bug report or failure before patching a symptom.

9 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 0

    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. Very specific:

    If reproduction is impossible, make observability the smallest next change and state what evidence it should collect.

    line 38

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

A report names a symptom. The fix belongs at the mechanism that produced it, at the narrowest correct boundary, with a test that would have caught it. Shotgun edits, random retries, cache deletion, and dependency upgrades without a hypothesis are not debugging.

Evidence loop

  1. State expected and actual behavior precisely, with the exact error text or observation.
  2. Reproduce with the smallest reliable command, input, or test. Preserve the first meaningful error, before wrapper noise.
  3. Bound the failure by layer, data path, time, environment, and last known good state. Recent diffs, dependency or configuration changes, and environment differences are the usual suspects.
  4. Hypothesize one falsifiable cause and pick the cheapest observation that distinguishes it from the alternatives.
  5. Fix the cause at the narrowest correct boundary. Grep every caller of the function you are about to touch; a guard in the shared path beats a guard in one caller.
  6. Add a regression test that fails for the original mechanism, then run nearby and broader checks (testing-verification).

Useful evidence

  • Stack traces and exit codes before wrapper noise.
  • Data shape and lifecycle at the last good and first bad boundary.
  • Timing, ordering, ownership, and cancellation for concurrent or flaky failures.
  • Build errors: the first error, its file and line, and the toolchain version.

Avoid

  • Catch-all exception handling that hides the original failure.
  • "Fixing" tests to match broken behavior unless the contract itself changed, and saying so.
  • Large refactors before a minimal reproduction proves they are necessary.
  • Declaring a flaky test fixed without reproducing the flake or explaining why it cannot be reproduced.

If reproduction is impossible, make observability the smallest next change and state what evidence it should collect. Route to secrets-guard or security-logging before adding logging near sensitive data.

Output

## Bug: <symptom>
Reproduction: <command / input> → <observed>
Root cause: <mechanism at file:line>
Fix: <what changed and why here>
Regression test: <name> (fails before, passes after — output shown)
Nearby checks: <commands + results>
Residual risk: <what this does not cover>

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.