DEV Community

Dutify
Dutify

Posted on Originally published at dutify.ai

AGENTS.md template: what to put in it, with a copyable example

AGENTS.md is a plain Markdown file at the root of a repository that tells AI
coding agents how to work in it. The project site, agents.md,
calls it "a README for agents": a predictable place for the context and
instructions an agent needs, kept out of the human README so neither one gets
cluttered.

It is an open format. It came out of work across OpenAI Codex, Amp, Google's
Jules, Cursor and Factory, it is now stewarded by the Agentic AI Foundation
under the Linux Foundation, and the site says it is used by over 60,000
open-source projects. There are no required fields. An agent reads whatever
Markdown you give it.

That freedom is also the problem. Most AGENTS.md files are either three lines
long or a copy of the README. Below is what actually helps an agent, and a
template you can paste in.

What belongs in AGENTS.md

Write down the things you would tell a new engineer on their first day, and
that they could not work out quickly from the code:

  • How to set up and run the project. The exact commands, in order.
  • How to test. The command that runs the fast suite, and which tests must pass before a change is done.
  • Code style that is not enforced by a linter. Naming, file layout, patterns you prefer and patterns you have banned.
  • Boundaries. Folders the agent must not touch, files that are generated, and anything that needs a human to review.
  • How to finish. Branch names, commit message format, and what a pull request description should contain.

What does not belong

  • Secrets. Never put keys, tokens or passwords in the file. It is committed with the code.
  • Anything the linter already enforces. The agent will see the linter output anyway.
  • Long product history. Link to it instead. Every line costs context the agent could spend on your code.

The template

# AGENTS.md

## Project overview
[One paragraph: what this repo is, the main language and framework,
and how it fits with other services.]

## Setup
- Install: `[command]`
- Run locally: `[command]`
- Environment: copy `.env.example` to `.env`; never commit `.env`.

## Testing
- Fast suite: `[command]` (must pass before any commit)
- Single test: `[command] path/to/test`
- Add or update a test for every behavior change.

## Code style
- [Naming convention]
- [Where new modules go]
- [Patterns we prefer] / [Patterns we do not use]

## Boundaries
- Do not edit: `[generated/]`, `[vendor/]`, `[migrations already applied]`
- Ask before: changing public APIs, adding dependencies, touching auth.

## Commits and pull requests
- Branch: `[type]/[short-description]`
- Commit messages: `[convention, e.g. Conventional Commits]`
- PR description: what changed, why, how it was tested.

## Where to find more context
- Architecture: [link]
- Decisions log: [link]
- Open tasks for this repo: [link to your board]
Enter fullscreen mode Exit fullscreen mode

Monorepos: one file per package

The format supports nested files. Put another AGENTS.md inside each package,
and agents read the nearest one in the directory tree, so the closest file
takes precedence. The agents.md site notes that the main OpenAI repo had 88 of
them at the time of writing. Keep shared rules at the root and only the
differences in each package.

Beyond the repo: the context AGENTS.md cannot hold

AGENTS.md tells an agent how to work in the code. It does not tell it what to
work on
or why. That context lives in your tasks, your docs and your
customers' requests, and it changes every day, so copying it into a file in
the repo goes stale by the next sprint.

The usual fix is to let the agent read that context live, with limits. In
Dutify, your AI tool or your own agent connects over MCP at mcp.dutify.ai with
a key from your settings. One connection reaches projects in Dutify Cloud,
docs in Codexum and feedback in Roadmarq, and you choose which spaces and
boards each agent can access and what it can read or change.

A practical split:

  • AGENTS.md: how to build, test and ship this repo. Changes rarely.
  • Your workspace, over MCP: the task the agent is on, the spec behind it, and the customer requests it answers. Changes daily.

Then add one line to the "Where to find more context" section of your
AGENTS.md that tells the agent where its tasks live. Our guide to
connecting AI agents to your team's work
covers how to scope that access safely.

FAQ

Is AGENTS.md the same as CLAUDE.md or .cursorrules?
Those are tool-specific files. AGENTS.md is the shared, open format meant to
work across agents. Some teams keep one AGENTS.md and point the tool-specific
files at it.

Where does the file go?
At the root of the repository, next to the README. Add nested files in
subfolders when parts of the repo need different instructions.

How long should it be?
As long as it needs to be and no longer. If a section would not change what
the agent does, cut it.

Top comments (0)