onchainpm-harness / template
AGENTS.md0 starsChanged 2 months agoApache-2.0View on GitHub
Shared project memory for every AI coding agent in {{PROJECT_NAME}}. Keep this file compact. Move area-specific instructions to the nearest nested AGENTS.md, or to long-lived docs under docs/engineering/ and docs/product/. CLAUDE.md imports this file. Do not add @path imports here unless every Claude Code session needs that content at startup. TODO(bootstrap): list each top-level folder with one line on what it holds. Point to its nested AGENTS.md when it has one. TODO(bootstrap): install, test, run one test file, lint, start…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- global/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- template/CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
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
- could be automatic: a setting could enforce it
- Distinctive: line 11
Put new guidance in the narrowest file that covers it.
- Very specific: line 12
When a rule needs examples or a runbook, keep the rule here and move the detail to docs/.
- Distinctive: line 27
Run the harness checks from the repository root:
- Distinctive: line 41
Use a feature branch and a PR for every change.
- Distinctive: line 42
Write the failing test first for new features and bug fixes.
- Distinctive: line 51
When you refuse a request or block an action, state three things: the rule it breaks, where that rule lives (file or ADR), and the …
- Distinctive: line 56
When a PR or issue addresses user feedback, quote the user verbatim with the source and date.
- Distinctive: line 57
Every PR that changes behavior needs a plain-language Proposed solution section: what was wrong, what we chose, and the trade-offs (H-4).
- Distinctive: line 60
Before you push new features, substantive changes or bug fixes, get an adversarial review from a different model than the one that wrote …
- Very specific: line 68
Read docs/design/README.md before any UI or interaction work.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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
AGENTS.md
Shared project memory for every AI coding agent in {{PROJECT_NAME}}. Keep this file compact. Move area-specific instructions to the nearest nested AGENTS.md, or to long-lived docs under docs/engineering/ and docs/product/.
CLAUDE.md imports this file. Do not add @path imports here unless every Claude Code session needs that content at startup.
Memory Budget
- Root
AGENTS.mdstays under 150 lines. RootCLAUDE.mdstays under 40 lines. - Each nested
AGENTS.mdorCLAUDE.mdstays under 100 lines. - Put new guidance in the narrowest file that covers it. Add it here only when it applies to every agent session.
- When a rule needs examples or a runbook, keep the rule here and move the detail to
docs/. scripts/check-agent-memory.shenforces these budgets in CI.- A nested folder gets an
AGENTS.mdplus a one-lineCLAUDE.mdthat contains@AGENTS.md.
Repository Map
TODO(bootstrap): list each top-level folder with one line on what it holds. Point to its nested AGENTS.md when it has one.
docs/- Product strategy, engineering specs, ADRs, and the design canon.tools/adr-verify/- Checks that ADR claims still hold in the code.
Core Commands
TODO(bootstrap): install, test, run one test file, lint, start the dev server. State the local dev port.
Run the harness checks from the repository root:
bash scripts/check-agent-memory.sh
bash tools/adr-verify/runner.sh
bash scripts/check-bootstrap.shArchitecture Invariants
TODO(bootstrap): the few structural rules that every change must respect (layering, where side effects may live, the source of truth for the schema).
Non-Negotiables
- Use a feature branch and a PR for every change. Never push to
main. - Write the failing test first for new features and bug fixes. CSS-only and HTML-only changes are exempt.
- TODO(bootstrap): name the data this product must never lose, and the one write path allowed to change it. Guard it with an ADR and a drift check.
- Record non-obvious decisions in
docs/engineering/decisions.md. When an ADR claims an invariant, add a check undertools/adr-verify/checks/. - Active work lives in the tracker, not in markdown. TODO(bootstrap): name the tracker, team and project, and the state new issues start in.
- User-facing changes need a
CHANGELOG.mdentry. - Stage explicit paths only. Never
git add -Aorgit add .. Other people's unfinished work may be in the tree.
When You Push Back
When you refuse a request or block an action, state three things: the rule it breaks, where that rule lives (file or ADR), and the compliant alternative. Never refuse without a path forward.
PR Expectations
- Link the relevant pillar in
STRATEGY.mdand each engineering spec or ADR the PR touches. - When a PR or issue addresses user feedback, quote the user verbatim with the source and date. A summary alone is not enough (H-4).
- Every PR that changes behavior needs a plain-language Proposed solution section: what was wrong, what we chose, and the trade-offs (H-4).
- UI PRs need screenshots of each affected state. Never commit screenshots. Attach them to the PR.
- Restart the dev server after code changes, before you test the UI.
- Before you push new features, substantive changes or bug fixes, get an adversarial review from a different model than the one that wrote the code.
Product Rules
TODO(bootstrap): who the users are, where and how they use the product, and the voice. Keep it to the rules that change daily decisions.
Design Direction
- Read
docs/design/README.mdbefore any UI or interaction work. It holds the laws and the check for each one. To break a law, raise it and change the law. - TODO(bootstrap): name the design system source (tokens, components) once it exists.
Read Before Touching
| Area | Read first |
| Any UI or interaction | docs/design/README.md |
| Decisions and their reasons | docs/engineering/decisions.md |
| How work flows (tracker, agents, gates) | WAYS_OF_WORKING.md |
| Scheduled agent routines | docs/agents/README.md |
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.

