rules2md

AGENTS.md example

Three finished AGENTS.md examples. Each one is a different kind of project, and each one uses the eight headings the generator writes. They are samples, not files from a real repository. A fill-in skeleton, with brackets instead of finished rules, is the AGENTS.md template. What each heading is for is on the AGENTS.md file page.

How to read an AGENTS.md example

Copy the file that matches the shape of your repo, then replace every fact. The frontend example forbids a database and names app/ and components/. The data example names a script, a rejected-row file, and a row count. The library example names the public export file and forbids a default export. Those facts are not interchangeable. A data job that copies the frontend file will tell the agent to edit Next.js folders that are not there.

The testing section in each example pairs a command with a result you can check. “npm test” alone does not say what the tests cover. The library example says which three cases exist. The data example says 19 totals and 1 rejected row. When you adapt a file, keep that pair: the command, and one number or case the command must produce.

Frontend AGENTS.md example

A static Next.js site. The architecture section repeats a rule this kind of site cares about: the page copy is already in the HTML. The don't section forbids invented prices and addresses, which is a content rule, not a code-style rule.

Northwind Maps, a Next.js site
# AGENTS.md

## Project overview
Marketing site for Northwind Maps. Next.js App Router. Pages are static. No account system.

## Coding conventions
TypeScript. Components live in components/. Use the button and field classes that are already there. Do not add a second CSS framework.

## Architecture constraints
Page copy is in the server HTML. Do not move that copy into a client-only render. A form script may run after the HTML is already in the response.

## Do
- Match the sentence already on the page when you change a heading.
- Run the production build before you call the page done.

## Don't
- Do not add a database.
- Do not invent prices, addresses, or customer counts.

## File and folder scope
Edit app/ and components/. Leave files in public/ alone unless the task names one.

## PR and commit expectations
One page per pull request. The commit message names the route that changed.

## Testing
npm run build
A page is not done if the build fails.

Data AGENTS.md example

One Python script. Scope is jobs/ and tests/, not a web app tree. Bad dates are written out instead of dropped, and the test states the counts. Customer names stay out of the log, which is a don't, not a convention.

daily_totals.py, a batch job
# AGENTS.md

## Project overview
A nightly job that reads orders.csv and writes daily totals. Python 3.12. No web server.

## Coding conventions
pandas for the frame. Column names stay snake_case. Dates are parsed as UTC.

## Architecture constraints
The job is one script, jobs/daily_totals.py. It reads data/in and writes data/out. It does not call an external API.

## Do
- Take the input path and the output path as arguments.
- Write a one-line log with the row count.

## Don't
- Do not drop a row that fails the date parse. Write it to data/out/rejected.csv.
- Do not print customer names in the log.

## File and folder scope
Edit jobs/ and tests/. Do not change files in data/in unless the task names a fixture.

## PR and commit expectations
Name the column you added or removed. Include the row count from a run on the sample file.

## Testing
pytest tests/test_daily_totals.py
The sample has 20 rows and 1 bad date. Expect 19 totals and 1 rejected row.

Library AGENTS.md example

A package other people import. The overview says there are no runtime dependencies. The architecture section says the function stays synchronous. The pull-request section treats a breaking change as something the first line must say, which the other two examples do not need.

tiny-slug, a TypeScript package
# AGENTS.md

## Project overview
tiny-slug turns a title into a URL slug. It is a TypeScript package with no runtime dependencies.

## Coding conventions
Export from src/index.ts only. Public functions have a one-line comment. Do not use any.

## Architecture constraints
The package stays synchronous. No network and no filesystem. Unicode letters stay. Every other character becomes a single hyphen.

## Do
- Add a test when you change the slug rules.
- Keep the function list in the README the same as the exports in src/index.ts.

## Don't
- Do not add a default export.
- Do not trim the caller's string before the function sees it. The function trims.

## File and folder scope
Edit src/ and test/. Leave the changelog for the release commit.

## PR and commit expectations
The pull request names the function that changed. A breaking change says so in the first line.

## Testing
npm test
test/slug.test.ts covers an empty string, a string of symbols, and a mixed-case title.

What these examples leave out on purpose

None of them is a CLAUDE.md. Claude Code uses five different headings. The comparison is on the AGENTS.md vs CLAUDE.md page. None of them is a .cursorrules bullet list. If your notes are already bullets, paste them into the agents.md generator and it will sort the lines under these headings without rewriting the sentences.

Questions

Are these AGENTS.md examples from real projects?

No. Northwind Maps, the daily totals job, and tiny-slug are samples written for this page.

Which example should I copy?

Copy the one whose folders match your repo. A script should not start from the Next.js file. A package should not start from the batch job.

Where is the blank version?

The AGENTS.md template page has the same eight headings with brackets to fill, and no finished rules.