guide

AGENTS.md, explained

AGENTS.md is a plain markdown file at the root of a repository that tells AI coding agents what the project is and how to work inside it. Claude Code, Cursor, Codex, Copilot and several other tools look for it before they read your code, the same way a new engineer reads the README on their first morning. It is not code and it is not configuration: it is context, written in sentences, and every agent that supports it will treat it as standing instructions for the whole session.

The reason it matters is scope. An agent asked to fix a date format has no idea that the same file also renders invoices, so it happily refactors both. A good AGENTS.md closes that gap: it names the features that already work, the files each one owns, and the tests that would fail if a behaviour moved. With those three sentences in front of it, an agent stops treating your codebase as a blank page and starts treating it as someone's work. In practice this is the cheapest guardrail available — a text file that travels with the repo, needs no account, and works across tools.

Most teams get it wrong in the same two ways: the file grows into a second README that nobody updates, or it is written once at the start of a project and contradicts the code six weeks later. Stet exists to fix the second problem. The CLI writes AGENTS.md from the charters you record — locked behaviour, owned files, proving tests — and regenerates it when those charters change, so the instructions an agent reads today match the code it is about to edit.

what goes in it

  • ## what this repo is

    One paragraph the agent can repeat back: the product, the stack, and the one thing that must never break.

  • ## locked behaviours

    The features that already work, each with the files it owns and the tests that prove it. This is the part agents actually obey.

  • ## scope for this task

    The files the current ticket may touch, and an explicit list of files it may not.

  • ## conventions

    Naming, folder layout, error style, and the decisions already made — so the agent stops re-litigating them.

AGENTS.mdgenerated by stet
# AGENTS.md
> maintained by stet — do not hand-edit

## locked behaviours
### guest checkout
- owns: src/checkout/**
- tests: checkout.spec.ts
- never: require login before payment

## scope: LIN-142
- may touch: src/checkout/cart.tsx
- must not touch: src/billing/**

four rules

  1. 01Keep it short. Under a page beats a wiki nobody loads.
  2. 02Write behaviours, not vibes: "guest checkout works without an account" beats "be careful with auth".
  3. 03Name files and tests, so the agent knows where the behaviour lives.
  4. 04Update it when a feature ships, not when a bug lands.