debugduck
AGENTS.md4 starsChanged 4 months agoMITView on GitHub
When anything is broken, failing, flaky, slow, crashing, or behaving unexpectedly — a bug report, stack trace, failing or flaky test, regression, hang, memory leak, wrong output, a CI-only failure, or "works on my machine" — follow the procedure in skills/debug/SKILL.md. Read it before editing any code, then load only the reference files under skills/debug/references/ that match the bug in front of you. If asked to add logs, instrument a flow, or trace execution from A to Z, follow skills/debug/references/trace-first.md.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- .cursor/rules/debug.mdcCursor rule
- debugSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
When anything is broken, failing, flaky, slow, crashing, or behaving unexpectedly — a bug report, stack trace, failing or flaky test, …
- Very specific: line 11
If asked to add logs, instrument a flow, or trace execution from A to Z, follow skills/debug/references/trace-first.md.
- Distinctive: line 16
Reproduce before you diagnose. Diagnose before you fix: No repro means no feedback signal.
- Very specific: line 42
Before finishing: remove all debug instrumentation, read your own diff line by line, grep for the same bug elsewhere, and report as ROOT …
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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.
Files
AGENTS.md
Debugging
When anything is broken, failing, flaky, slow, crashing, or behaving unexpectedly — a bug
report, stack trace, failing or flaky test, regression, hang, memory leak, wrong output, a
CI-only failure, or "works on my machine" — follow the procedure in
skills/debug/SKILL.md. Read it before editing any code, then load
only the reference files under skills/debug/references/ that match the bug in front of you.
If asked to add logs, instrument a flow, or trace execution from A to Z, follow
skills/debug/references/trace-first.md.
The short version, which the full skill enforces:
- Reproduce before you diagnose. Diagnose before you fix. No repro means no feedback signal. If you genuinely can't reproduce it, say so and switch to evidence-mining — don't fix on spec.
- The bug is where the evidence points, not where it would be convenient.
- One variable at a time. Simultaneous changes destroy causality.
- To localize, trace the whole path in one pass. Instrument every checkpoint from entry to
symptom at once (numbered
CP01…CPnn), write down what each should print, run once, and find the first checkpoint where actual ≠ expected — everything upstream is then ruled out. Then stop and hand over the run command; don't guess a fix while waiting for the output. Protocol:skills/debug/references/trace-first.md. Fall back to binary search — code path, git history (git bisect run), the input, the config — when you can't re-run, the path is enormous, or logging perturbs the bug. - A root cause explains 100% of the observed evidence. Unexplained details mean you found a bug, maybe not the bug.
- Prove the fix by toggling it: revert it, watch the bug return; reapply it, watch it go. Then add a regression test and verify it fails on the pre-fix code.
- Never suppress a symptom you don't understand — no empty catch blocks, blind optional
chaining, added retries, bumped timeouts, or
# type: ignorepresented as a fix. - Label every claim
[observed],[inferred], or[assumed], and keep a hypothesis ledger (hypothesis → prediction → cheapest discriminating test → result) rather than guessing repeatedly.
When stuck after three refuted hypotheses, stop generating a fourth and run the assumption
audit in SKILL.md: am I running the code I think I am, on the right branch, with a fresh
build, in the right process and environment — and is the error even coming from my code?
Before finishing: remove all debug instrumentation, read your own diff line by line, grep
for the same bug elsewhere, and report as
ROOT CAUSE / EVIDENCE / FIX / VERIFIED / NOT FIXED.
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
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.

