AGENTS.md Template

An AGENTS.md template gives AI coding agents the project context a new developer would need: how to set up the repo, which commands to run, the conventions to follow, how to test, and what not to touch. Use this free AGENTS.md template to write one plain markdown file at the root of your repository, so agents work the way your team does.

AI prompt
I need to write an AGENTS.md. Act as an expert technical writer and draft one for me.

Use this structure, keeping each section clear, concise, and genuinely useful to the reader:

1. Project overview
2. Setup
3. Commands
4. Code style and conventions
5. Testing
6. Commits and pull requests
7. Boundaries
8. Architecture notes
9. Where to find more

Before you begin, ask me for the details you need: the product, team, or audience this is for, and anything specific I should include. Then write the full AGENTS.md in clean, well-formatted Markdown.

Connected HelpDocs over MCP? Add "save this as an unpublished HelpDocs article" to the prompt and the draft lands in your knowledge base, ready to review.

The AGENTS.md template

Add an AGENTS.md file to the top level of your repo and use the headings shown below. Fill each section with details specific to your own project rather than the sample guidance. Brief, straightforward instructions land better than lengthy explanations.

TemplateDownload for Word

1. Project overview

Wrap up the project in two or three sentences, covering what it does, the languages and frameworks it runs on, and the layout of the repository. After that, list the top-level folders and describe what each one contains.

2. Setup

Spell out the precise steps for reaching a working environment: which tool versions you need, how you install the dependencies, which environment variables you set, and which services must be running. Show every command exactly as you’d type it.

3. Commands

The commands your agent relies on most, with a short note explaining each one.

TaskCommandNotes
InstallTODOTODO
BuildTODOTODO
TestTODOTODO
Lint and formatTODOTODO

4. Code style and conventions

Document the conventions your team sticks to, covering formatting, naming, file layout, the libraries you favor, and the patterns you steer clear of. Link to your config files (linters, formatters) instead of restating their rules, and flag anything a tool can’t detect on its own.

5. Testing

You’ll want to cover how to run the whole test suite and a single test, where the tests are kept, and what new code is expected to meet. Also say whether a change counts as done only once its tests pass.

6. Commits and pull requests

The way you write commit messages, how you name branches, what belongs in a pull request description, and the checks that have to pass before anyone reviews it.

7. Boundaries

State what the agent isn’t allowed to do. Be specific.

  • Paths you should mark off limits for editing (generated code, vendored libraries, lock files)
  • Credentials and secret values that must never land in a commit or show up in printed output
  • Commands the agent shouldn’t run (destructive database operations, production deploys)
  • Any change that has to go through a human review first

8. Architecture notes

A few things are hard to figure out from the code by itself: how the major pieces communicate, the key design choices, and gotchas people already run into. If you’ve got one, link to the fuller technical documentation.

9. Where to find more

Point at the README, the contribution guide, your internal docs, and any other spot a person or agent should check for background.

Tip

Agents only do their best work when the docs they lean on stay fresh. Start a free HelpDocs trial so your internal documentation lives in one searchable home that AI tools can pull from.

How to fill in this AGENTS.md template

Your AGENTS.md file isn’t useful unless it’s accurate. These routines keep it that way:

  • Get commands exactly right. An agent won’t fill in gaps, so copy them from a terminal where they already work instead of relying on memory.
  • Give rules, not explanations. A line like “use the shared date helper in utils” helps an agent more than a long paragraph on date handling.
  • Make limits explicit. Agents follow stated instructions much better than ones left to interpretation.
  • Stay concise. Point to the longer docs instead of duplicating them here, so the file stays quick to maintain.
  • Keep it in sync with the code. Whenever a command or convention shifts, touch AGENTS.md in that same pull request.
  • Try it out. Have an agent work through a small task with just the file, then correct anything it handles wrong.

To see how documentation can work better for AI, check out our guide on how AI uses your knowledge base.

AGENTS.md template FAQ

What is AGENTS.md?

AGENTS.md is a plain markdown file that lives at the root of your repo and hands AI coding agents the context they need to get moving on your project. Inside you'll find setup steps, build and test commands, code conventions, and the spots to steer clear of. It's basically the README you'd write if your audience were agents instead of people.

What should an AGENTS.md file include?

Open with a brief summary of the project, then share the commands for installing, building, testing, and linting. After that, cover code style expectations, how to run and write tests, and the format you want commits and pull requests to follow. Don't forget the hard limits either, like files you shouldn't touch and secrets that must never get committed. Make every rule short and concrete.

What is the difference between AGENTS.md and README.md?

Think of a README as the front door of your project: what it is, why it exists, and where to begin. AGENTS.md is where you put the exact, hands-on steps an agent needs to change things without breaking anything. Keeping the two apart means the README stays easy to read, while agent guidance can be as exact as you want it to be.

Can a repository have more than one AGENTS.md file?

A common approach is to keep one at the root while adding more inside larger subprojects, so every part of a monorepo can hold its own guidance. Don't skip checking how your team's agent tools handle nested files, because that behavior varies from tool to tool.

How does AGENTS.md relate to llms.txt and MCP?

Each one tackles its own problem. AGENTS.md guides coding agents on how to behave inside a repository. llms.txt shows AI tools where the most useful pages on a website live. And MCP gives AI assistants a standard protocol for connecting to live systems like your documentation.

Turn your template into a living knowledge base.

Create, organize, translate, and connect your docs without the admin sprawl of a support suite.

Start free 14-day trial

No credit card required.

Migrate from