docs/contributing/editing-agent-instructions.md
Read this before modifying
AGENTS.mdor any guide it links to.
AGENTS.md loads on every agent request; domain guides load on entry to a relevant area.
Keep AGENTS.md under 200 lines and each domain guide under 300 lines.
When a file exceeds its budget, split or prune — do not compress prose to fit.
Before writing a new rule, ask whether it is actually needed:
AGENTS.md and every linked guide for overlapping guidance.If any of the above apply, do not add the content.
The goal is a lean AGENTS.md plus rich domain guides that teach agents what they can't learn from the code alone.
| Scope | File |
|---|---|
| Project-wide invariants (contribution policy, env setup, test/lint commands, commit conventions) | AGENTS.md |
| Area-specific knowledge (model patterns, format details, deprecation timelines) | Domain guide |
Rules of thumb:
AGENTS.md — but first verify agents don't already do it.Add what agents can't infer from the code or public docs: project-specific conventions that differ from standard patterns, correct approaches that require cross-file context, and fixes for repeated mistakes. Each entry should be short, specific, and actionable — e.g., which files to touch, what order to change them in, and which tests to run.
search for X instead of hardcoded file paths.AGENTS.md.| Pattern | Problem |
|---|---|
| Reactive accumulation | Adding a rule per incident without pruning leads to bloat |
| Copy-paste between guides | Duplicated content drifts apart; keep in one place, link from the other |
| Imperative walls | Long DO NOT lists that agents skim past; consolidate into principles |
| Config snapshots | Show the command to get the value, not the value itself |
Before submitting changes to any agent instruction file:
AGENTS.md, area-specific in a domain guide?AGENTS.md < 200 lines, domain guides < 300 lines?