Specification
One file convention. Five-tier loading. All agents.
The standard unifies project instructions by separating what/why (Project PRD) from how (Behavioral Rules):
Project PRD โ llms.txt at repository root
The globalized Project Requirements Document (PRD) detailing active goals, architecture, tech stack, and scope. Loaded second.
Global Base โ ~/.agents/AGENTS.md
User-level safety rules, identity, formatting preferences, and safety policies. Loaded first.
Project Base โ .agents/AGENTS.md at repository root
Team-shared static conventions, committed project standards, and styling guidelines. Loaded third.
Project Active โ AGENTS.md at repository root
Task-specific active instructions and session rules. Highly visible, commonly modified, symlinked by agents. Loaded fourth.
Folder โ AGENTS.md in any subdirectory (optional)
Component-specific rules. Directory-scoped overrides (e.g. src/AGENTS.md, tests/AGENTS.md). Loaded last.
Loading Model: Scoped Concatenation
Each tier's file is concatenated into the agent's context โ not replaced. The project root acts as a ceiling โ agents never traverse above it. Your security practices in ~/.agents/AGENTS.md always apply; the project PRD in llms.txt sets functional scope; project base conventions build on top; active task instructions direct the session; and folder-specific rules apply locally. Never read files from parent directories outside the project.
~/.agents/AGENTS.md โ Loaded first, always. Canonical global standard location for user safety and preferences.
{project_root}/llms.txt โ Loaded second. Defines active requirements, goals, APIs, and roadmap (functional PRD).
{project_root}/.agents/AGENTS.md โ Loaded third. Committed project standards, tech choices, and architecture rules.
{project_root}/AGENTS.md โ Loaded fourth. Project active task rules. Task-specific instructions modified frequently.
{cwd}/AGENTS.md โ Loaded last (optional). Folder/component-specific rules (e.g. src/AGENTS.md, tests/AGENTS.md).
Project Root Detection & Ceiling
Agents detect the project root from the shell's initial $PWD at launch time โ the directory the terminal was opened in. Optionally, $AGENTS_ROOT can be set to override this. Agents must never traverse above this ceiling. If a user cd .. past the project root, only ~/.agents/AGENTS.md applies โ no parent directory AGENTS.md files are picked up. This prevents accidentally reading unrelated rules (e.g. a github repo management AGENTS.md one level up).
Resolution Order
- Load
~/.agents/AGENTS.md(global base โ always loaded first, user-specific rules) - Detect project root from inherited shell
$PWDor$AGENTS_ROOT - Load
{project_root}/llms.txt(project PRD, functional roadmap) - Load
{project_root}/.agents/AGENTS.md(project base rules, committed) - Load
{project_root}/AGENTS.md(project active rules, symlinked) - Load
{cwd}/AGENTS.mdif cwd is within project boundary (component rules, optional) - Concatenate in order: global โ project base โ project active โ folder
- Never traverse above the detected project root
Singular Rules File Fallback
If an agent only supports a single rules file, it should read the project root AGENTS.md (or the symlinked file like CLAUDE.md) to get the active task context. This is the canonical touchpoint for active task instructions. Alternatively, it can read the global ~/.agents/AGENTS.md. Tools that only read one file are first-class citizens.
Dual-Layer MCP Configuration
MCP servers follow a two-layer model โ global shared, agent-specific extended:
~/.agents/mcp-settings.json โ Global MCP servers available across all agents and IDEs. Shared foundation. Configure once, every agent gains access. Browsers, search, filesystem, memory, databases โ set them here.
Agent-specific MCP config โ Each agent can also read its own MCP config (~/.claude.json, .cursor/mcp.json, ~/.gemini/settings.json, etc.) for finer customization. Agent-specific configs extend โ not replace โ the global set. This prevents duplicating configs across every agent while still allowing per-tool customization.
~/.agents/ โ One Directory, Everything Agents Need
~/.agents/
โโโ AGENTS.md โ Behavior rules (this standard โ the canonical global path)
โโโ mcp-settings.json โ MCP servers shared across all agents
โโโ skills/ โ Agent Skills (capabilities)
โโโ **/SKILL.md โ Skills discovered by all agents
Tools using ~/.config/AGENTS.md should move to ~/.agents/AGENTS.md. Users shouldn't have to wonder if their rules are in the right place or if they're overprompting. One directory. Three concerns (behavior, tools, skills). Zero confusion.
AGENTS_DEPTH
Control how many levels of AGENTS.md are loaded downward from project root (never upward) with the AGENTS_DEPTH environment variable:
| Value | Behavior |
|---|---|
1 | ~/.agents/AGENTS.md only โ global rules, no project or folder tiers |
2 | Global + project base .agents/AGENTS.md + project llms.txt |
3 | Global + project base .agents/AGENTS.md + project llms.txt + project root AGENTS.md (default) |
4+ | Global + project base .agents/AGENTS.md + project llms.txt + project root AGENTS.md + cwd sub-folder AGENTS.md |
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.md files by walking from the current working directory upward to the project root. The global ~/.agents/AGENTS.md is always loaded first regardless of working directory. The .agents/ directory at project level holds tooling configuration (MCP servers and skills) and project base rules (in .agents/AGENTS.md).
Cascade Visualization
~/.agents/AGENTS.md โ Global Base (user preferences & safety, loaded first)
โ "Always use TypeScript strict mode"
โ "Never commit secrets"
โ
โโโ ~/projects/my-app/
โโโ llms.txt โ Project PRD (active requirements, tech stack, APIs)
โ "App: Next.js 15 template. Focus: implement JWT auth."
โ "Goal: add /api/auth/register and /api/auth/login endpoints."
โ
โโโ .agents/AGENTS.md โ Project Base (tech stack, deployment, committed guidelines)
โ "This project uses Next.js 15 with App Router"
โ "Deployment check: run build and verify security headers"
โ
โโโ AGENTS.md โ Project Active Rules (active task/feature behavior constraints)
โ "Ensure all JWT tokens expire in 15 minutes"
โ "Do not use external auth packages โ write vanilla Node cryptography"
โ
โโโ src/AGENTS.md (optional) โ Folder / Component (directory-scoped guidelines)
โ โ "React components use function declarations"
โ โ "CSS modules only โ no Tailwind in src/"
โ โ
โ โโโ components/AGENTS.md (optional)
โ "All components must have TypeScript props interface"
โ "Use forwardRef for DOM-wrapping components"
โ
โโโ api/AGENTS.md (optional) โ Folder / Component
โ "All endpoints validate input with Zod schemas"
โ "Return typed responses, never any"
โ
โโโ tests/AGENTS.md (optional) โ Folder / Component
โ "Test files mirror src/ structure"
โ "Use describe/it blocks, not test()"
โ
โโโ .agents/ โ Tooling (MCP + Skills)
โโโ mcp-settings.json โ project MCP servers
โโโ skills/**/SKILL.md โ project skills
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. Each path is verified against the agent's official documentation.
| Agent | Config File | Project Path | Global Path | Docs |
|---|---|---|---|---|
| Pi | AGENTS.md | AGENTS.md | ~/.agents/AGENTS.md native | docs |
| Claude Code | CLAUDE.md | CLAUDE.md | ~/.claude/CLAUDE.md | docs |
| Agy | GEMINI.md | GEMINI.md | ~/.gemini/GEMINI.md | docs |
| OpenAI Codex | AGENTS.md | AGENTS.md | ~/.codex/instructions.md | docs |
| Cursor | .cursorrules | .cursorrules | ~/.cursor/rules/ | docs |
| GitHub Copilot | copilot-instructions.md | .github/copilot-instructions.md | Settings UI | docs |
| Windsurf | .windsurfrules | .windsurfrules | ~/.codeium/windsurf/ | docs |
| Cline | .clinerules | .clinerules | ~/.cline/cline_rules | docs |
| Roo Code | .roorules | .roorules | ~/.roo/rules/ | docs |
| Kiro | kiro.md | .kiro/kiro.md | ~/.kiro/kiro.md | docs |
| Kilo Code | AGENTS.md | AGENTS.md | โ native | docs |
| Aider | .aider.conf.yml | .aider.conf.yml | ~/.aider.conf.yml | docs |
| Continue | config.json | .continue/config.json | ~/.continue/config.json | docs |
| Augment | .augment-guidelines | .augment-guidelines | ~/.augment/guidelines | docs |
| Goose | goosehints | .goosehints | ~/.config/goose/goosehints | docs |
| Junie | .junie/guidelines.md | .junie/guidelines.md | ~/.junie/guidelines.md | docs |
| Trae | .trae/rules/ | .trae/rules/ | ~/.trae/rules/ | docs |
| Devin | instructions.md | .devin/instructions.md | Settings UI | docs |
| Warp | warp.md | WARP.md | โ | docs |
| CodeWhale | AGENTS.md | AGENTS.md | ~/.agents/AGENTS.md native | docs |
| Hermes Agent | AGENTS.md | AGENTS.md | ~/.hermes/SOUL.md | docs |
| Agent Zero (a0) | AGENTS.md | AGENTS.md | โ | docs |
| Crush | AGENTS.md | CRUSH.md | ~/.config/crush/crush.md | docs |
| OpenCode | AGENTS.md | AGENTS.md | โ native | docs |
| Deep Agents (dcode) | AGENTS.md | .deepagents/AGENTS.md | ~/.deepagents/AGENTS.md native | docs |
| Qwen Code | QWEN.md | QWEN.md | โ | docs |
| Mistral Codestral | CODESTRAL.md | CODESTRAL.md | โ | docs |
| Zed | AGENTS.md | AGENTS.md | ~/.config/zed/AGENTS.md native | docs |
| MiniCC | AGENTS.md | AGENTS.md | ~/.minicc/AGENTS.md | docs |
| fcc-claude | AGENTS.md | AGENTS.md | ~/.fcc/.env | docs |
MCP Config Map
Each agent also has its own location for MCP server configurations. Here's where every agent stores its MCP settings, verified against official documentation.
| Agent | Global MCP Config | Project MCP Config | Format |
|---|---|---|---|
| Claude Code | ~/.claude.json | .mcp.json | JSON |
| Agy / Gemini CLI | ~/.gemini/settings.json | .gemini/settings.json | JSON |
| OpenAI Codex | ~/.codex/config.toml | โ | TOML |
| Cursor | ~/.cursor/mcp.json | .cursor/mcp.json | JSON |
| Windsurf | ~/.codeium/windsurf/mcp_config.json | โ | JSON |
| GitHub Copilot | Settings UI | .github/copilot-mcp.json | JSON |
| Cline | VS Code globalStorage | โ | JSON |
| Roo Code | Extension settings | .roo/mcp.json | JSON |
| Kiro | ~/.kiro/settings/mcp.json | .kiro/settings/mcp.json | JSON |
| Kilo Code | Extension settings | kilo.jsonc | JSONC |
| Goose | ~/.config/goose/config.yaml | โ | YAML |
| Junie | ~/.junie/mcp.json | .junie/mcp/mcp.json | JSON |
| Trae | ~/Library/Application Support/Trae/User/mcp.json | โ | JSON |
| Crush | ~/.config/crush/crush.json | crush.json | JSON |
| OpenCode | ~/.config/opencode/opencode.json | opencode.json | JSONC |
| Deep Agents (dcode) | ~/.deepagents/.mcp.json | โ | JSON |
| Qwen Code | ~/.qwen/settings.json | .qwen/settings.json | JSON |
| Continue | ~/.continue/config.yaml | .continue/mcpServers/ | YAML |
| MiniCC | ~/.minicc/mcp.json | .minicc/mcp.json | JSON |
| Warp | Warp Drive UI | .warp/mcp.json | JSON |
| Hermes Agent | ~/.hermes/config.yaml | โ | YAML |
The Problem This Standard Solves
Every agent stores MCP configs in a different file, different format, different path. JSON, YAML, TOML, JSONC. Global-only, project-only, both. This standard proposes ~/.agents/mcp-settings.json as a universal MCP config that agents can read โ and ~/.agents/skills/**/SKILL.md as a universal skills directory โ so users configure once and all agents follow.
LLM Providers
Every agent needs a model. Here are all the LLM API providers, their endpoints, auth patterns, free tiers, and referral links. Plug these into any agent's config.
| Provider | Key Models | API Base URL | Auth Env Var | Free Tier |
|---|---|---|---|---|
| Anthropic | Claude Opus 4.7, Sonnet 4.6, Haiku 4.5 | https://api.anthropic.com/v1 | ANTHROPIC_API_KEY | โ |
| OpenAI | GPT-5.4, GPT-5.3, o4-mini | https://api.openai.com/v1 | OPENAI_API_KEY | โ |
| Google Gemini | Gemini 2.5 Pro, 2.5 Flash | https://generativelanguage.googleapis.com/v1beta | GEMINI_API_KEY | Flash free |
| DeepSeek | DeepSeek-V4, V3, Coder-V2 | https://api.deepseek.com/v1 | DEEPSEEK_API_KEY | โ |
| OpenRouter | 250+ models from all providers | https://openrouter.ai/api/v1 | OPENROUTER_API_KEY | Free models |
| z.ai / ZhipuAI | GLM-5.1, GLM-4.7 | https://api.z.ai/api/coding/paas/v4 | ZAI_API_KEY | โ |
| Wafer AI | GLM-5.1, various models | https://api.wafer.ai/v1 | WAFER_API_KEY | โ |
| Mistral AI | Mistral Large 3, Codestral | https://api.mistral.ai/v1 | MISTRAL_API_KEY | Free (rated) |
| Groq | Llama 4, Mixtral, Gemma 3 | https://api.groq.com/openai/v1 | GROQ_API_KEY | Free 30r/m |
| xAI / Grok | Grok-4, Grok-3 | https://api.x.ai/v1 | XAI_API_KEY | โ |
| Together AI | Llama 4, DeepSeek, Qwen | https://api.together.xyz/v1 | TOGETHER_API_KEY | $1 credit |
| Fireworks AI | Llama 4, Qwen, DeepSeek | https://api.fireworks.ai/inference/v1 | FIREWORKS_API_KEY | 100r/d |
| Ollama | Llama 4, Qwen 3, Gemma 3 | http://localhost:11434/v1 | โ | Free |
| LM Studio | Any GGUF from Hugging Face | http://localhost:1234/v1 | โ | Free |
Referral Links
Sign up through these links to support the Agents Standard project:
z.ai / ZhipuAI โ GLM-5.1, GLM-4.7 models. Use code B50UECNB9T at z.ai/subscribe
OpenCode AI โ API access to open-weight coding models. Use code APBJCPVXC1 at opencode.ai/go
Wafer AI โ Use referral code 8b2ul8o0 when signing up at wafer.ai
Using Providers With Any Agent
Most coding agents support OpenAI-compatible endpoints. Point any agent at a provider by setting the base URL and API key:
# Example: Point Claude Code at OpenRouter
export ANTHROPIC_BASE_URL="https://openrouter.ai/api/v1"
export ANTHROPIC_API_KEY="sk-or-..."
# Example: Point Codex at z.ai
export OPENAI_BASE_URL="https://api.z.ai/api/coding/paas/v4"
export OPENAI_API_KEY="zai-..."
Full structured data: providers.json โ machine-readable provider endpoints, auth patterns, and referral codes.
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
# Agy / Gemini CLI
mkdir -p ~/.gemini
ln -sf ~/.agents/AGENTS.md ~/.gemini/GEMINI.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
# Windsurf
mkdir -p ~/.codeium/windsurf
ln -sf ~/.agents/AGENTS.md ~/.codeium/windsurf/rules
# 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
# Kiro
mkdir -p ~/.kiro
ln -sf ~/.agents/AGENTS.md ~/.kiro/kiro.md
# 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
# Crush
mkdir -p ~/.config/crush
ln -sf ~/.agents/AGENTS.md ~/.config/crush/crush.md
# Hermes Agent
mkdir -p ~/.hermes
ln -sf ~/.agents/AGENTS.md ~/.hermes/SOUL.md
# MiniCC
mkdir -p ~/.minicc
ln -sf ~/.agents/AGENTS.md ~/.minicc/AGENTS.md
# Deep Agents (dcode)
mkdir -p ~/.deepagents
ln -sf ~/.agents/AGENTS.md ~/.deepagents/AGENTS.md
echo "Done. Edit ~/.agents/AGENTS.md โ all symlinked agents follow your rules."
echo "See https://agentsstandard.com for project-level setup."
Project-level setup
Create llms.txt at your repo root for the Project PRD (functional requirements, scope, tech stack), .agents/AGENTS.md for static project base rules (framework choice, deployment checklists, static guidelines), and create AGENTS.md at your repo root for active task instructions (symlinked to agent-specific configs):
# In your project root:
# 1. Write your Project PRD
cat > llms.txt <<'EOF'
# Project PRD: JWT Authentication
- Stack: Next.js 15, TypeScript, PostgreSQL
- Features: User registration and login with JWT tokens
- APIs: /api/auth/register and /api/auth/login
EOF
# 2. Write your static project rules
mkdir -p .agents
cat > .agents/AGENTS.md <<'EOF'
# Project Base Rules
- Tech stack: Next.js 15 (App Router)
- Linting: ESLint strict mode
- Deployment check: run npm run build and check bundle sizes
EOF
# 3. Write your active session rules
cat > AGENTS.md <<'EOF'
# Active Session
- Focus on JWT cryptography implementation in Node.js
- Do not use external auth packages โ write vanilla crypto
- Refer to llms.txt for API schema requirements
EOF
# Symlink agent-specific files to the root AGENTS.md
ln -sf AGENTS.md CLAUDE.md
ln -sf AGENTS.md .cursorrules
ln -sf AGENTS.md .windsurfrules
ln -sf AGENTS.md .clinerules
ln -sf AGENTS.md .roorules
ln -sf AGENTS.md GEMINI.md
ln -sf AGENTS.md CODESTRAL.md
ln -sf AGENTS.md QWEN.md
ln -sf AGENTS.md CRUSH.md
# GitHub Copilot uses a different path
mkdir -p .github
ln -sf ../AGENTS.md .github/copilot-instructions.md
# Use .agents/ for tooling configuration and project base rules
mkdir -p .agents/skills
# .agents/AGENTS.md โ project base rules
# .agents/mcp-settings.json โ project MCP servers
# .agents/skills/**/SKILL.md โ project agent skills
Adopt the Standard
For agent tool developers:
- Search for
~/.agents/AGENTS.mdat startup โ load as global user rules (loaded first) - Load
llms.txtat repo root โ project-wide PRD context (loaded second) - Load
.agents/AGENTS.mdat repo root โ project base rules (loaded third) - Load
AGENTS.mdat repo root โ project active / session rules (loaded fourth) - Walk from
cwdupward collectingAGENTS.mdfiles within the project boundary โ folder-scoped rules (optional, loaded last) - 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.
Beyond Rules: A Complete Agent Configuration Directory
The ~/.agents/ directory can serve as a single source of truth for all agent configuration โ not just behavior rules:
~/.agents/
โโโ AGENTS.md โ Behavior rules (global base, loaded first)
โโโ mcp-settings.json โ MCP server configs (all agents read from here)
โโโ skills/ โ Agent Skills (reusable capabilities)
โโโ **/SKILL.md โ Skills discovered by all agents
{project}/.agents/ โ Tooling & project base rules
โโโ AGENTS.md โ Project base rules (tech stack, deployment)
โโโ mcp-settings.json โ Project-specific MCP servers
โโโ skills/**/SKILL.md โ Project-specific agent skills
AGENTS.md = how the agent should behave (this standard)
mcp-settings.json = what tools the agent can use (MCP servers)
skills/**/SKILL.md = what the agent can do (Agent Skills)
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
- mcp-settings.json = what external tools are available
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)