Instructions for Coding Agents: AGENTS.md

AGENTS.md is a file that complements the traditional README.md file in a project's repository. It provides detailed context and instructions that coding agents need, such as build steps, tests, and conventions. It is intentionally kept separate from the README.md to give agents a clear and predictable place for instructions, keep human-focused READMEs concise, and provide precise, agent-focused guidance. The AGENTS.md format is not proprietary and can be used by any coding agent or tool.

The AGENTS.md file can include sections such as project overview, build and test commands, code style guidelines, testing instructions, and security considerations. It can also include any other instructions that would be helpful for a new teammate. If the project is a large monorepo, nested AGENTS.md files can be used for subprojects.

AGENTS.md is an open format that emerged from collaborative efforts across the AI software development ecosystem. It is committed to benefiting the entire developer community, regardless of which coding agent is used. Coding agents such as OpenAI Codex, Amp, Jules from Google, Cursor, Factory, and many others are compatible with the AGENTS.md format. The AGENTS.md file can be added, updated, and configured for various coding agents as needed.

Why AGENTS.md?

AGENTS.md complements README.md by providing extra, sometimes detailed context that coding agents need. It contains build steps, tests, and conventions that might clutter a README or aren’t relevant to human contributors.

We intentionally kept it separate to:

  • Give agents a clear, predictable place for instructions.
  • Keep READMEs concise and focused on human contributors.
  • Provide precise, agent-focused guidance that complements existing README and docs.

This format is not proprietary, and we encourage anyone building or using coding agents to adopt it. One AGENTS.md works across many agents.

Examples

Sample AGENTS.md file

Dev environment tips

  • Use pnpm dlx turbo run where <project_name> to jump to a package instead of scanning with ls.
  • Run pnpm install --filter <project_name> to add the package to your workspace so Vite, ESLint, and TypeScript can see it.
  • Use pnpm create vite@latest <project_name> -- --template react-ts to spin up a new React + Vite package with TypeScript checks ready.
  • Check the name field inside each package's package.json to confirm the right name—skip the top-level one.

Testing instructions

  • Find the CI plan in the .github/workflows folder.
  • Run pnpm turbo run test --filter <project_name> to run every check defined for that package.
  • From the package root you can just call pnpm test. The commit should pass all tests before you merge.
  • To focus on one step, add the Vitest pattern: pnpm vitest run -t "<test name>".
  • Fix any test or type errors until the whole suite is green.
  • After moving files or changing imports, run pnpm lint --filter <project_name> to be sure ESLint and TypeScript rules still pass.
  • Add or update tests for the code you change, even if nobody asked.

PR instructions

  • Title format: []
  • Always run pnpm lint and pnpm test before committing.

About

AGENTS.md emerged from collaborative efforts across the AI software development ecosystem, including OpenAI Codex, Amp, Jules from Google, Cursor, and Factory. We’re committed to helping maintain and evolve this as an open format that benefits the entire developer community, regardless of which coding agent you use.

How to use AGENTS.md?

  1. Add AGENTS.md Create an AGENTS.md file at the root of the repository. Most coding agents can even scaffold one for you if you ask nicely.

  2. Cover what matters Add sections that help an agent work effectively with your project. Popular choices: Project overview, Build and test commands, Code style guidelines, Testing instructions, Security considerations.

  3. Add extra instructions Commit messages or pull request guidelines, security gotchas, large datasets, deployment steps: anything you’d tell a new teammate belongs here too.

  4. Large monorepo? Use nested AGENTS.md files for subprojects Place another AGENTS.md inside each package. Agents automatically read the nearest file in the directory tree, so the closest one takes precedence and every subproject can ship tailored instructions.

FAQ

Are there required fields? No. AGENTS.md is just standard Markdown. Use any headings you like; the agent simply parses the text you provide.

What if instructions conflict? The closest AGENTS.md to the edited file wins; explicit user chat prompts override everything.

Will the agent run testing commands found in AGENTS.md automatically? Yes—if you list them. The agent will attempt to execute relevant programmatic checks and fix failures before finishing the task.

Can I update it later? Absolutely. Treat AGENTS.md as living documentation.

How do I migrate existing docs to AGENTS.md? Rename existing files to AGENTS.md and create symbolic links for backward compatibility: mv AGENT.md AGENTS.md && ln -s AGENTS.md AGENT.md

How do I configure Aider? Configure Aider to use AGENTS.md in .aider.conf.yml: read: AGENTS.md

How do I configure Gemini CLI? Configure Gemini CLI to use AGENTS.md in .gemini/settings.json: { "contextFileName": "AGENTS.md" }