Rules for coding agents
AGENTS.md is a Markdown file you commit so a coding agent starts every task with the same limits. These pages are starters for common stacks. Edit the commands so they match your repository, then commit the file. They are not a listing of someone else's rule collection.
Where each agent looks
Checked against the vendor docs. A nested AGENTS.md covers that directory and the folders under it.
Codex
Reads AGENTS.md from the repository root down to the working directory. A closer file is applied later, so it overrides earlier guidance. The combined text stops at 32 KiB unless you raise the cap.
Vendor docsCursor
Reads AGENTS.md at the project root and in subdirectories. A nested file covers that directory and its children, and the more specific file takes precedence.
Vendor docsClaude Code
From v2.1.277, reads AGENTS.md when the working directory has no CLAUDE.md, .claude/CLAUDE.md, or CLAUDE.local.md above it. If one of those exists, Claude reads that file unless it imports AGENTS.md.
Vendor docsGemini CLI
Reads GEMINI.md by default. It reads AGENTS.md when you list that filename in context.fileName.
Vendor docs
Rules, skills, and MCP servers
AGENTS.md
Instructions that load with the repository. They say how to work in this codebase: which commands to run, and what to leave alone.
Agent Skills
A SKILL.md folder the agent loads when a task matches. Browse skills.
MCP servers
A separate program that exposes tools. Browse MCP servers.
Start here
A short file that works in any repository before you add stack-specific rules.
Languages
Checks, module boundaries, and commands for the languages the directory already lists.
- AGENTS.md
TypeScript
TypeScript AGENTS.md rules for strict types, narrow any-escapes, and the typecheck, lint, and test commands an agent should run before it finishes.
Copy a starterOpen - AGENTS.md
JavaScript
JavaScript AGENTS.md rules for ESM boundaries, no silent type erasure, and the lint and test scripts an agent should run before calling work done.
Copy a starterOpen - AGENTS.md
Python
Python AGENTS.md rules for the lockfile, virtualenv, and pytest command an agent should use instead of installing packages into the system interpreter.
Copy a starterOpen - AGENTS.md
Go
Go AGENTS.md rules for gofmt, the module in go.mod, and go test ./... so an agent does not add a framework the module does not use.
Copy a starterOpen - AGENTS.md
Rust
Rust AGENTS.md rules for cargo fmt, clippy, and cargo test, with unwrap kept to tests and binaries so library code returns a Result.
Copy a starterOpen
Frameworks
App Router and React habits that keep an agent inside the files you asked it to change.
- AGENTS.md
Next.js
Next.js AGENTS.md rules for the App Router: server and client boundaries, loading and error files, and the lint and build commands to run before you finish.
Copy a starterOpen - AGENTS.md
React
React AGENTS.md rules for components, state ownership, and the test command to run when markup or a hook changes, without rewriting class components.
Copy a starterOpen
Data and runtime
Postgres changes and containers, where a casual command can touch shared state.
- AGENTS.md
PostgreSQL
PostgreSQL AGENTS.md rules for additive migrations, parameterized SQL, and a local database URL so an agent avoids destructive statements on production.
Copy a starterOpen - AGENTS.md
Docker
Docker AGENTS.md rules for image builds, compose services, and the commands an agent may run locally, with production registries and prune left for a person.
Copy a starterOpen
Habits
Tests, secrets, and pull requests. Paste one of these next to a language file.
- AGENTS.md
Tests
Testing AGENTS.md rules: reproduce a bug with a failing test, then change code, and run the project's existing runner instead of adding a second framework.
Copy a starterOpen - AGENTS.md
Secrets and security
Security AGENTS.md rules for environment variables, dependency adds, and auth checks so an agent does not commit a token or weaken an authorization check.
Copy a starterOpen - AGENTS.md
Pull requests
Pull request AGENTS.md rules for branch hygiene, commit messages, and a summary that lists files, checks, and risk, without pushing to the default branch.
Copy a starterOpen
Questions about AGENTS.md
What is an AGENTS.md file?
A plain Markdown file of instructions for a coding agent. You commit it to the repository. Codex and Cursor read it on their own. Claude Code reads it when the repo has no CLAUDE.md. Gemini CLI reads it after you list the filename in its settings. The short version of each vendor's behavior is on this page.
How is AGENTS.md different from an Agent Skill or an MCP server?
AGENTS.md is always in context for that repository. An Agent Skill is a folder the agent loads when the task matches its description. An MCP server is a separate program that exposes tools. Browse skills and browse MCP servers.
Should I commit one of these files unchanged?
Edit the commands first. Each page names checks that are common for that stack, and your repository may call them something else. Delete any section that does not apply, and add the files the agent must not touch.
Can a monorepo have more than one AGENTS.md?
Yes. Put the shared limits at the root and a shorter file in the package it covers. Codex and Cursor both apply the closer file on top of the parent. Keep the combined text under Codex's default 32 KiB cap, or raise that cap on purpose.