AGENTS.md Generator
Generate an AGENTS.md structure optimized for AI coding agents with minimal token usage. Follow the public guidance at https://agents.md/.
AGENTS.md is a Markdown file that serves as a "README for agents" - a dedicated, predictable place to provide context and instructions to help AI coding agents work on your project. It complements README.md by containing detailed technical context that coding agents need but might clutter a human-focused README.
If an AGENTS.md file already exists, update it with new instructions or context. If it doesn't exist, create a new one.
Core Principles
- Agent-focused: Guidance is tailored for AI coding agents
- Format: use standard Markdown
- AGENTS.md is LIGHTWEIGHT: Only universal guidance, links to sub-files (~100-200 lines max)
- Standardized location: Placed at repository root (or subproject roots for monorepos)
Repository Analysis
Analyze and report:
- Repository type: Monorepo, multi-package, or simple?
- Tech stack: Languages, frameworks, key tools
- Major directories, examples:
- Apps (
apps/web, apps/api, apps/mobile)
- Services (
services/auth, services/transcribe)
- Plugin (
plugin/auth)
- Packages (
packages/ui, packages/shared)
- Workers (
workers/queue, workers/cron)
- Build system: pnpm/npm/yarn workspaces? Turborepo? Lerna?
- Testing setup: Jest, Vitest, Playwright, pytest?
- Key patterns: Organization, conventions, examples, anti-patterns, testings
File Structure
Project Overview
- Brief description of what the project does
- Architecture overview if complex
- Key technologies and frameworks used
Setup Commands
- Installation instructions
- Environment setup steps
- Dependency management commands
- Database setup if applicable
Development Workflow
- How to start development server
- Build commands
- Watch/hot-reload setup
- Package manager specifics (npm, pnpm, yarn, etc.)
Testing Instructions
- How to run tests (unit, integration, e2e)
- Test file locations and naming conventions
- Coverage requirements
- Specific test patterns or frameworks used
- How to run subset of tests or focus on specific areas
Code Style Guidelines
- Language-specific conventions
- Linting and formatting rules
- File organization patterns
- Naming conventions
- Import/export patterns
Build and Deployment
- Build commands and outputs
- Environment configurations
- Deployment steps and requirements
- CI/CD pipeline information
Optional but Recommended Sections
Security Considerations
- Security testing requirements
- Secrets management
- Authentication patterns
- Permission models
Monorepo Instructions (if applicable)
- How to work with multiple packages
- Cross-package dependencies
- Selective building/testing
- Package-specific commands
Pull Request Guidelines
- Title format requirements
- Required checks before submission
- Review process
- Commit message conventions
Debugging and Troubleshooting
- Common issues and solutions
- Logging patterns
- Debug configuration
- Performance considerations
Output Format
Check template for AGENTS.md in references/agents-md-template.md. Use it as a starting point, filling in project-specific details.
Quality Checklist
Before generating, verify:
Best Practices
- Keep AGENTS.md files small and focused
- Use for project-specific conventions
- Be specific: include exact commands
- Prefer short, concrete references over long prose:
- Link to project docs, specs, and runbooks
- Point to example files or directories (e.g.,
see src/api/users.ts for canonical pattern)
- Include the most important commands with exact CLI invocations
- use code blocks to wrap commands and file paths
- Reference existing code examples when possible
- Update as project evolves
What to Avoid
- General programming advice
- Framework documentation (reference official docs)
- Long examples (reference code files)
- Duplicate information from skills
- Anti-Patterns, omit these
- "Welcome to..." or "This document explains..."
- "You should..." or "Remember to..."
- Obvious instructions ("run tests", "write clean code")
- Explanations of why (just say what)
- Long prose paragraphs
1---2name: create-agents-md3description: Generate an AGENTS.md file for a repository. Use when user asks to create AGENTS.md files, analyze codebase for AI agent documentation, set up AI-friendly project documentation, or generate context files for AI coding assistants. Triggers on "create AGENTS.md", "generate agents", "analyze codebase for AI", "AI documentation setup", "hierarchical agents".4---56# AGENTS.md Generator78Generate an AGENTS.md structure optimized for AI coding agents with minimal token usage. Follow the public guidance at https://agents.md/.9AGENTS.md is a Markdown file that serves as a "README for agents" - a dedicated, predictable place to provide context and instructions to help AI coding agents work on your project. It complements README.md by containing detailed technical context that coding agents need but might clutter a human-focused README. 10If an AGENTS.md file already exists, update it with new instructions or context. If it doesn't exist, create a new one.1112## Core Principles13- **Agent-focused:** Guidance is tailored for AI coding agents14- **Format:** use standard Markdown15- **AGENTS.md is LIGHTWEIGHT:** Only universal guidance, links to sub-files (~100-200 lines max)16- **Standardized location:** Placed at repository root (or subproject roots for monorepos)1718## Repository Analysis1920Analyze and report:211. **Repository type**: Monorepo, multi-package, or simple?222. **Tech stack**: Languages, frameworks, key tools233. **Major directories**, examples:24 - Apps (`apps/web`, `apps/api`, `apps/mobile`)25 - Services (`services/auth`, `services/transcribe`)26 - Plugin (`plugin/auth`)27 - Packages (`packages/ui`, `packages/shared`)28 - Workers (`workers/queue`, `workers/cron`)294. **Build system**: pnpm/npm/yarn workspaces? Turborepo? Lerna?305. **Testing setup**: Jest, Vitest, Playwright, pytest?316. **Key patterns**: Organization, conventions, examples, anti-patterns, testings3233### File Structure3435#### Project Overview3637- Brief description of what the project does38- Architecture overview if complex39- Key technologies and frameworks used4041#### Setup Commands4243- Installation instructions44- Environment setup steps45- Dependency management commands46- Database setup if applicable4748#### Development Workflow4950- How to start development server51- Build commands52- Watch/hot-reload setup53- Package manager specifics (npm, pnpm, yarn, etc.)5455#### Testing Instructions5657- How to run tests (unit, integration, e2e)58- Test file locations and naming conventions59- Coverage requirements60- Specific test patterns or frameworks used61- How to run subset of tests or focus on specific areas6263#### Code Style Guidelines6465- Language-specific conventions66- Linting and formatting rules67- File organization patterns68- Naming conventions69- Import/export patterns7071#### Build and Deployment7273- Build commands and outputs74- Environment configurations75- Deployment steps and requirements76- CI/CD pipeline information7778### Optional but Recommended Sections7980#### Security Considerations8182- Security testing requirements83- Secrets management84- Authentication patterns85- Permission models8687#### Monorepo Instructions (if applicable)8889- How to work with multiple packages90- Cross-package dependencies91- Selective building/testing92- Package-specific commands9394#### Pull Request Guidelines9596- Title format requirements97- Required checks before submission98- Review process99- Commit message conventions100101#### Debugging and Troubleshooting102103- Common issues and solutions104- Logging patterns105- Debug configuration106- Performance considerations107108109## Output Format110111Check template for AGENTS.md in `references/agents-md-template.md`. Use it as a starting point, filling in project-specific details.112113## Quality Checklist114115Before generating, verify:116- [ ] AGENTS.md exists at root117- [ ] Commands are copy-paste ready118- [ ] No duplication119- [ ] Every "DO" has real file example120- [ ] Every "DON'T" references real anti-pattern121122# Best Practices123124- Keep AGENTS.md files small and focused125- Use for project-specific conventions126- Be specific: include exact commands127- Prefer **short, concrete references** over long prose:128 - Link to project docs, specs, and runbooks129 - Point to example files or directories (e.g., `see src/api/users.ts for canonical pattern`)130 - Include the most important commands with exact CLI invocations131 - use code blocks to wrap commands and file paths132- Reference existing code examples when possible133- Update as project evolves134135## What to Avoid136137- General programming advice138- Framework documentation (reference official docs)139- Long examples (reference code files)140- Duplicate information from skills141- Anti-Patterns, omit these142 - "Welcome to..." or "This document explains..."143 - "You should..." or "Remember to..."144 - Obvious instructions ("run tests", "write clean code")145 - Explanations of why (just say what)146 - Long prose paragraphs