agentleFS
mojopolymojopoly/three-loops/skills/diagnose/SKILL.md

diagnose

Skill0 starsChanged 3 months agoMITView on GitHub

Disciplined debugging loop for real bugs — reproduce, minimize, hypothesize, instrument, fix, regression-test. Use when something is broken, throwing, flaky, or slower than it was, and the cause isn't obvious in one read.

193 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use zoom-out, to-prd and 10 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.
  • victorgarciaesgiSkill

    zoom-out

    Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.

    Also in 61 projects that use this

  • GoogleSkill

    to-prd

    Turn the current conversation into a PRD and publish it to the project issue tracker — no interview, just synthesis of what you've already discussed.

    Also in 56 projects that use this

  • GoogleSkill

    to-issues

    Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices.

    Also in 53 projects that use this

  • simo97Skill

    edit-article

    The user will invoke this skill to help them edit an article.

    Also in 17 projects that use this

  • simo97Skill

    write-a-skill

    Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.

    Also in 44 projects that use this

  • AnasX7Skill

    setup-pre-commit

    Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.

    Also in 27 projects that use this

  • +4 more from simo97

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 174 edited versions we read keep these.

  • 3

    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:

    Instrument, don't mutate: Add logging/assertions to observe the hypothesis.

    line 24
  2. Distinctive:

    Fix the cause, not the symptom: If the observed error is downstream (a null here because a write was skipped there), keep walking up.

    line 28
  3. Distinctive:

    Never claim a fix without having watched the reproduction fail before it and pass after it.

    line 43

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

Diagnose

The failure mode this prevents: guessing. Changing code before understanding the bug converts one bug into two. The loop is boring on purpose — each step gates the next.

The loop

  1. Reproduce first. A bug you cannot trigger on demand cannot be fixed with confidence — only coincided with. Script the reproduction (a test, a curl, a driven flow), and record the exact failing observation: message, wrong value, timing.
  2. Minimize. Shrink input, config, and code path until removing anything makes the bug vanish. The minimal reproduction usually names the culprit by itself.
  3. One hypothesis at a time. State it falsifiably: "the claim races the cancel because the update isn't status-guarded". Say what evidence would kill it.
  4. Instrument, don't mutate. Add logging/assertions to observe the hypothesis; do not change behavior yet. If the evidence kills the hypothesis, write down what you learned and form the next one — the discard pile is the map.
  5. Fix the cause, not the symptom. If the observed error is downstream (a null here because a write was skipped there), keep walking up. Ask "what made this state possible?" until the answer is a decision, not a line.
  6. Regression-test on the real reproduction (/tdd: red on the repro, then green). Then re-drive the original flow (/verify-live) to confirm the observed symptom — not just the test — is gone.
  7. Leave a trace. One of:
    • a VOLATILE: tripwire, if the cause was an external fact that will drift again (provider limit, API quirk, framework behavior);
    • a CONTEXT.md invariant, if the cause was a violated assumption;
    • a one-line note in the fix commit body for everything else.

Rules

  • Never claim a fix without having watched the reproduction fail before it and pass after it.
  • Timebox hypothesis cycles; after three dead hypotheses, re-minimize — the reproduction is usually hiding a variable.
  • Flaky ≠ unfixable: flakiness means time, ordering, or shared state is a hidden input. Make it explicit and the flake becomes deterministic.

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.