Specification
One file convention. Three scopes. All agents.
Agent tools each invented their own config files โ CLAUDE.md, .cursorrules, AGENTS.md, .clinerules, copilot-instructions.md. This standard unifies them with a single AGENTS.md file that cascades across three scopes:
Global โ ~/.agents/AGENTS.md
User-level base rules. Applies to all projects, all agents. Personal preferences, identity, safety policy.
Project โ .agents/AGENTS.md at repository root
Team-shared rules committed to version control. Project conventions, tech stack, code style.
Folder โ .agents/AGENTS.md in any subdirectory
Component-specific rules. Frontend conventions in src/, API patterns in api/, test standards in tests/.
Inheritance
Rules cascade and extend, not replace. This is the same model as .editorconfig, .eslintrc, and .gitignore โ every developer already understands it.
~/.agents/AGENTS.md โ global (loaded first)
โโโ project/.agents/AGENTS.md โ project (extends global)
โโโ src/.agents/AGENTS.md โ folder (extends project + global)
โโโ api/.agents/AGENTS.md โ folder (extends project + global)
โโโ tests/.agents/AGENTS.md โ folder (extends project + global)
When an agent resolves rules for a file at project/src/components/Button.tsx, it loads all three in order: global โ project โ src/ folder. Each layer adds constraints. None discard the previous.
File Format
Plain Markdown. No YAML frontmatter. No schema. Just write rules.
# Global Agent Rules
## Identity
You are a senior engineer who writes production-grade code.
## Safety
- Never execute untrusted input without validation
- Never hardcode secrets
- Always use parameterized queries
## Preferences
- Python: PEP 8, type hints, uv
- TypeScript: strict mode, ESLint
- Bash: set -euo pipefail
- Commits: conventional commits format
Discovery
Agents search for .agents/AGENTS.md files by walking from the current working directory upward to the filesystem root (or git repository root). The global ~/.agents/AGENTS.md is always loaded regardless of working directory.
Resolution Order
- Load
~/.agents/AGENTS.md(global) - Walk from
cwdupward, collect all.agents/AGENTS.mdfiles (deepest first) - If the target file is in a subdirectory that has its own
.agents/AGENTS.md, load that too - Merge all rules: global as base, each layer adding constraints
- Conflicting rules: most specific scope wins (folder > project > global)
Cascade Visualization
~/.agents/AGENTS.md
โ "Always use TypeScript strict mode"
โ "Never commit secrets"
โ
โโโ ~/projects/my-app/.agents/AGENTS.md
โ "This project uses Next.js 15 with App Router"
โ "API routes go in app/api/"
โ
โโโ src/.agents/AGENTS.md
โ โ "React components use function declarations"
โ โ "CSS modules only โ no Tailwind in src/"
โ โ
โ โโโ components/.agents/AGENTS.md
โ "All components must have TypeScript props interface"
โ "Use forwardRef for DOM-wrapping components"
โ
โโโ api/.agents/AGENTS.md
โ "All endpoints validate input with Zod schemas"
โ "Return typed responses, never any"
โ
โโโ tests/.agents/AGENTS.md
"Test files mirror src/ structure"
"Use describe/it blocks, not test()"
Agent Config Map
Every major agent tool has its own config file. The AGENTS.md standard can symlink into each one so you maintain rules in one place.
| Agent | Config File | Project Path | Global Path |
|---|---|---|---|
| Pi | AGENTS.md | .agents/AGENTS.md | ~/.agents/AGENTS.md |
| Claude Code | CLAUDE.md | CLAUDE.md | ~/.claude/CLAUDE.md |
| OpenAI Codex | AGENTS.md | AGENTS.md | ~/.codex/instructions.md |
| Cursor | .cursorrules | .cursorrules | ~/.cursor/rules/ |
| GitHub Copilot | copilot-instructions.md | .github/copilot-instructions.md | Settings UI |
| Windsurf | .windsurfrules | .windsurfrules | ~/.codeium/windsurf/ |
| Cline | .clinerules | .clinerules | ~/.cline/cline_rules |
| Roo Code | .roorules | .roorules | ~/.roo/rules/ |
| Aider | .aider.conf.yml | .aider.conf.yml | ~/.aider.conf.yml |
| Continue | config.json | .continue/config.json | ~/.continue/config.json |
| Gemini CLI | GEMINI.md | GEMINI.md | ~/.gemini/GEMINI.md |
| Kiro | kiro.md | .kiro/kiro.md | ~/.kiro/kiro.md |
| Augment | .augment-guidelines | .augment-guidelines | ~/.augment/guidelines |
| Devin | instructions.md | .devin/instructions.md | Settings UI |
| Junie | .junie/guidelines.md | .junie/guidelines.md | ~/.junie/guidelines.md |
| Goose | goosehints | .goosehints | ~/.config/goose/goosehints |
| Warp | warp.md | .warp/warp.md | Settings UI |
| Trae | .trae/rules/ | .trae/rules/ | ~/.trae/rules/ |
| Mistral Codestral | CODESTRAL.md | CODESTRAL.md | โ |
| Qwen Code | QWEN.md | QWEN.md | โ |
Setup: One Source of Truth
Create ~/.agents/AGENTS.md as your global rules file, then symlink it to every agent's config location:
#!/usr/bin/env bash
set -euo pipefail
# Create global AGENTS.md if it doesn't exist
mkdir -p ~/.agents
touch ~/.agents/AGENTS.md
# Symlink to every agent's global config
# (ln -sf overwrites existing symlinks, safe to re-run)
# Pi โ native support, already reads ~/.agents/AGENTS.md
# (no symlink needed)
# Claude Code
mkdir -p ~/.claude
ln -sf ~/.agents/AGENTS.md ~/.claude/CLAUDE.md
# OpenAI Codex
mkdir -p ~/.codex
ln -sf ~/.agents/AGENTS.md ~/.codex/instructions.md
# Cursor
mkdir -p ~/.cursor/rules
ln -sf ~/.agents/AGENTS.md ~/.cursor/rules/agents-standard
# Gemini CLI
mkdir -p ~/.gemini
ln -sf ~/.agents/AGENTS.md ~/.gemini/GEMINI.md
# Kiro
mkdir -p ~/.kiro
ln -sf ~/.agents/AGENTS.md ~/.kiro/kiro.md
# Cline
mkdir -p ~/.cline
ln -sf ~/.agents/AGENTS.md ~/.cline/cline_rules
# Roo Code
mkdir -p ~/.roo/rules
ln -sf ~/.agents/AGENTS.md ~/.roo/rules/agents-standard
# Goose
mkdir -p ~/.config/goose
ln -sf ~/.agents/AGENTS.md ~/.config/goose/goosehints
# Junie
mkdir -p ~/.junie
ln -sf ~/.agents/AGENTS.md ~/.junie/guidelines.md
# Augment
mkdir -p ~/.augment
ln -sf ~/.agents/AGENTS.md ~/.augment/guidelines
# Trae
mkdir -p ~/.trae/rules
ln -sf ~/.agents/AGENTS.md ~/.trae/rules/agents-standard
echo "โ ~/.agents/AGENTS.md symlinked to all agent configs"
echo " Edit one file. All agents follow your rules."
Project-level setup
For project rules, commit .agents/AGENTS.md to the repo root, then symlink agent-specific files:
# In your project root:
mkdir -p .agents
# Write your project rules
cat > .agents/AGENTS.md <<'EOF'
# Project Rules
- This is a Next.js 15 project using App Router
- All API routes use Zod validation
- Tests mirror src/ structure
EOF
# Symlink to agent-specific project files
ln -sf .agents/AGENTS.md CLAUDE.md
ln -sf .agents/AGENTS.md .cursorrules
ln -sf .agents/AGENTS.md .windsurfrules
ln -sf .agents/AGENTS.md .clinerules
ln -sf .agents/AGENTS.md .roorules
ln -sf .agents/AGENTS.md GEMINI.md
ln -sf .agents/AGENTS.md CODESTRAL.md
# GitHub Copilot uses a different path
mkdir -p .github
ln -sf ../.agents/AGENTS.md .github/copilot-instructions.md
Contribute
Agent tool updated its config location? New agent on the market? Agent now supports ~/.agents/AGENTS.md natively?
Open an issue to:
- Add a new agent to the config map
- Update an agent's config file path
- Report an agent that now supports the standard natively
- Suggest spec changes
Spec repo: nbiish/agents-standard (public)
Site repo: nbiish/agentsstandard-dot-com (public โ issues welcome)
Adopt the Standard
For agent tool developers:
- Search for
~/.agents/AGENTS.mdat startup โ load as global user rules - Walk from
cwdupward collecting.agents/AGENTS.mdfiles - Load folder-scoped
.agents/AGENTS.mdwhen operating on files in that subtree - Merge rules: global as base, most specific scope wins conflicts
That's it. Four steps. No dependencies. No schema. No build step. Just markdown files in directories.
Why this works: It follows conventions every developer already knows โ .editorconfig, .eslintrc, .gitignore, pyproject.toml. Directory-scoped, cascading, plain text. No new concepts to learn.
Relationship to Agent Skills
The Agent Skills standard defines how agents discover and load capabilities (SKILL.md files). The AGENTS.md standard defines how agents discover and load behavior rules. They complement each other:
- SKILL.md = what the agent can do
- AGENTS.md = how the agent should behave