cityhive / rules
Cursor rule2 starsChanged 18 months agoMITArchived repositoryView on GitHub
Guidelines for creating and maintaining Cursor rules to ensure consistency and effectiveness.
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 1,533 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 repository6 other files it gives its agents.
- .cursor/rules/always-enable-context7.mdcCursor rule
- .cursor/rules/dependency-management.mdcCursor rule
- .cursor/rules/project-overview.mdcCursor rule
- .cursor/rules/project-patterns.mdcCursor rule
- .cursor/rules/python-standards.mdcCursor rule
- .cursor/rules/testing-guidelines.mdcCursor rule
The file
We split this cursor-rules.mdc into the rules it gives an agent
12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Context trigger: When this rule applies (e.g., "For Python files")
- Distinctive: line 27
Use bullet points for clarity
- Distinctive: line 40
Token efficiency: Keep rules under 100 lines when possible
- Very specific: line 42
Context-aware: Use globs to apply rules only when relevant
- Distinctive: line 47
Always-applied rules: Only for essential project context (1-2 rules max)
- Very specific: line 48
File-specific rules: Use globs to target relevant file types
- Distinctive: line 65
Keep examples current: Use real patterns from the codebase
- Distinctive: line 69
Review regularly: Update rules when patterns change
- Distinctive: line 70
Remove outdated: Delete obsolete rules to reduce token usage
- Distinctive: line 76
Minimize always-applied rules: Use only for critical project context
- Distinctive: line 78
Avoid redundancy: Don't repeat information across rules
- Distinctive: line 79
Prioritize important: Put key guidelines first in rule content
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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 maintaining Cursor rules to ensure consistency and effectiveness. globs: **/*.mdc alwaysApply: false --- # Cursor Rules Best Practices **For rule maintenance:** How to create and maintain effective Cursor rules. ## MDC File Structure ```markdown --- description: Clear, one-line description of what the rule enforces globs: ["path/to/files/*.py", "other/path/**/*"] # Optional: when to apply alwaysApply: true # or false - use sparingly for always-applied rules --- ``` # Rule Title **Context trigger:** When this rule applies (e.g., "For Python files") ## Section Headers - **Bold key points** with concise explanations - Use bullet points for clarity - Include both DO and DON'T examples ```python # ✅ DO: Show good examples good_example = "clear and correct" # ❌ DON'T: Show what to avoid bad_example = "unclear or wrong" ``` ## Rule Design Principles - **Token efficiency**: Keep rules under 100 lines when possible - **Single responsibility**: Each rule should focus on one concern - **Context-aware**: Use `globs` to apply rules only when relevant - **Actionable**: Provide specific guidance, not abstract concepts ## Rule Organization Strategy - **Always-applied rules**: Only for essential project context (1-2 rules max) - **File-specific rules**: Use `globs` to target relevant file types - **Task-specific rules**: Activate only when working on specific domains ## Common Rule Categories - **Project context**: Essential information about architecture and tech stack - **Code standards**: Language-specific style and quality guidelines - **Testing practices**: Testing strategies and patterns - **Tool usage**: Dependency management, linting, CI/CD workflows - **AI collaboration**: Guidelines for effective AI interaction ## Effective Rule Content - **Start with overview**: Brief context of what the rule covers - **Use hierarchical structure**: Main points → sub-points → examples - **Provide commands**: Include actual command examples for tools - **Cross-reference**: Link to related rules with `[name](mdc:path)` - **Keep examples current**: Use real patterns from the codebase ## Rule Maintenance - **Review regularly**: Update rules when patterns change - **Remove outdated**: Delete obsolete rules to reduce token usage - **Merge related**: Combine overlapping rules into focused guidelines - **Test effectiveness**: Monitor if AI follows the rules consistently ## Performance Optimization - **Minimize always-applied rules**: Use only for critical project context - **Use specific globs**: Target rules to relevant file types - **Avoid redundancy**: Don't repeat information across rules - **Prioritize important**: Put key guidelines first in rule content --- **Key Insight:** Good rules provide just-enough context for effective AI assistance without overwhelming the model with irrelevant information.
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.

