agentleFS
ujjwal502ujjwal502/debugduck/AGENTS.md

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 code style.

    Of the AGENTS.md files we read, the 33,398 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 repositoryOne other file it gives its agents.

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
  1. Distinctive:

    When anything is broken, failing, flaky, slow, crashing, or behaving unexpectedly — a bug report, stack trace, failing or flaky test, …

    line 5
  2. Very specific:

    If asked to add logs, instrument a flow, or trace execution from A to Z, follow skills/debug/references/trace-first.md.

    line 11
  3. Distinctive:

    Reproduce before you diagnose. Diagnose before you fix: No repro means no feedback signal.

    line 16
  4. Very specific:

    Before finishing: remove all debug instrumentation, read your own diff line by line, grep for the same bug elsewhere, and report as ROOT …

    line 42

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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:

  1. 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.
  2. The bug is where the evidence points, not where it would be convenient.
  3. One variable at a time. Simultaneous changes destroy causality.
  4. 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.
  5. A root cause explains 100% of the observed evidence. Unexplained details mean you found a bug, maybe not the bug.
  6. 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.
  7. Never suppress a symptom you don't understand — no empty catch blocks, blind optional chaining, added retries, bumped timeouts, or # type: ignore presented as a fix.
  8. 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.

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.