managing-agents-md
npx machina-cli add skill oryanmoshe/agent-skills/managing-agents-md --openclawManaging AGENTS.md
Overview
AGENTS.md is a README for AI agents. It tells any AI coding tool — Claude Code, Copilot, Cursor, Codex — how to navigate and work with your codebase. Keep it updated as the project evolves.
When to Create or Update
Create AGENTS.md when:
- Setting up a new project or monorepo
- Adding a significant new feature directory (5+ related files)
- Introducing an extensible or polymorphic system
- A codebase has no AGENTS.md and you're doing substantial work in it
Update AGENTS.md when:
- Changing architectural patterns or project structure
- Adding new build/test/deploy commands
- Modifying base classes, registries, or extension points
- Adding significant new directories
Do NOT create for:
- Simple utility directories
- Single-purpose modules
- Non-extensible features
- Directories with fewer than 5 related files
Tier Structure
For monorepos or large projects, use a hierarchical approach:
Root AGENTS.md → Project overview, tech stack, global conventions
├── app/AGENTS.md → App-specific architecture, commands, patterns
│ └── feature/AGENTS.md → Feature-specific extension points
Each tier adds specificity. Agents read from root down to the most relevant file.
Template
# AGENTS.md — [Project or Directory Name]
Brief one-line description of this part of the codebase.
## Commands
\`\`\`bash
npm run dev # Start development server
npm test # Run tests
npm run build # Production build
\`\`\`
## Project Structure
\`\`\`
src/
├── api/ # REST endpoints (~12 files)
├── services/ # Business logic (~8 files)
├── models/ # Data models (~6 files)
└── utils/ # Shared utilities (~4 files)
\`\`\`
## Key Patterns
[Describe the main architectural patterns, data flow, or conventions]
## Boundaries
### Always
- [Pattern to always follow]
- [Convention to always use]
### Never
- [Anti-pattern to avoid]
- [Dangerous operation]
### Ask First
- [Risky change that needs confirmation]
CLAUDE.md Companion
If the project also uses Claude Code, create a CLAUDE.md that imports the AGENTS.md:
@AGENTS.md
## Claude-Specific
- [Any Claude Code-specific instructions, hooks, or skill references]
This avoids duplicating content while adding Claude-specific configuration.
Anti-Patterns
Stale documentation: An outdated AGENTS.md is worse than none. Update it when the code changes.
Too granular: Don't create AGENTS.md for every directory. Only for significant architectural boundaries.
Duplicating README: AGENTS.md is for AI agents, not humans. Focus on what an agent needs to navigate and modify code correctly — commands, patterns, boundaries.
Source
git clone https://github.com/oryanmoshe/agent-skills/blob/main/skills/managing-agents-md/SKILL.mdView on GitHub Overview
AGENTS.md provides a unified guide for AI coding agents on how to navigate and modify a codebase. It prescribes when to create or update the documentation, and outlines a tiered file structure and a reusable template to keep guidance synchronized with project evolution. It also explains how to use CLAUDE.md companion files to extend content without duplication.
How This Skill Works
The skill defines a root AGENTS.md and optional tiered descendants (app/, feature/, etc.) with a standard template covering Commands, Project Structure, Key Patterns, and Boundaries. CLAUDE.md can import AGENTS.md to add Claude-specific notes. This approach keeps agent guidance scalable and reduces stale documentation.
When to Use It
- Setting up a new project or monorepo
- Adding a significant new feature directory (5+ related files)
- Introducing an extensible or polymorphic system
- A codebase has no AGENTS.md and you're doing substantial work
- After major refactors that change project structure
Quick Start
- Step 1: Create a root AGENTS.md describing the project overview and conventions
- Step 2: Add tiered AGENTS.md files for major boundaries (e.g., app/AGENTS.md, feature/AGENTS.md) and fill the template
- Step 3: If Claude Code is used, add CLAUDE.md importing AGENTS.md and add Claude-specific notes
Best Practices
- Create AGENTS.md only for significant architectural boundaries, not every directory
- Follow the root → project → feature tier structure to localize guidance
- Keep the template content concrete: commands, structure, patterns, boundaries
- Update AGENTS.md whenever architecture, build/test/deploy, or registries change
- If Claude Code is used, add CLAUDE.md to import AGENTS.md content
Example Use Cases
- Set up a new monorepo and create root AGENTS.md plus app/AGENTS.md and feature/AGENTS.md as you add feature directories
- Add a new payment feature directory with 5+ related files and write a feature/AGENTS.md that documents extension points
- Refactor core architecture and update AGENTS.md to reflect new project structure and commands
- Encounter a codebase without AGENTS.md; create root AGENTS.md and fill in the template before major work
- Create CLAUDE.md that imports root AGENTS.md and provides Claude-specific hooks