Rules files that coding agents actually obey

Agents ignore long manifesto rules. They follow short, enforceable limits that match how tools gate merges.

Published 2026-11-09 · Translation: VI

Agents ignore long manifesto rules. They follow short, enforceable limits that match how tools gate merges. Write operating constraints: allowed paths, forbidden moves, required checks. Not philosophy. The trap is shipping a 200-line AGENTS.md that feels productive and changes nothing.

What belongs in a rules file

Keep:

  • Path allow / deny norms for agent edits
  • Canonical lint, type, and test commands
  • Forbidden dependencies and high-risk moves
  • What evidence a PR must show

Push out style already covered by formatters, aspirational essays, one-off annoyances, and duplicated README/wiki prose. Related: Prompt injection in repos for the “repo text is untrusted” paragraph many teams need.

Write one screen, then wire it

Write

Write

  1. Inventory pain. Where agents actually go wrong: new frameworks, any, cross-package imports, skipped tests.
  2. Write one screen. Or split into linked short files. Prefer bullets a reviewer can fail.
  3. Load on boot. Wire into agent prompts and onboarding so the file is not optional folklore.
  4. Automate severity. Name the CI job next to the rule. Point at job output, not a paragraph, when it breaks.
  5. Prune monthly. Remove stale items. Add only recurring failures.

For monorepos: short root file plus package-local addenda. Avoid one universal novel.

Three traps that show up first

Failure modes to catch early

Failure modes to catch early

  • Manifesto bloat. Nobody reloads it; agents invent norms. Fix: one screen, delete fluff.
  • Contradictory sources. README, wiki, and AGENTS.md disagree. Fix: one owner file; others link to it.
  • No examples. Reviewers guess. Fix: one accept and one reject PR snippet per high-severity rule.

Track repeat violations. If a rule keeps breaking, automate it or delete it.

A one-week prune loop

This week: cut the rules file to one screen. Next week: attach CI job names to the top three rules. Print the short list in the PR template footer so skimming still sees the constraints.

Bottom line

When this fits vs when it does not

When this fits vs when it does not

Rules that agents obey are short, checkable, and loaded every session. Automate what you can, prune what you cannot enforce, and stop collecting manifesto pages. Pair with stop rules for agents when sessions thrash past the written limits.

Share

X Facebook LinkedIn
Educational content only. Rankings reflect stated criteria at the update date—not investment advice or permanent performance guarantees.