AI coding assistants like Cursor and GitHub Copilot are incredibly powerful, but they work best when they understand your project's specific architecture, coding standards, and common tasks. Without this context, they may suggest patterns that don't align with your codebase.
AGENTS.mdis an agreed-upon standard between all the big AI players, replacing things like .cursorrules and copilot_instructions.md.
An AGENTS.md file acts as a "manual" for AI agents. It provides a centralized place to define:
By providing this information, you ensure that the AI's suggestions are consistent with your project's existing structure, reducing the need for manual corrections.
A great example of this in practice is the SSW Clean Architecture template. Its AGENTS.md file provides clear instructions on everything from the dependency flow to specific MediatR patterns.
The AGENTS.md in SSW Clean Architecture includes:
✅ Figure: Good example - Providing clear, actionable context for AI agents
For more details, you can view the full AGENTS.md file on GitHub
AGENTS.md to the root of your repository.AGENTS.md remain accurate.AGENTS.md is a common standard, agents should automatically look for this if it exists.Tip: If you're not sure where to start, get your agent to generate its own AGENTS.md file.
Tip: Include in your AGENTS.md, "Ensure you keep AGENTS.md up to date if any changes to the codebase necessitates it."
Tip: Treat AGENTS.md as the starting point for your agents.
You can reference other relevant files from this, in order to better structure your documentation.
Place another AGENTS.md file inside each package. Agents will automatically read the nearest file in the directory tree, so the closest one takes precedence and every subproject can have its own instructions.
The "root" AGENTS.md file in this case should contain only high-level instructions for what each package is for, and what the overall architecture is, as the detailed instructions will be in the package-specific AGENTS.md files.
├── AGENTS.md - 5000 lines of instructions for every package├── packages│ ├── app1│ └── app2└── ...
❌ Figure: Bad example - A single, overloaded AGENTS.md for the entire monorepo
├── AGENTS.md - High-level architecture overview├── packages│ ├── app1│ │ └── AGENTS.md - Instructions for app1 only│ ├── app2│ │ └── AGENTS.md - Instructions for app2 only│ └── ...
✅ Figure: Good example - Scoped AGENTS.md files provide targeted agent instructions per subproject