AGENTS.mdis the repo-scoped contract an agent reads before touching code. Where a SKILL.md teaches a method, anAGENTS.mddescribes this repository โ its systems, commands, conventions, and the files that matter. DeeperAGENTS.mdfiles override higher ones.
1. ๐งฌ Anatomy
A good AGENTS.md answers four questions in order, so the agent never has to guess or grep blindly:
| Section | Question answered | Why it matters |
|---|---|---|
| Overview + Architecture | What is this and how does data flow? | Orients the agent before it reads a single source file. |
| Key directories + Important files | Where do I look / edit? | Replaces wasteful exploration with exact paths. |
| Commands | How do I build, run, and test? | Stops the agent inventing commands that donโt exist. |
| Conventions + Testing | What style and gates must I honor? | Keeps changes consistent and verifiable. |
2. ๐ Scope & dir-context
AGENTS.md is hierarchical. The root file covers the whole workspace; nested files refine rules for their subtree and take precedence on conflict.
/AGENTS.md # workspace-wide systems, commands, conventions
pi-persistent-intelligence/AGENTS.md # overrides for the memory engine subtree
dev/vibesdk/tools/viban/AGENTS.md # overrides for that tool- ๐งญ Place a nested file wherever a subtree has its own runtime, package manager, or test framework.
- โ๏ธ A deeper rule wins; never restate parent rules โ only the deltas.
3. ๐งฑ Skeleton
Annotated template โ strip the # comments when authoring.
# Repository Guidelines
## Project Overview
# 1-paragraph map of the systems this repo integrates, numbered.
## Architecture & Data Flow
# Per-system bullets + a `text` flow diagram of the critical lifecycle.
## Key Directories
- `path/`: what lives here and which file is the entrypoint.
## Development Commands
| Project | Action | Command |
| :------ | :----------------- | :-------------- |
| ... | Build / Test / Run | `exact command` |
## Code Conventions & Common Patterns
# Naming, async/resource rules, framework idioms โ with short code examples.
## Important Files
- `path/to/entrypoint`: one-line role.
## Runtime / Tooling Preferences
# Pinned engines (Node >= 22, Bun, Python 3.11+) and package managers.
## Testing & QA
# Frameworks, test layout, and the pre-publish gate to run before shipping.4. ๐ง Conventions
- ๐ฏ Exact paths, not prose.
/home/dv/.omp/plugins/ompycord/bot.py: entrypointbeats โthe bot fileโ. - ๐งฎ Commands in a table. Project ร Action ร Command โ the agent copies, never guesses.
- ๐งต Show the lifecycle. A
textdiagram of the request/event flow conveys more than paragraphs (see the event-lifecycle blocks in the root file). - ๐งช State the gate. Name the exact pre-publish check (
bun run typecheck && bun test,npm run check) so the agent self-verifies. - ๐ชช Examples over rules. A 6-line idiomatic snippet pins a convention harder than a sentence describing it.
- ๐ซ No secrets. List env variable names and roles, never values.
5. ๐ Related
- ๐ฆ SKILL.md anatomy โ method-teaching agent skills.
- ๐ค Ecosystem lingo โ Rule, Profile, Domain Rule defined.
- ๐ llms.txt โ LLM-readable site export.