AID-1Recommended
Write one instructions file for agents
Keep one instructions file at the root of the repository that tells every agent how to build, test and change the project.
How to do it
Name it AGENTS.md, which most agents read. Claude Code reads it too, but only when the project has no CLAUDE.md. If you keep a CLAUDE.md, import the shared file from it with a line reading @AGENTS.md. Other tools read their own files too, such as .github/copilot-instructions.md and GEMINI.md. Make each one a symbolic link to AGENTS.md or a short file that points to it. Never keep a second copy of the rules, because copies drift apart. List the commands to install, test and run the project. Then add the conventions and the rules that must never break. Write each rule as a direct order, such as "Use pnpm, never npm". Keep it under 200 lines, because agents read it on every task. Add a nested AGENTS.md in a subproject only when its rules differ, since the nearest file wins. Name the one command that runs every check, as the engineering playbook describes. Link to the docs instead of copying them, as Point the instructions file at the docs instead of copying them says.
Examples
Markdown example
# AGENTS.md
## Commands
- Install: `npm ci`
- Check everything: `./check.sh` (must pass before every commit)
- Run locally: `npm run dev`, then open http://localhost:3000
## Conventions
- TypeScript strict mode. No `any`.
- One feature per folder under `src/features/`.
## Never
- Never edit files under `migrations/` that have already run.
- Never commit `.env` files or keys.
Shell example
for tool_file in CLAUDE.md GEMINI.md .github/copilot-instructions.md; do
[ -e "$tool_file" ] || continue
[ -L "$tool_file" ] && continue
if [ "$(wc -l < "$tool_file")" -gt 20 ] || ! grep -q 'AGENTS.md' "$tool_file"; then
echo "$tool_file must point to AGENTS.md, not copy it"; exit 1
fi
done
How to check
A script confirms that AGENTS.md exists, has under 200 lines and names the check command. It also fails when a tool file, such as CLAUDE.md or .github/copilot-instructions.md, is over 20 lines or does not mention AGENTS.md. Then ask a fresh session how to run the tests. It answers from the file.
Sources
- AGENTS.md
- Claude Code, how Claude remembers your project
- GitHub Docs, add repository custom instructions
Related rules
- ENG-2 Run one check of everything before every deploy in Engineering
- DOC-16 Point the instructions file at the docs instead of copying them in Documentation
- AID-41 Keep instructions short and current in AI-assisted development
- AID-53 Turn repeated procedures into skills in AI-assisted development
- STK-4 Pick what AI tools already know in Software choices
- STK-8 Keep one tool for each job in Software choices
- STK-92 Use the coding agent that passes most of your own task set in Software choices
- DOC-6 Give the README a fixed set of sections in Documentation
- TDD-9 Ask the team to explain the critical paths without AI in Technical due diligence
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/ai-assisted-development/setting-up-the-project/instructions-file">Agent Wranglers AI-assisted development playbook</a>. In code you write, add a comment next to it with the same link.