agentleFS
bt2gobt2go/claude-skills/skills/debug-loop/SKILL.md

debug-loop

Skill0 starsChanged 3 months agoMITView on GitHub

Use when something is broken, a test fails, or the user reports behaviour that does not match expectations.

4 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

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 7

    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:

    Write down the observed behaviour and the expected behaviour in one line each.

    line 12
  2. Distinctive:

    Read the actual error and stack trace in full, including the frames you think are boilerplate.

    line 14
  3. Distinctive:

    Run the experiment. If the hypothesis survives, narrow further.

    line 17
  4. Distinctive:

    Add a regression test that fails on the old code.

    line 20
  5. Distinctive:

    Never swallow an error to make output look clean.

    line 24
  6. Distinctive:

    Never add defensive branches for states that cannot occur.

    line 25
  7. Distinctive:

    Never declare it fixed without rerunning the reproduction.

    line 26

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

Find the cause. Do not patch the symptom.

Procedure

  1. Write down the observed behaviour and the expected behaviour in one line each.
  2. Get a reproduction you can run on demand. Without one, everything after this is guessing.
  3. Read the actual error and stack trace in full, including the frames you think are boilerplate.
  4. Form the smallest hypothesis that would explain all the evidence.
  5. Design one cheap experiment that would disprove it: a log line, a breakpoint, a narrowed input.
  6. Run the experiment. If the hypothesis survives, narrow further. If it dies, form a new one.
  7. Bisect when you are stuck: halve the input, halve the code path, or git bisect the history.
  8. Once found, fix the cause, then confirm the reproduction now passes and the wider suite still passes.
  9. Add a regression test that fails on the old code.

Rules

  • Never swallow an error to make output look clean.
  • Never add defensive branches for states that cannot occur.
  • Never declare it fixed without rerunning the reproduction.

Output format

Symptom: ...
Reproduction: <command>
Hypotheses tried: <list, each marked confirmed or ruled out>
Root cause: <file:line and why>
Fix: <what changed>
Regression test: <path>

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.