AGENTS.md
Give agents a repo guide
Put the build command, test command, and repository rules where a coding agent can find them.
When to use it
Use it when contributors or coding agents need the same setup, conventions, and checks.
How to use it
- Put AGENTS.md at the repository root and write the exact setup and verification commands.
- Explain where changes belong and how to handle credentials.
- Run the listed commands yourself and keep the guide current as the repo changes.
When to choose another mechanism
A procedure shared by many repositories can live in a skill. A test that must always pass belongs in CI. An instruction file can point contributors to both, while access control, release approval and secrets stay in the systems that enforce them.
Guide as of . Read this wiki edition
Worked examples
Basic
For a package whose test script already exists, add this to the root file. An agent asked to fix a failing test can check its result against the same command a contributor uses.
# Working in this repository
Run `npm test` from the repository root.
When reporting a fix, name the test that reproduced the problem.Moderate
In a monorepo, give packages/docs/AGENTS.md the documentation build command and its working directory. Ask the agent to edit a page there. Check that it picked that package’s build and that the root instructions still apply wherever they are compatible.
Production
Use the Hopper exercise to compare an agent’s proposed instructions against a package manifest and README. For an actual repository, run the documented commands in a clean checkout and have a maintainer review changes to the instructions alongside changes to CI.