# AGENTS.md example for a website, and what to put in it

> A complete AGENTS.md example for a website, what each part does, what to leave out, and how to share one file with Claude Code, Codex, Cursor and others.

AGENTS.md is a plain Markdown file at the root of a project that tells AI coding assistants how to work on it: the commands to run, where things live, and what never to do without asking. Below is a complete example for a website, what each part does, and what to leave out.

12 November 2026 · 6 min read · by [Venkatesh A G E](#author)

If an AI coding assistant works on your website, it starts every session knowing nothing about your project. It doesn't know which command builds the site, where the pages live, or that you never want it to publish without asking. AGENTS.md is the file where you write that down once, so every session, and every assistant, starts with the same instructions.

This guide explains what AGENTS.md is, which tools read it, and then walks through a complete example for a website project, part by part.

## What is AGENTS.md?

AGENTS.md is a plain Markdown file at the root of your project. The [AGENTS.md site](https://agents.md/) describes it as a README for agents: your README is for people, and AGENTS.md holds the extra detail a coding assistant needs, such as exact commands and house rules, that would clutter a README.

There's no required structure. It's ordinary Markdown with whatever headings make sense for your project. The format is now looked after by the Agentic AI Foundation, part of the Linux Foundation, rather than by any one tool maker.

## Which tools read AGENTS.md?

The AGENTS.md site lists the tools that support the format, including OpenAI Codex, Cursor, Gemini CLI, GitHub Copilot's coding agent, VS Code, Zed, Aider, Jules, Devin and Windsurf. Check that list for the current set, since it grows.

Claude Code reads its own file, `CLAUDE.md`, first. According to [Claude Code's documentation](https://code.claude.com/docs/en/memory), it reads `AGENTS.md` directly when a project has no `CLAUDE.md`, and when a project has both, you connect them with one line in `CLAUDE.md`:

Markdown

```
@AGENTS.md
```

That line imports the whole file, so you keep one set of instructions and every tool reads the same thing. Anything only Claude needs can go below the import. Our [Claude Code guide](https://vagejs.com/agents/claude-code/) and the guides for [other agents](https://vagejs.com/agents/) show the setup for each tool.

## A complete example

Here's an AGENTS.md for a small business website built with a static site generator. It's based on the one vagejs creates for every new site, cut down to the parts you'd write for any website project:

Markdown

```
# AGENTS.md

This is the website for Rosemary Bakery, built with vagejs.
Pages are Markdown files in src/pages/. Layouts are in src/layouts/.

## Commands

| Command          | What it does                                         |
| ---------------- | ---------------------------------------------------- |
| `npm run dev`    | Local preview with live reload. Prints the address.  |
| `npm run check`  | Checks links, SEO details and accessibility. Writes nothing. |
| `npm run build`  | Builds the site into dist/. Fails on any error.      |

## Where things are

- One page per file: `src/pages/menu.md` becomes `/menu/`.
- Every page needs `title` and `description` in its frontmatter.
- Images go in `public/images/` and need alt text that describes them.
- Prices live only in `src/pages/menu.md`. Never repeat them elsewhere.

## Definition of done

A change is finished when `npm run check` and `npm run build` both pass
with no errors. Say what you changed and which pages it affects.

## Writing style

- Plain English, short sentences, British spelling.
- No claims we can't back up: no "best in Pune", no invented reviews.

## Never do this without asking

- Publish or deploy the site.
- Add a link to a website we haven't linked to before.
- Add scripts, tracking or anything that sends visitor data elsewhere.
- Edit `.env` or any file with passwords or keys.
```

Every section is there for a reason, so let's go through them.

## What each part does

### The opening lines

Two sentences tell the assistant what the project is and where the content lives. That saves it from exploring every folder before it can do anything, which takes time and uses up its attention on things that don't matter.

### Commands

Exact commands, in a table, with what each one does. Assistants run commands constantly, and a wrong guess (`npm start` when you meant `npm run dev`) wastes a round trip. Saying that `check` writes nothing also tells the assistant it's safe to run any time.

### Where things are

The rules a new team member would learn in their first week: how files map to addresses, which fields every page needs, where images go. The line about prices is the kind of project-specific rule that prevents a real mistake: two pages quoting different prices.

### Definition of done

This is the most useful section in most AGENTS.md files. Without it, an assistant decides for itself when it's finished, often as soon as the text looks right. With it, the assistant runs the checks, sees the broken link it introduced, and fixes it before telling you it's done.

### Writing style

A few lines are enough. Assistants follow concrete rules ("no invented reviews") far more reliably than vague ones ("keep it professional").

### Never do this without asking

The guardrails. Publishing, new outbound links, new scripts and secrets are the actions that are hard to undo or that change what your visitors get. Writing them down means the assistant stops and asks instead of deciding on its own.

## What should you leave out?

A good AGENTS.md is short enough to be read in full at the start of every session. [Claude Code's documentation](https://code.claude.com/docs/en/memory), for example, suggests keeping its instruction file under about 200 lines, because longer files take up more of the assistant's working memory and get followed less closely. Leave out:

-   **Anything the assistant can find in seconds.** It can read your folder structure; you don't need to list every file.
-   **Long tutorials.** Link to your docs instead of pasting them in.
-   **Secrets.** Never put passwords, API keys or tokens in AGENTS.md. It's committed with your project and read by every tool.
-   **Rules you don't actually follow.** If the file says "always write tests" and the project has none, the assistant learns the file can't be trusted.
-   **Things that change every week.** Current tasks belong in your issue tracker or your prompt, not in a file every session reads.

## Bigger projects: more than one file

For a site with separate parts, such as a marketing site and a docs section with different rules, you can put an extra AGENTS.md in a subfolder. The AGENTS.md site says agents read the nearest file to what they're editing, so the closest one takes precedence, and what you type in the chat overrides them all. In a vagejs site, keep those extra files out of `src/pages/`, because every `.md` file there becomes a published page. Most small websites only need the one file at the root.

## How vagejs ships one for you

Every new vagejs site gets an AGENTS.md, written for vagejs and kept in step with what the framework can actually do. It covers:

-   the commands, including `check`, `audit`, `deploy` and `verify`, and what each one changes;
-   how routing, frontmatter and layouts work;
-   a definition of done (`npm run check` passes);
-   the safety rules: only the site owner approves new link domains, publishing asks for confirmation first and skipping that needs the owner's say-so, and secrets stay out of committed files;
-   a pointer to `npx vage info --json`, which describes every command, setting and frontmatter field as data an assistant can read.

The new site also gets a short `CLAUDE.md` that imports it with `@AGENTS.md`, so Claude Code and the tools that read AGENTS.md directly all follow the same instructions from the first prompt. You add your own project rules, like the bakery's prices line above, at the top.

To try it:

terminal

```
npm create vagejs@latest my-site
```

Then open `my-site/AGENTS.md`, read it once, and add the three or four rules that are specific to your site. The [agents guides](https://vagejs.com/agents/) cover the setup for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI and others.

![](https://vagejs.com/images/venkatesh-age-144.webp)

Written by

Venkatesh A G E

Web developer in Bengaluru, India, and the maker of vagejs. Helps startups turn their websites into a real source of customers, with a focus on clarity, technical SEO and AI search.

[LinkedIn](https://www.linkedin.com/in/ageven/)[About](https://vagejs.com/about/)
