Version: 1.0.0Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Last Updated: 2026-01-16
Source: Cursor Documentation + Research This document outlines best practices for creating and maintaining
AGENTS.md files for use with Cursor AI.
What is AGENTS.md?
AGENTS.md is a markdown file used to provide global, repository-wide guidance to Cursor agents. It’s a simpler alternative to structured .cursor/rules files, ideal for straightforward, readable instructions without metadata, scoping, or complexity.
File Location Requirements
Root AGENTS.md
- Location: Must be in project root (
AGENTS.md) - Scope: Applies globally across the entire project
- No path or file-pattern scoping - rules apply everywhere
Nested AGENTS.md Files
- Support: Available in Cursor v1.6+ (planned for v1.6, check current version)
- Location: Can be placed in subdirectories (e.g.,
src/platform/AGENTS.md,src/cores/hr/AGENTS.md) - Behavior: Instructions from nested files are automatically combined with parent directories
- Precedence: More specific instructions take precedence over parent instructions
- Use Case: Module-specific patterns, core-specific rules
Size Recommendations
General Guidelines
- Target: Keep files under ~500 lines
- Rationale: Large files become harder to maintain and may exceed context limits
- If Exceeding:
- Consider splitting into
.cursor/rulesfor complex, scoped rules - Move detailed patterns to separate documentation files
- Link to external documentation instead of duplicating
- Consider splitting into
Size by File Type
- Root AGENTS.md: <500 lines (platform-wide quick reference)
- Platform AGENTS.md: <300 lines (PF-specific patterns)
- Core AGENTS.md: <200 lines (module-specific patterns)
- Shared AGENTS.md: <150 lines (UI component patterns)
Structure Guidelines
1. Clear and Actionable Rules
DO:- Write rules the way you’d explain internal documentation
- Prefer precise guidance (code style, naming conventions, workflows)
- Use examples when helpful
- Show “good” vs “bad” patterns
- Reference canonical files in your codebase
- Use vague suggestions
- Include rules that contradict each other
- Duplicate content that exists elsewhere (link instead)
2. Header Structure
3. Section Organization
Recommended Structure:- Quick Reference (Start Here) - Most common patterns
- Module Overview - Context and boundaries
- Architecture Rules - Core principles
- Code Standards - Import paths, naming, structure
- Patterns - Common code patterns with examples
- What AI Must NEVER Do - Prohibited patterns
- Pre-Flight Checklist - Before writing code
- Key References - Links to detailed docs
4. Use Examples
Good Example:When to Use AGENTS.md vs .cursor/rules
Use AGENTS.md When:
- ✅ You want one file of global guidelines
- ✅ Simple, readable instructions
- ✅ Smaller or simpler projects
- ✅ Module-specific patterns (nested files)
- ✅ Quick reference format
Use .cursor/rules When:
- ✅ You need scoping (path or file-pattern based)
- ✅ Multiple rules with different metadata
- ✅ Precise control over when rules apply
- ✅ Conditionally applied rules
- ✅ Complex rule hierarchies
- ✅ Rich metadata requirements
Version Control Best Practices
1. Track in Git
- ✅ Check AGENTS.md into git along with source files
- ✅ Ensures whole team sees it
- ✅ Changes are tracked and reviewable
- ✅ Version history available
2. Version Management
- Root AGENTS.md: Always has version (e.g.,
v1.9.0) - Nested AGENTS.md: Reference root version, don’t include own version
- Update Version: When making significant changes
- Changelog: Document major changes in header
3. Version Inheritance Pattern
Update Frequency Guidelines
When to Update
- Immediately: When core rules or patterns change
- Immediately: When architecture boundaries change
- Within 24 hours: When new patterns are established
- Weekly: Review during regular documentation review
- Quarterly: Comprehensive review and cleanup
Update Triggers
- New patterns established
- Architecture changes
- Security requirements change
- Performance patterns updated
- Tool-specific optimizations needed
Keep Current
- Agents follow whatever’s in the file they can read
- Outdated instructions cause problems
- Update as project evolves
- Remove deprecated patterns
Linking to External Documentation
Best Practices
- ✅ Summarize critical parts in AGENTS.md
- ✅ Link to detailed documentation
- ✅ Don’t duplicate huge documents fully
- ✅ Keep AGENTS.md as quick reference
Link Format
Consistency Across Agents
Purpose
AGENTS.md provides “always-on” context to:- Cursor agents
- Inline Edits
- Chat sessions
Consistency Requirements
- Tone: Consistent across all interactions
- Structure: Same output shape expected
- Patterns: Same patterns applied consistently
- Rules: No conflicting instructions
Common Anti-Patterns
❌ Don’t Do This
- Too Large: File exceeds 500 lines without splitting
- Vague Rules: “Write good code” instead of specific patterns
- Conflicting Rules: Rules that contradict each other
- Outdated Content: Patterns that no longer apply
- No Examples: Rules without code examples
- Duplication: Copying entire docs instead of linking
- No Version: Missing version tracking
- Inconsistent Structure: Different format across nested files
✅ Do This Instead
- Split Large Files: Use
.cursor/rulesor separate docs - Be Specific: “Use
@/shared/ui/buttonnot@/components/ui/button” - Resolve Conflicts: One source of truth per rule
- Keep Current: Regular reviews and updates
- Show Examples: Good vs bad code patterns
- Link to Details: Summarize and link to full docs
- Version Control: Track versions in git
- Consistent Format: Follow established structure
Validation Checklist
Before committing AGENTS.md changes:- File size appropriate (<500 lines for root)
- Clear and actionable rules
- Examples provided (good vs bad)
- Version controlled (in git)
- Links to external docs where appropriate
- No conflicting rules
- Consistent structure
- Up-to-date content
- Nested files reference root version
Related Documentation
- Cursor Rules Documentation: https://cursor.com/docs/context/rules
- Cursor Agent Best Practices: https://cursor.com/blog/agent-best-practices
- Project AGENTS.md:
AGENTS.md(current: docs/VERSIONS.md) - AI Guide:
AI_GUIDE.md(current: see docs/VERSIONS.md) - Documentation Standards:
docs/DOCUMENTATION_STANDARDS.md
Last Updated: 2026-01-16
Next Review: 2026-04-16 (Quarterly)