agentleFS
AnmarHaniAnmarHani/SwarmVault/skills/swarm-debug/SKILL.md

swarm-debug

Skill5 starsChanged 4 months agoMITView on GitHub

Systematic debugging — evidence before hypotheses, hypotheses before fixes, root cause before patches, and the diagnosis saved to the vault. Use for any real bug, test failure, regression, crash, or unexplained behavior — before proposing any fix.

1 other project uses 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. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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:

    No fix without a reproduced cause.

    line 8

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

swarm-debug — systematic debugging

No fix without a reproduced cause. Shotgun patching is how the same bug costs twice.

The loop

  1. Reproduce — a command/test that shows the bug, or record explicitly why reproduction is impossible. This is the entry gate for everything below.
  2. Evidence — read the FULL error, stack, and surrounding logs (not the first line); note what changed recently (git log, new deps, config).
  3. Locate — binary-search the causal chain: which layer last had correct data? Instrument with targeted prints/asserts if needed; remove them after.
  4. Hypothesize — ranked list, cheapest-to-test first. State each as a falsifiable claim ("the cache returns stale X when Y").
  5. Verify — one targeted experiment per hypothesis. Evidence kills or confirms; opinion does neither.
  6. Fix the root cause — not the symptom, when the root is reachable. If you must ship a symptom patch, say so in the code-note and open a ticket for the root.
  7. Regression test — must fail on the pre-fix code, pass on the fix. No test, no fix.
  8. Record (J1) — non-trivial diagnosis → memory note (the footgun, compact, ≤ 15 lines) + code-note link on the affected file, so no future session pays for this twice. Check the vault FIRST next time: swarmvault.py query --search "<symptom>" — someone may already have paid.

Hard rules

  • Three dead hypotheses → stop, step back, re-examine assumptions — including the spec and design ("is the requirement itself contradictory?").
  • A diagnosis that reveals a spec/design gap → route it to the question queue / SRS change management (swarm-spec), don't silently patch around it.
  • Performance bugs: measure before and after; a fix without numbers is a guess.

Influences: superpowers systematic-debugging; Pocock's diagnosing-bugs; Jeffallan's debugging-wizard — see CREDITS.md.

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.