cursor-best-practices / rules
Cursor rule5 starsChanged 10 months agoMITView on GitHub
Codebase structure and organization for cursor-best-practices skill repository. Understanding repository layout, file organization, skill structure, rule files, commands, agents, references, indexes. How to navigate this codebase, find files, understand organization, work with skill structure.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 4,373 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository5 other files it gives its agents.
- .cursor/AGENTS.mdAGENTS.md
- .cursor/rules/architecture-and-design.mdCursor rule
- .cursor/rules/content-patterns.mdCursor rule
- .cursor/rules/skill-maintenance.mdCursor rule
- cursor-best-practicesSkill
The file
We split this codebase-structure.md into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 97
Create file in appropriate rules/ subdirectory
- Very specific: line 98
Use rules/_template.md as template
- Very specific: line 99
Add entry to rules/_sections.md
- Distinctive: line 100
Update relevant index files
- Distinctive: line 107
Update when adding major sections
- Very specific: line 111
Check rules/_sections.md for categorized list
- Very specific: line 112
Use indexes/query-index.md for query mapping
≈ “Common” is an estimate: at least 1 in 5 of the 7,324 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codebase Structure
This repository is a Cursor Agent Skill that provides best practices for using Cursor.
Repository Layout
cursor-best-practices/
├── README.md # Main documentation
├── CHANGELOG.md # Version history
├── CONTRIBUTING.md # Contribution guidelines
├── LICENSE # MIT license
├── metadata.json # Skill metadata
├── .gitignore # Git ignore patterns
├── .cursor/ # Project-specific Cursor config
│ ├── AGENTS.md # This codebase guide
│ └── rules/ # Project-specific rules
└── cursor-best-practices/ # Actual skill content
├── SKILL.md # Main skill file
├── rules/ # 250+ rule files
├── commands/ # Command templates
├── agents/ # Subagent templates
├── skills/ # Skill recommendations
├── references/ # Deep-dive guides
└── indexes/ # Navigation indexesSkill Structure
The skill follows the Agent Skills Specification:
- SKILL.md - Main skill file with frontmatter (name, description, license, metadata)
- rules/ - Rule files organized by category
- commands/ - Optional command templates
- agents/ - Optional subagent templates
- references/ - Optional deep-dive guides
- indexes/ - Optional navigation indexes
File Organization
Rules Directory
Rules are organized by category:
agent/- Agent modes, patterns, use casescontext/- Rules, commands, MCP, skills, subagents, semantic search, mentionsfeatures/- Tab, Inline Edit, Bugbot, CLI, Cloud, Transcriptsintegrations/- GitHub, Slack, GitLab, Linear, Git, Deeplinksconfiguration/- Extensions, ignore files, languages, migrations, shell, shortcuts, themescookbook/- Examples, patterns, workflowstroubleshooting/- Common issues and solutionsget-started/- Quickstart, concepts, models, pricing
Rule File Format
Each rule file:
- Has frontmatter with description, tags, optional globs
- Follows Do/Don't or Incorrect/Correct pattern
- Includes "Related Queries" section
- Links to related rules in "See Also"
- Kept under ~500 lines
Commands Directory
Command templates:
- Plain Markdown files
- Filename = command name (e.g.,
code-review.md→/code-review) - Users copy these to their
.cursor/commands/folder - Include clear instructions and examples
References Directory
Deep-dive guides:
- Longer narrative content
- Comprehensive explanations
- Linked from SKILL.md
- Cover complex topics in detail
Indexes Directory
Navigation indexes:
- Help users discover relevant content
- Map queries to rules
- Organize by feature, use case, pattern
- Enable quick discovery
Working with This Codebase
Adding a Rule
- Create file in appropriate
rules/subdirectory - Use
rules/_template.mdas template - Add entry to
rules/_sections.md - Update relevant index files
- Ensure keyword-rich frontmatter
Modifying SKILL.md
- Keep under ~500 lines
- Link to rules/, commands/, agents/, skills/, references/
- Update when adding major sections
Finding Content
- Check
rules/_sections.mdfor categorized list - Use
indexes/query-index.mdfor query mapping - Browse by category in
rules/subdirectories - See
references/for deep dives
Key Principles
- One practice per file - Each rule covers one specific practice
- Keyword-rich descriptions - Help with relevance matching
- Clear organization - By category and use case
- Link, don't duplicate - Reference guides link to rules
- User-focused - Help users understand and use Cursor
Deep Understanding
For Cursor to understand this codebase at the deepest level:
- Read AGENTS.md first - Comprehensive codebase guide with architecture details
- Understand architecture - See
.cursor/rules/architecture-and-design.mdfor design decisions - Follow content patterns - See
.cursor/rules/content-patterns.mdfor writing conventions - Check maintenance guidelines - See
.cursor/rules/skill-maintenance.mdfor workflow - Review SKILL.md - Main skill file with overview and navigation
- Browse rules/_sections.md - Complete rules index organized by category
- Use indexes - Multiple discovery paths in
indexes/directory - Check codebase index - See
.cursor/indexes/codebase-index.mdfor quick reference
See Also
- AGENTS.md - Deep codebase guide with comprehensive details
- Architecture and Design - Design decisions and rationale
- Content Patterns - Writing conventions and patterns
- Skill Maintenance - Maintenance guidelines
- Codebase Index - Quick navigation reference
- Rules
- Commands
- Agent Skills Specification
- skills.sh Documentation
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

