claude-code-plugins / rules
Cursor rule1 starsChanged 11 months agoMITView on GitHub
Guidelines for creating and modifying Cursor rules in .cursor/rules
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,263 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 repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/audit/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/anti-duplication.mdcCursor rule
- .cursor/rules/claude-code-plugins.mdcCursor rule
- .cursor/rules/claude-skills.mdcCursor rule
- .cursor/rules/git-commit-attribution.mdcCursor rule
- .cursor/rules/official-docs.mdcCursor rule
The file
We split this cursor-rules-best-practices.mdc into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
alwaysApply: Use true sparingly - only for universal rules - Distinctive: line 50
Keep under 500 lines - split large rules
- Very specific: line 53
Use @filename to reference actual codebase files
- Very specific: line 58
Avoid alwaysApply: true unless truly universal
- Distinctive: line 59
Use nested rules in subdirectories for module-specific guidance
- Distinctive: line 76
Verify glob patterns match intended files
- Distinctive: line 77
Check rule applies when expected (and doesn't when it shouldn't)
- Distinctive: line 78
Test that Agent follows the guidance
≈ “Common” is an estimate: at least 1 in 5 of the 7,111 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
---
description: Guidelines for creating and modifying Cursor rules in .cursor/rules
globs:
- ".cursor/rules/**/*.mdc"
alwaysApply: false
---
# Cursor Rules Best Practices
## Rule Format (MDC)
```markdown
---
description: Clear description of what this rule does
globs:
- "pattern/**/*.ts"
alwaysApply: false
---
# Rule Title
Rule content...
```
### Metadata
**Required fields**:
- **`description`**: Helps Agent decide when to apply (be specific)
- **`globs`**: File patterns for scoped application
- **`alwaysApply`**: Use `true` sparingly - only for universal rules
**Optional fields** (for advanced use):
- **`tags`**: Categorization keywords for AI discovery
- **`priority`**: 1-5 for conflict resolution (1 = highest)
- **`version`**: Semantic versioning for rule changes
## Rule Types
| Type | Configuration | Use Case |
|------|--------------|----------|
| Always Apply | `alwaysApply: true` | Universal, project-wide guidance |
| Apply Intelligently | `alwaysApply: false` + clear description | Agent decides based on context |
| Apply to Files | `globs` patterns | Triggers when matching files referenced |
| Apply Manually | Minimal description | Only when @-mentioned |
## Best Practices
### Content
- Keep under 500 lines - split large rules
- Be specific and actionable (not "write good code")
- Include concrete examples with do's and don'ts
- Use `@filename` to reference actual codebase files
### Scoping
- Be specific: `"src/api/**/*.ts"` over `"**/*.ts"`
- Avoid `alwaysApply: true` unless truly universal
- Use nested rules in subdirectories for module-specific guidance
### Structure
- Clear headings and logical sections
- Context about when/why the rule applies
- Code examples showing correct patterns
## Anti-Patterns
- Overly broad rules covering everything
- Vague descriptions ("code style" vs "TypeScript interfaces for API responses")
- Duplicate guidance across rules
- Rules without examples
## Testing
1. Verify glob patterns match intended files
2. Check rule applies when expected (and doesn't when it shouldn't)
3. Test that Agent follows the guidance
4. Refine based on actual usage
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.

