Templates / For agents / AGENTS.md
AGENTS.md

AGENTS.md template

The rules every coding agent reads before it touches your repo: setup, checks, style, and what to ask first.

Repo root. Codex, Cursor, GitHub Copilot, and most coding agents read it on their own. Claude Code reads it through CLAUDE.md.

Use in Almanac
AGENTS.md
# AGENTS.mdInstructions for AI coding agents working in this repo. People can read it too.Keep it short: agents read the whole file at the start of every session.## What this project isLumen is a billing dashboard for small software companies.The web app is in `app/`, the API is in `api/`, and shared types are in `packages/types/`.## Setup```bashnpm installcp .env.example .envnpm run dev        # app on http://localhost:3000```## Before you say a change is doneRun these and fix what fails:```bashnpm run lintnpm run typechecknpm test```Say which checks you ran and paste the real result. If a check fails and you can't fix it, say so.## How we write code- TypeScript everywhere. No `any` without a comment that says why.- Small modules with one job. Put a new file next to the code that uses it.- Follow the patterns in nearby files before inventing new ones.- No dead code, commented-out code, or unused exports.## Tests- Every bug fix starts with a test that fails.- Tests live next to the file they test: `billing.ts` and `billing.test.ts`.- Mock only the network and the clock, never our own modules.## Git and pull requests- Branch from `main`. Name branches `<your-name>/<short-topic>`.- One change per pull request. The title says what changed for the user.- Never force push to `main`. Never commit secrets or `.env` files.## Where things are written down- `WORKSPACE.md`: how our docs are organized.- `docs/adr/`: decisions we made and why. Read the matching one before you change the architecture.- `docs/specs/`: what each feature should do.If your change makes a doc wrong, fix the doc in the same pull request.## Ask a person firstStop and ask before you:- change the database schema or delete data- add a dependency- touch billing, sign-in, or anything under `infra/`- edit this file## Never- Edit generated files in `dist/` or any `*.gen.ts` file.- Change a public API response without a new version.

Questions people ask.

About AGENTS.md and where it should live.

Where should AGENTS.md live?

At the root of your repo, so every agent finds it when it starts. A big repo can add a shorter AGENTS.md inside a folder, and agents use the one closest to the file they are editing.

Do I need both AGENTS.md and CLAUDE.md?

Keep your rules in AGENTS.md and make CLAUDE.md one line, @AGENTS.md, plus anything only Claude needs. Then every agent follows the same rules and you edit them in one place.

How long should it be?

Short enough to read in two minutes. Agents read the whole file every session, so put details in other docs and link them.

How do people who don't use GitHub edit it?

In Almanac, AGENTS.md is a doc anyone on your team can open and edit, no GitHub account needed. Every change is saved back to the file in your repo, with the name of the person or agent who made it.

Keep AGENTS.md where your team can edit it.

Almanac shows your repo's docs as a wiki that people and agents edit together.

Get started free