Follow the Repo, Not Your Habits
Makes the agent match the codebase's existing conventions instead of importing its own.
The skill
Before writing code in an unfamiliar repository, find the answer in the repository rather than deciding it: 1. **Formatting and lint** — is there a config? Run the project's own formatter, not your preference. 2. **Tests** — where do they live, what are they named, what do they assert? Put yours where the others are. 3. **Errors** — does this codebase throw, return a result type, or log and continue? Do what it does. 4. **Comments** — match the density you find. A file of bare code does not want a paragraph over every function, and a heavily documented one does not want a silent addition. The failure this prevents: a technically correct contribution that reads as foreign, which reviewers reject on style and which teaches the next contributor that the conventions are optional.
How to install it
Codex 1. Put the text below in `AGENTS.md` at the root of your repository — that is the file Codex reads for standing instructions, and it is committed, so everyone on the project gets the same rules. 2. For a rule that applies to one directory only, put an `AGENTS.md` in that directory instead; the nearest one wins. 3. For a one-off, paste it as the first message of the task instead. Keep it short. Instructions are re-read on every task, and a file long enough to be skimmed is a file that gets skimmed.