Every tool now reads one file: AGENTS.md at the repo root (the standard won). That makes it the highest-leverage document in vibe coding — the place where corrections stop evaporating and start compounding. This playbook is how to write one that gets read.
The five sections
Agents skim like tired reviewers: headings first, details only if forced. Give them exactly five headings:
- What this is — two sentences. Project, audience, one constraint that shapes everything.
- Commands — dev, test, lint, build. If the agent can’t run the checks, it can’t self-correct, and every other rule is wishful thinking.
- Conventions — the patterns the codebase actually follows. Imperative, one line each: “named exports only”, “use design tokens, never raw hex colors”.
- Forbidden moves — the mistakes that keep happening: “do not add dependencies without asking”, “never edit generated files”.
- Definition of done — what must pass before work counts: tests, lint, no unexplained TODOs.
The three rules
Short beats complete. An agent that reads 100 lines follows 100 lines. An agent handed 600 follows the first 80 and vibes the rest. When a rule needs a paragraph, it’s a doc page, not an AGENTS.md line — link out.
Derived, not invented. Bootstrap the file from the real code (our AGENTS.md bootstrap prompt does exactly this). Aspirational conventions nobody follows teach the agent to ignore the file — the worst possible outcome.
Grown from corrections. The maintenance loop is the whole point: when the agent breaks a convention, don’t just fix the output — add one line under the right heading. After a month the file is a map of every mistake that used to cost you an hour.
Anti-patterns, observed in the wild
- The constitution. Twelve sections of philosophy before the first command. The agent needs
npm teston line six, not values on line sixty. - The mirror. Copying another project’s file wholesale. Their conventions are their accidents.
- The graveyard. Rules for tools the repo abandoned two quarters ago. Delete them; stale lines teach the agent the file lies.
- The secret. An AGENTS.md that exists but isn’t committed. If it doesn’t ship with the repo, it’s not context — it’s your diary.
Ship it in two minutes
Use the generator to assemble your file, or start from the plain template and fill it in by hand. Then put one item on your calendar for the end of each week: read the file, delete what’s stale, add what hurt.