AGENTS.md
AGENTS.md is an open format for guiding coding tools: a Markdown file at the root of a repository with the project's commands, conventions and rules, which tools such as Codex, Cursor, Jules and GitHub Copilot's coding agent read before they change code. In a monorepo the nearest AGENTS.md to the file being edited takes precedence, and Meadowstack ships one at its root with the rules every app follows.
By Bohuslav PoláčekChecked
### Permissions and audit
- Components ask `can(action, record)` via `<Can>`, `usePermission`, `useCan`; never compare roles in a component. All rules live in `domain/permissions.ts`; a backend enforces the same (Postgres RLS).
- Hide actions the user cannot take. A page the user cannot open shows `<NoAccess>` under its header. The demo's default visitor (the first of a company's `demoRoles`, an admin where a role met a wall) sees no `NoAccess` and no empty state on any route. Four-eyes: nobody approves their own record. Rejecting always needs a reason.
- Roles change the data, not only the menu: an external role (client, customer, guest, member) never sees internal costs, margins or other clients' records, in widgets, feeds, the bell, palette results and assistant answers as on the pages. Ask with the record (`can("site.read", site)`). Every state change writes an audit entry; show it with `AuditTimeline`.Why it matters in a business app
A coding tool asked for "an approve button" writes an approve button. Whether it also checks four-eyes, asks for a reason on rejection, writes a history entry and hides the button from the requester depends on whether anyone told it. AGENTS.md is where you tell it once, instead of in every prompt, and where a new developer reads the same rules.
The format has no required fields: it is Markdown. What helps most is concrete: the commands that check the work, the folder layout, and rules phrased so a reviewer can tell when one is broken.
How Meadowstack handles it
- One file, the rules in one wording. The root
AGENTS.mdholds the layout, the commands, the definition of done and the rules for every app: look and feel, the four states of every data view, permissions and audit, accessibility, forms, copy. - Nested files for their part. The website has its own
apps/web/AGENTS.md; the nearest file wins, as the format says. - Claude Code reads it through
CLAUDE.md, which imports it with@AGENTS.mdand adds the post-edit hook and the skills in.claude/skills:kit-module,kit-screen,kit-crud,kit-approval,kit-themeandkit-check. - Rules that are also checks. Many rules have a command behind them (
npm run checkruns 15 checks), so a broken rule fails, whoever wrote the code.
An app made with npm run new-app gets the agent rules adapted to an app and stamped with the kit version. More in the guide to coding with agents.
Common mistakes
- A wish list. "Write clean code" changes nothing; "never compare roles in a component, ask can()" does.
- The same rule in three files. They drift. One wording, one place, and the other files point to it.
- No commands. A tool that knows how to run the checks runs them.
- Secrets in the file. It is read by every tool and every person with the repository.
How Claude Code gets the same rules
@AGENTS.md
## Claude Code
- After every Edit or Write, a hook formats the file with Prettier and runs the token check on it (`scripts/hooks/post-edit.mjs`). If it reports a problem, fix it before moving on.
- Skills in `.claude/skills` cover the repeat jobs: `kit-module` (new module or demo company), `kit-screen` (new screen), `kit-crud` (new entity end to end), `kit-approval` (submit, approve, reject), `kit-theme` (client branding), `kit-check` (verify before saying done), `plan-app` (the conversation before an app or module: `contract.ts`, roles, screens and their archetypes), `review-ui` (audit and screenshots of the screens a change touched), `policy-review` (attack the permission rules with tests), `upgrade` (a new kit version into an app made with `new-app`). Use them instead of improvising.Sources
- AGENTS.mdChecked
Questions
What is the difference between AGENTS.md and CLAUDE.md?
AGENTS.md is the open format many coding tools read. CLAUDE.md is Claude Code's own file; Meadowstack's CLAUDE.md imports AGENTS.md, so the rules live once and Claude Code adds only its hook and skills.
Where should AGENTS.md go in a monorepo?
One at the root for everything, and a nested one inside a package that has its own rules. Tools read the nearest one to the file they edit, and a direct instruction in the chat overrides both.
Who maintains the AGENTS.md format?
Its site says it is stewarded by the Agentic AI Foundation under the Linux Foundation.
Two ways
Build it yourself, or have it built
Build it yourself
Build your app on the framework
Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.
One payment, lifetime updates
Get the frameworkHave it built
Have us build your app
Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.
After launch, Care keeps it improving, from €99 a month.
from €1,990
Describe your app