AGENTS.md examples. 5 templates to copy for Laravel, Next.js, Python and a monorepo

Five ready AGENTS.md templates for real project types, what each line is for and the mistakes that make agents ignore a file. Copy one, change the commands and check it in two minutes.

Part of the guideClaude Code tutorial 2026, the complete guide. Install, errors, commands, skills and plugins

In this article
  1. What every AGENTS.md template needs
  2. 1. Laravel and Vue in one repository
  3. 2. Next.js application
  4. 3. Python API
  5. 4. Monorepo with one file per package
  6. 5. A minimal file for a small project
  7. Mistakes that make agents ignore AGENTS.md
  8. Questions about AGENTS.md examples

In short

A good AGENTS.md is short and specific. It names the folders, the exact commands and what counts as done. Below are five templates for common project types. Each one is a starting point, so change the commands to the scripts your project really has. Then start a new agent session and ask which instructions it loaded. We checked the format rules on agents.md and in the Codex guide on 24 November 2026.

The most common AGENTS.md we see is one line long and says write clean code. An agent cannot run that. It can run npm test in the right folder, and it can stop when the build fails.

What the file is and which tools read it is in what is AGENTS.md. Here are only templates. The format's website says there are no required fields, so the headings below are a habit, not a rule.

What every AGENTS.md template needs

SectionWhat to writeWhy
Project mapWhich folder holds whatThe agent stops guessing paths
CommandsInstall, test, build, with the folderThe agent runs checks itself
RulesWhat not to touch, how to change dataFewer surprises in the diff
Done meansTests, build, a short reportThe agent knows when to stop

Leave out what the agent can read from the code anyway. Leave out passwords, keys and customer data, because the file lives in the repository.

1. Laravel and Vue in one repository

AGENTS.md
# Project map
backend is Laravel 12, frontend is Vue 3 with Vite.

## Commands
In backend run composer install, then php artisan test.
In frontend run npm ci, then npm test and npm run build.

## Rules
Change the database only through new migrations.
Do not edit files in vendor or node_modules.
Keep public page addresses as they are.

## Done means
Both test suites pass and the frontend build works.
Write two lines on what changed and how you checked it.

2. Next.js application

AGENTS.md
# Project map
Next.js app with the app router in app, shared code in lib.

## Commands
Install with pnpm install.
Run pnpm lint, pnpm test and pnpm build before you finish.

## Rules
Server code that reads secrets stays in server files only.
New pages need a title and a description.
Do not add a dependency without saying why.

## Done means
Lint, tests and build pass with no new warnings.

3. Python API

AGENTS.md
# Project map
FastAPI service in app, tests in tests.

## Commands
Create the environment with python -m venv .venv and install requirements.txt.
Run pytest from the repository root.

## Rules
Every new endpoint gets a test.
Read settings from environment variables, never hard code them.

## Done means
pytest passes and new endpoints are listed in the README.

4. Monorepo with one file per package

In a monorepo, keep shared rules in the root and package rules next to the package. Agents read the nearest file in the folder tree. Codex goes further and joins the files from the root down to your starting folder. We describe that in AGENTS.md in Codex.

AGENTS.md
# Monorepo
Packages live in packages. Each package has its own AGENTS.md.
Use pnpm for everything. Run commands from the package folder.

## Shared rules
Do not change another package to make your tests pass.
Every pull request touches one package unless agreed otherwise.
packages/billing/AGENTS.md
# Billing package
Run pnpm test inside packages/billing.
Amounts are stored as integers in the smallest currency unit.
Any change to invoice numbering needs a review note.

5. A minimal file for a small project

Not every project needs sections. For a small script or a simple site this is enough to start.

AGENTS.md
Run npm test before you finish. Do not commit the .env file.
Explain every changed file in one line.

Mistakes that make agents ignore AGENTS.md

The file is in the wrong folder. Codex, for example, walks only down to your current folder, so a file in a sibling folder is never read. A second common case is a CLAUDE.md in the same project. Claude Code then reads CLAUDE.md and skips AGENTS.md, as the memory documentation explains.

Commands without a folder fail in a monorepo. Rules that contradict each other make the agent pick one at random. And a file that has grown past the limit gets cut off. Codex stops at 32 KiB of combined instructions by default.

Last, remember that the file is guidance. A rule saying do not touch payments is not a lock. Real limits go into permissions and the environment.

Want a first draft for your own project? Our free AGENTS.md generator builds the file from your stack, commands and rules. It runs in the browser, and you can copy or download the result.

Questions about AGENTS.md examples

Can I use the same AGENTS.md for Claude Code?

Yes. Claude Code reads AGENTS.md when the project has no CLAUDE.md. If you need both, import AGENTS.md from CLAUDE.md, as in AGENTS.md vs CLAUDE.md.

Should AGENTS.md be in English?

The format does not require it. Write in the language your team uses for code. Commands stay the same in any language.

Can the agent write AGENTS.md for me?

It can draft one. The format's website suggests asking for it. Then check every command yourself before you commit the file.

How often should I update it?

When commands, folders or agreed rules change. A wrong command in the file costs more than a missing one.

Is there a template for Codex code review?

Yes. Add a ## Code Review Rules section to the file closest to the code, as the Codex guide shows. An example is in our article on AGENTS.md in Codex.

Pick the template closest to your project and delete every line you cannot check. Our custom web application repositories carry an instruction file like this from the first day.

What would you like to change in your business?

Leave your number. We will talk about your process and see whether we can help. The first call is free.

When is the best time to call?
Controller: Oleksandr Bondarenko (BondSoft)Privacy PolicyTerms of Service
Legal details

The data controller is Oleksandr Bondarenko, trading as Oleksandr Bondarenko Software Solutions (BondSoft), ul. Jana Heweliusza 11, 80-890 Gdańsk, Poland, NIP 5833576264, e-mail: office@bondsoft.pl.

We process your data solely to contact you about your enquiry and to present an offer — on the basis of your consent (Art. 6(1)(a) GDPR and Art. 398 of the Polish Electronic Communications Law) and our legitimate interest in handling the enquiry (Art. 6(1)(f) GDPR).

Providing the data is voluntary but necessary for us to reply. You may withdraw your consent at any time by writing to office@bondsoft.pl — this does not affect the lawfulness of processing before the withdrawal.

You have the right to access your data, rectify it, erase it, restrict its processing, transfer it, and lodge a complaint with the President of the Polish Personal Data Protection Office.

Full information: Privacy Policy.

Send us an email

The service this text is about

Automation and AI / OCR

Automation of document re-typing, OCR and checking rules, and your data stays with you.