agentleFS
lightarktechlightarktech/founder-coding-skills/skills/bug-autopsy/SKILL.md

bug-autopsy

Skill1 starsChanged 4 months agoMITView on GitHub

Structured diagnosis for bugs — no guess-and-patch. Use when something is broken, throwing, failing, or slow and the cause isn't already proven.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    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
  1. Distinctive:

    Fix the proven cause only: No drive-by cleanups in the same change.

    line 16
  2. Distinctive:

    No repro, no patch. "It's probably X" is not a diagnosis.

    line 21

≈ “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

The expensive failure mode isn't the bug — it's an AI guessing at the cause and "fixing" code it never proved guilty. Guess-patches breed regressions, and three guess-patches deep, nobody knows what the system even does anymore.

For the full catalog of ways to build and tighten a repro loop, see building-repro-loops.md.

The discipline

  1. Build a red light first. Before any theory, construct one command that reliably shows the bug — a failing test, a script, a curl. If you can't trigger it on demand, you don't understand it yet; keep working on the trigger, not the theory. For flaky bugs, raise the reproduction rate until it's debuggable — loop it 100×, pin the randomness, narrow the timing.
  2. Shrink it. Cut inputs and steps one at a time until everything that remains is load-bearing. A minimal repro shrinks the suspect list for free.
  3. List 3 candidate causes before testing any. One-hypothesis debugging anchors on the first plausible story. Each candidate must make a testable prediction: "if X is the cause, changing Y makes it disappear."
  4. Test one variable at a time. A probe that changes two things proves nothing.
  5. Fix the proven cause only. No drive-by cleanups in the same change.
  6. Re-run the red light — now green — plus the full test suite. Turn the repro into a permanent regression test.

Hard rules

  • No repro, no patch. "It's probably X" is not a diagnosis.
  • Production systems get read-only inspection; every change goes through the normal review path.
  • Close with a report: root cause, lines changed, proof of the fix.

Success criteria

The commit message names the proven cause. The repro is now a regression test. Nothing unrelated changed.

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.