Skip to content

Module 01 · Lesson 02

Project rules: AGENTS.md

One file every agent reads first, so you never repeat yourself.

Set up7 min

Most agents read a rules file at the root of the repo: AGENTS.md (widely supported), CLAUDE.md (Claude Code) or .cursor/rules (Cursor). Keep one source of truth and point the others at it.

# AGENTS.md
1. Read HANDOFF.md before changing anything; update it after.
2. Stack: Next.js + Supabase. Use pnpm, never npm.
3. Run `pnpm typecheck && pnpm lint && pnpm test` before any push.
4. Never commit secrets. Env vars live in .env (gitignored).
5. Money is integer pesewas. The server decides prices.
6. Small commits, Conventional Commit messages.
7. Ask before adding a paid service or a new dependency.
Short, specific rules beat long essays. Add a rule each time an agent makes the same mistake twice.

Your turn

Write yours

Create AGENTS.md in one of your repos with 5–8 rules: stack, commands, what never to do, and how to finish a task.