Skip to content
Agent Engineering / Instructions & Prompting

Keep one source of truth for agent instruction files

  • BP-0017
  • v1.0.0
  • draft
  • pattern
  • role: implementer
  • role: any
  • stage: plan
  • stage: build
  • stage: operate
  • updated 2026-11-24
  • reviewed 2026-11-24
  • next review 2027-05-24
  1. MUST keep shared project instructions in one file, AGENTS.md, and nowhere else.
  2. MUST make each tool-specific file either import AGENTS.md, link to it, or be generated from it, and contain only what is specific to that tool.
  3. MUST NOT copy shared instructions into tool-specific files. Copies drift, and agents then follow different rules depending on the tool.
  4. SHOULD, for Claude Code, use a CLAUDE.md that starts with @AGENTS.md. Prefer the import over a symlink when anyone uses Windows (Git may check a symlink out as a plain text file) or when Claude must edit the file (Claude Code will not write through a symlink).
  5. SHOULD check in CI that tool-specific files still reference AGENTS.md and do not repeat its sections.
  6. SHOULD confirm in each tool that the shared file actually loaded (for Claude Code, /context lists memory files) after changing the arrangement.

Any repository used with more than one coding agent, or likely to be.

  1. Merge existing instruction files into AGENTS.md (BP-0015); resolve contradictions while merging.
  2. Replace each tool file with an import or pointer plus its tool-specific lines.
  3. Add a CI check (a few lines of shell or a Bun script) that fails if a tool file stops referencing AGENTS.md.
  4. Start a session in each tool and confirm the shared instructions loaded.
Tool File Contents
Shared AGENTS.md All project instructions
Claude Code CLAUDE.md @AGENTS.md then Claude-only lines (BP-0016)
Other tools that read AGENTS.md natively — Nothing extra needed
Tools with their own file only their file A pointer to AGENTS.md, or a copy generated from it in CI — never hand-edited
  • CLAUDE.md, GEMINI.md and .cursorrules each holding a slightly different copy of the build commands.
  • A symlinked CLAUDE.md in a repo with Windows contributors, which arrives as a one-line text file.
  • Tool-specific files that silently stopped loading the shared file after a rename.
  • Shared instructions only in AGENTS.md
  • Tool files import or point to it, plus tool-only lines
  • CI check for the reference
  • Load confirmed in each tool