agentleFS
VelimirMuellerVelimirMueller/ai-development-skills/skills/craft/debug-systematically/SKILL.md

debug-systematically

Skill7 starsChanged 15 days agoMITView on GitHub

Use when a bug resists the first fix — reproduce it, bisect to the introducing change, test one hypothesis at a time, fix the root cause, and add a regression test.

5 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

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 2

    Distinctive

    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:

    Prefer the simplest explanation that fits all the evidence.

    line 32
  2. Distinctive:

    Write the test that fails on the old code and passes on the fix.

    line 41

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

Debug Systematically

Replaces the "try things until it works" loop with a falsifiable process (The Pragmatic Programmer). Pairs with write-clean-tests — the regression test is the proof the bug cannot return.

1. Reproduce

A bug you cannot reproduce you cannot fix or verify. Capture the exact input, environment and steps that trigger it; if it is intermittent, add logging or run the loop until it fails. State the symptom in one sentence, not the suspected cause.

2. Bisect to the introducing change

git log --oneline -20
git bisect start 2>/dev/null   # only if you have a known-good and known-bad commit

Narrow the search by halves: the commit that introduced it, the one input field that matters, the one boundary value that flips it. The change that introduced the bug is the most reliable clue to its cause.

3. Test one hypothesis at a time

  • Form a falsifiable prediction ("if X is the cause, then changing Y fixes it and nothing else does").
  • Change one thing, observe, record. Never change several at once — you will not know which one worked.
  • Prefer the simplest explanation that fits all the evidence; resist the theory you already believe.

4. Fix the root cause

Fix the why, not the symptom. Patching the output where it shows up leaves the cause to resurface elsewhere. If the fix feels like a workaround, the cause is one level deeper.

5. Add a regression test

Write the test that fails on the old code and passes on the fix. That test is the proof the bug cannot return, and the reviewer's evidence the fix is real.

Verify

The symptom is gone under the exact reproduction, the bisect points to one change, and the regression test fails on the reverted fix and passes on it. State the root cause and the fix in the note.

When to deviate

  • An incident in production: stop the bleeding first (roll back, feature flag off), then debug the cause off the hot path.
  • A bug that reproduces only under a dependency's bug: fix or pin the dependency, do not build a shim.

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.

Reviews can't be read right now.

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.