roots
AGENTS.md0 starsChanged 41 days agoMITView on GitHub
This file holds the non-negotiable conventions, the commands that define "done", and pointers to where facts live. It is not the architecture handbook. Every fact has one canonical home; this file links to it and never restates it. The one exception is the Commands list below: it restates the done gate verbatim because it is the contract for "done", so keep it in sync when a gate command changes. When this file and a spec or decision record disagree, the…
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 31,774 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 repository21 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- first-runSkill
- fix-ciSkill
- new-adrSkill
- new-packageSkill
- new-specSkill
- prSkill
- releaseSkill
- sync-templateSkill
- update-depsSkill
- verify-docsSkill
- first-runSkill
- fix-ciSkill
- new-adrSkill
- new-packageSkill
- new-specSkill
- prSkill
- releaseSkill
- sync-templateSkill
- update-depsSkill
- verify-docsSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
18 rules. About 0 are common, 4 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 8
Every fact has one canonical home.
- Very specific: line 51
Test: pnpm test (turbo; single package: pnpm --filter <package> test)
- Very specific: line 52
Test hooks: pnpm test:hooks (agent guard allow/deny fixtures)
- Very specific: line 53
Test sync: pnpm test:sync (template-sync fixtures)
- Very specific: line 54
Test docs: pnpm test:docs (docs checker fixtures)
- Very specific: line 55
Test gates: pnpm test:gates (verify, the workflows, and this list name the same gates.
- Very specific: line 75
Test, watch: pnpm --filter <package> test:watch (vitest in watch mode.
- Very specific: line 88
ALWAYS use pnpm, never npm, yarn, or bun (guard-enforced in Claude Code, Codex, and Gemini CLI once the folder and hooks are trusted, see …
- Very specific: line 92
ALWAYS use TypeScript: no .js/.mjs, erasable syntax only, no class, explicit .ts/.mts on relative imports (tsc erasableSyntaxOnly and …
- Very specific: line 96
ALWAYS write docs as portable markdown (pnpm docs:portability.
- Distinctive: line 98
ALWAYS write Conventional Commits with a lowercase subject of at most 50 characters and body lines under 100 (commitlint), and NEVER bypass …
- Very specific: line 101
ALWAYS give every exported symbol a / */ block saying what it is for and what a caller cannot see from the signature (presence is …
- Very specific: line 104
NEVER push to a protected branch: PROTECTED_BRANCHES in the env block of .claude/settings.json, default main (guard-enforced.
- Very specific: line 108
NEVER hand-edit generated content: automd marker regions and the .agents/skills mirror (run pnpm docs:gen).
- Very specific: line 110
NEVER rewrite an accepted decision record.
- Very specific: line 113
NEVER run dependency build scripts or touch allowBuilds in pnpm-workspace.yaml (the guard blocks the flags.
- Distinctive: line 125
When behavior changes, source, tests, and its spec change in the same PR.
- Distinctive: line 162
If this session did not start at the root, tell the user.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
Agent rulebook
How this file works
This file holds the non-negotiable conventions, the commands that define "done", and pointers to where facts live. It is not the architecture handbook.
Every fact has one canonical home; this file links to it and never restates it. The one exception is the Commands list below: it restates the done gate verbatim because it is the contract for "done", so keep it in sync when a gate command changes. When this file and a spec or decision record disagree, the spec or decision wins; fix the loser in the same PR.
The budget is 200 lines, enforced by pnpm docs:check. When a section outgrows
its space, move the content to its canonical home and leave a link.
Skills, the procedures, live in .claude/skills/ (Codex and Gemini read the
generated .agents/skills/ mirror); path-scoped rules live in .claude/rules/
(Claude Code only; this file carries the same pointers).
| Topic | Canonical source |
| What this project is | README.md |
| Why a decision was made | docs/internal/decisions/ |
| What the system does now | docs/internal/specs/ |
| One fact, one home, three-place sync | spec-discipline |
| Markdown authoring rules | markdown-portability |
| Prose rules for every artifact | writing rules |
| The words every page uses | vocabulary |
| Docs toolchain, recipes, growth paths | docs-toolchain |
| Why the conventions are what they are | conventions (template-owned, synced) |
| Agent guard threat model | guards |
| How each agent tool reads the rulebook, guards, skills, and writing rules | agent-surfaces |
| Template sync recipe and contract | sync-template |
| Setup and install | setup |
| Branch names and the PR flow | CONTRIBUTING.md |
<!-- This table is the canonical-home map. Add one row per fact as homes appear
(ports, env vars, glossary, deploy runbook, architecture overview, runbooks/,
design/). A fact with no row gets one home and one row. -->Commands
A task is complete only when every gate command below that your change can
affect passes clean after your last edit. When unsure which apply, run
pnpm verify, which runs them all.
- Done gate:
pnpm verify(the frozen-lockfile install, then the gate commands below, in CI order; stops at the first failure;pnpm verify <gate>resumes there,pnpm verify --only <gate>runs one) - Build:
pnpm build(turbo; packages that definebuild) - Test:
pnpm test(turbo; single package:pnpm --filter <package> test) - Test hooks:
pnpm test:hooks(agent guard allow/deny fixtures) - Test sync:
pnpm test:sync(template-sync fixtures) - Test docs:
pnpm test:docs(docs checker fixtures) - Test gates:
pnpm test:gates(verify, the workflows, and this list name the same gates; the rules the gates rely on hold in the workflows, ESLint, lint-staged, turbo, package tsconfigs, the install hook, verify's drift gate, the secret scan, and.gitignore; changelogen sends no commit author's email out unlesschangelog.excludeAuthorslists names, and the release script refuses a dirty tree; the devcontainer'smountsshare no volume with another repository's container; eachscripts/test-*.mtssuite drops the inheritedGIT_variables before it starts a process) - Typecheck:
pnpm typecheck - Lint:
pnpm lint. Runpnpm lint:fixafter making code changes. - Secrets:
pnpm lint:secrets(secretlint over every tracked file, a force-added gitignored one included, and every untracked file.gitignoredoes not exclude; also in lint-staged) - Boundaries:
pnpm boundaries(turbo: imports stay inside their package unless by package name, and every imported package is declared) - Docs, regenerate:
pnpm docs:gen(the.agents/skillsmirror and any automd region) - Docs, validate:
pnpm docs:check && pnpm docs:portability - Docs, build (CI-blocking):
pnpm docs:internal:build && pnpm docs:public:build
Other commands, never part of done and never run to prove it:
- Install:
pnpm install(node 24 and pnpm first, as setup says) - Test, watch:
pnpm --filter <package> test:watch(vitest in watch mode; it never exits) - Sample app:
pnpm --filter @repo/example-app start(runs the sample CLI against the sample package) - Docs, preview:
pnpm docs:internal:dev/pnpm docs:public:dev(dev servers; they never exit) - Docs, list:
pnpm docs:list(decisions and specs, read from the files;decisionsorspecsprints one) - Sync:
pnpm sync:template(only when asked; stages the template's mechanics; the sync-template skill) - Release:
pnpm release(human-run; the push guard denies it to agents)
Non-negotiable rules
<!-- ALWAYS/NEVER imperatives, one or two lines each, mechanism in parentheses, a
pointer for the rest. Add a rule only after an agent got it wrong; every rule
dilutes every other rule. Prune rules that stop being true. -->- ALWAYS use
pnpm, never npm, yarn, or bun (guard-enforced in Claude Code, Codex, and Gemini CLI once the folder and hooks are trusted, see agent-surfaces;npxpasses as a one-off runner, preferpnpm dlx). - ALWAYS use TypeScript: no
.js/.mjs, erasable syntax only, noclass, explicit.ts/.mtson relative imports (tscerasableSyntaxOnlyand ESLint; the escape hatches for a dependency that demands a subclass or a JavaScript config are in conventions). - ALWAYS write docs as portable markdown (
pnpm docs:portability; rules in markdown-portability). - ALWAYS write Conventional Commits with a lowercase subject of at most 50 characters and body lines under 100 (commitlint), and NEVER bypass a git hook (guard-enforced): fix the failing check.
- ALWAYS give every exported symbol a
/** */block saying what it is for and what a caller cannot see from the signature (presence is lint-enforced, a tool config's default export aside; content is on you). - NEVER push to a protected branch:
PROTECTED_BRANCHESin theenvblock of.claude/settings.json, defaultmain(guard-enforced; the GitHub ruleset is the server-side boundary). Feature branches push and open PRs freely; merging is a human action; details in guards. - NEVER hand-edit generated content: automd marker regions and the
.agents/skillsmirror (runpnpm docs:gen). - NEVER rewrite an accepted decision record; supersede it and link both ways
(
docs:checkverifies the status vocabulary and the supersede link; a rewritten body is caught in review only). - NEVER run dependency build scripts or touch
allowBuildsinpnpm-workspace.yaml(the guard blocks the flags; each existing entry is a human verdict).
Judgment calls
For minor implementation choices such as naming, file placement, the shape of a refactor, or which of two equivalent approaches, pick a reasonable option and note it in the PR description. Ask first only for a change in scope, a new dependency, deleting user data or git history, or anything a guard denies.
Spec discipline
When behavior changes, source, tests, and its spec change in the same PR. The spec kinds, the concrete triggers, and generated versus hand-written are all in spec-discipline; read it before touching behavior.
Monorepo map
packages/example-package:@repo/example-package, sample library; replace it with (or rename it to) your first real package.apps/example-app:@repo/example-app, sample CLI consuming the package overworkspace:*; replace it with your first real app.
<!-- One line per package and its purpose, nothing else. A stale map is worse
than none; agents follow it literally. -->Placement alone registers a package: the workspace globs cover apps/* and
packages/*. Scaffold with the new-package skill.
Unit tests live in <package>/test/, never colocated in src/ (a colocated test
is a lint error).
A package with its own conventions gets a scoped AGENTS.md (same 200-line
budget) plus a sibling CLAUDE.md holding only @AGENTS.md. The pairing is for
Claude Code, which discovers nested CLAUDE.md and never nested AGENTS.md (the
import resolves relative to the file holding it). When Codex and Gemini load a
nested AGENTS.md is under
agent-surfaces.
Gotchas
<!-- What an agent gets wrong on first contact: naming traps, ordering
constraints, things tests cannot catch. When you hit a failure a future agent
would repeat, add a one-line entry in the same PR; delete entries that stop
being true. -->- Claude Code and Gemini CLI load project settings only from the directory they start in: started below the repository root, the guards and writing rules are off (agent-surfaces). If this session did not start at the root, tell the user.
pnpm docs:genmutates files; never run it inside a pre-commit hook.- automd swallows generator failures: it writes the error into the marker region
as a comment, exits 0, and re-runs byte-identical, so the drift gate stays
green.
pnpm docs:checkcatches it; never commit a generated region containing a warning comment. - The internal handbook is for the team: if you host it, gate it behind access control (recipe in docs-toolchain).
pnpm installrefuses any dependency version published in the last 48 hours (minimumReleaseAgeinpnpm-workspace.yaml); the registry is not broken, wait or pin the previous version.
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.

