Skip to content

Guide

What to put in AGENTS.md for a React business app

Updated

What the file is, and who reads it

AGENTS.md is a convention, not a product: one Markdown file at the root of the repository, written for the AI tool rather than for a new colleague. Tools that support it read it at the start of a task and treat it as standing instructions, so a rule written there applies to every prompt without being repeated.

Codex reads AGENTS.md as it is, and so do a growing number of other tools and editors. Claude Code reads CLAUDE.md, which can pull the other file in with a single line, @AGENTS.md, and then add what only Claude Code uses (hooks, skills). Cursor reads AGENTS.md as well and keeps its own rules folder for rules that apply only to some files. One file, read by all of them, is the point.

People read it too. A good AGENTS.md is also a short onboarding for a new developer.

The sections that earn their place

A map of the repository

Name the folders and what lives in each, one line apiece: where the components are, where the screens are, where data is loaded, where tests go. The tool otherwise spends its first minutes searching, and sometimes stops at the first plausible folder. A map also says what not to touch: generated files, vendored code, the build output.

Commands

A table of the commands for the jobs the tool will do: install, run the app, run all checks, run the end-to-end tests, format. Exact commands, not descriptions. If a task needs a step first (a database seed, a generated file), say so next to the command.

What "done" means

The most useful section and the most often missing. List what must be true before the tool says it has finished: the checks pass, the tests of the screens it touched pass, a new behaviour has a test, screenshots at phone and desktop width were looked at, no TODOs are left. Without it, "done" means "it compiled".

Rules, one wording in one place

Short, concrete, checkable rules, grouped by subject: look and layout, data and states, permissions, forms, accessibility, copy. Each rule is one sentence a person could verify on a screen. "Every list shows loading, error, empty and data states" is a rule; "write clean, maintainable code" is not.

Each rule appears once. If the same rule is also in a skill, a code comment and a README, the copies drift apart and the tool follows whichever it read last.

Where the rules live

As the app grows, some rules need more than a sentence: how to build a new screen, how an approval flow works, why a decision was made. Put those in their own files and give AGENTS.md a short table that points to them. The main file stays short; the detail is one step away when the task needs it.

Common mistakes

  • Essays. Paragraphs about the team's philosophy push the rules out of view. The tool reads the whole file every time; every sentence should change what it does.
  • Duplicated rules. The same rule in three places, in three wordings. Pick one place and delete the others.
  • Rules nothing checks. A rule without a script, a lint rule or a test behind it erodes quietly. If you correct the tool twice for the same thing, add a check.
  • Stale facts. A folder that was renamed, a command that no longer exists. The tool trusts the file more than the code, so a wrong map does real damage. Review it whenever the layout changes.
  • Secrets and personal data. The file is read by tools and often committed. Keys live in the environment, never here.

A template you can copy

A generic skeleton of about forty lines for a React business app. Replace the paths and commands with your own and delete what you do not need.

markdown
# Project instructions (all coding agents)

An internal web app for [what the company does]. React, TypeScript, Vite.
Each rule has one wording, in this file or in the file it points to.

## Layout

- src/components: the only place UI building blocks live. Screens import from here.
- src/screens: one folder per area of work; each screen is a list, record, form or dashboard.
- src/data: loading and saving; screens never call the network directly.
- src/permissions.ts: every rule about who may do what.
- e2e: end-to-end tests. Never edit dist or generated files.

## Commands

| Task        | Command        |
| ----------- | -------------- |
| Install     | npm install    |
| Run the app | npm run dev    |
| All checks  | npm run check  |
| End to end  | npm run e2e    |
| Format      | npm run format |

## Definition of done

1. npm run check passes.
2. The e2e tests of every screen you touched pass.
3. New behaviour has a test.
4. You looked at screenshots at 390px and 1440px, light and dark.
5. No TODOs, no commented-out code.

## Rules

- Build screens from src/components; never add a new table, dialog or form field elsewhere.
- Colours only through the design tokens; no raw colour values in components.
- Every data view shows four states: loading, error with retry, empty, success.
- Ask permissions through can(action, record); never compare roles in a component.
- Every change of state writes an audit entry.
- Every input has a visible label; one h1 per screen; everything works with a keyboard.
- Tables never scroll sideways on a phone.
- Messages say what to do next, in the app's language.

## Where the rules live

| What                      | Where           |
| ------------------------- | --------------- |
| How to build a new screen | docs/screens.md |
| Why a rule is what it is  | docs/decisions/ |

How Meadowstack Framework does it

The framework's own AGENTS.md follows this shape, filled in for a business app: the map of the kit, the starter and the example apps, the commands, a definition of done, and rules for look, data states, permissions, accessibility, forms and copy, with a table of where the longer rules live. Every rule there that can be checked has a script behind it, and the quick start shows the first prompt that puts it to work. The guide on keeping AI-generated UI consistent explains the checks.

Questions about this guide

Does Claude Code read AGENTS.md?

Claude Code reads CLAUDE.md. Put a line with @AGENTS.md at the top of CLAUDE.md and it reads both, so the shared rules stay in one file and CLAUDE.md holds only what is specific to Claude Code.

How long should AGENTS.md be?

Short enough to read in two minutes. Move anything longer than a few sentences into its own file and point to it from the table at the end.

Should AGENTS.md be committed to the repository?

Yes. It describes the repository, changes with it and should be reviewed like code. Keep keys and personal data out of it.

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-time, from €249

    Get the framework
  • Have 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