Creates AGENTS.md files that provide context for AI agents working in codebases. Use when setting up a new project for AI assistance, documenting conventions for agents, or when user says "create an AGENTS.md" or "set up agent context".
Creates AGENTS.md files—the authoritative instruction file for AI agents working in a codebase. This file is added to the agent's context automatically, providing 100% reliable passive context without requiring tool calls or retrieval decisions.
Important: AGENTS.md is for knowledge (conventions, structure, rules). For actions (deploy, test, migrate), create a Skill instead using the create-claude-skill skill.
Before generating, examine the project:
ls -la and check directory organizationpackage.json, Cargo.toml, pyproject.toml, go.mod, etc.README.md for project context.github/workflows/, Makefile, etc. for build commandsUse this template structure:
# AGENTS.md
> This file provides context for AI agents working in this codebase.
> IMPORTANT: Prefer retrieval-led reasoning. Read local doc files before answering framework-specific questions.
## Project Context
- **Project**: [Name and brief purpose]
- **Tech Stack**: [Key technologies]
- **Architecture**: [Monolith/Microservices/Monorepo/etc.]
## Critical Rules
- [Rule 1: Focus on "don'ts" and constraints]
- [Rule 2: Project-specific conventions]
- [Rule 3: Common mistakes to avoid]
## Commands
- **Build**: `[command]`
- **Test**: `[command]`
- **Lint**: `[command]`
## Documentation Index
> Read files from this index when relevant to your task.
[Root]: ./.docs/
[category]: {file1.md, file2.md}
## File-Specific Notes
- **[pattern]**: [convention or note]
Focus on constraints and gotchas:
Example rules:
## Critical Rules
- Never use `any` type in TypeScript—use `unknown` and narrow
- Always use `server-only` import for server utilities
- Run `pnpm check` before committing—it runs lint + typecheck + test
- Don't modify files in `generated/`—they're auto-generated
For projects with extensive documentation (frameworks, large codebases):
.docs/ folder (or reference existing docs location)Format:
## Documentation Index
> Agents: Read the file at the path below if related to your task.
[Root]: ./.docs/
01-getting-started: {installation.md, project-structure.md}
02-api: {endpoints.md, authentication.md, error-handling.md}
03-database: {schema.md, migrations.md, queries.md}
Recommend symlinking to support multiple tools:
# Create symlinks for other AI tools
ln -s AGENTS.md CLAUDE.md
Note: Only recommend symlinks the user has tools for. Common conventions:
CLAUDE.md - Claude Code.cursorrules - CursorCOPILOT.md - GitHub Copilot# AGENTS.md
## Project Context
- **Project**: Personal blog built with Astro
- **Stack**: Astro, TypeScript, Tailwind CSS, MDX
## Rules
- Content lives in `src/content/`—follow the existing frontmatter schema
- Don't modify `src/components/ui/`—they're from shadcn
## Commands
- **Dev**: `pnpm dev`
- **Build**: `pnpm build`
# AGENTS.md
> IMPORTANT: Read local doc files before answering framework questions.
## Project Context
- **Project**: E-commerce platform
- **Stack**: Next.js 15, TypeScript, Prisma, PostgreSQL
- **Architecture**: Monorepo with apps/ and packages/
## Documentation Index
[Root]: ./docs/