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.
# 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.
AGENTS.md
Instructions 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 is
Lumen 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
npm install cp .env.example .env npm run dev # app on http://localhost:3000
Before you say a change is done
Run these and fix what fails:
npm run lint npm run typecheck npm 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
anywithout 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.tsandbilling.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.envfiles.
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 first
Stop 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.tsfile. - Change a public API response without a new version.