Agent Wranglers

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

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.