agentleFS
sergeyklaysergeyklay/cityhive/.cursor/rules/cursor-rules.mdc

cityhive / rules

Cursor rule2 starsChanged 18 months agoMITArchived repositoryView on GitHub

Guidelines for creating and maintaining Cursor rules to ensure consistency and effectiveness.

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
  1. Distinctive:

    Context trigger: When this rule applies (e.g., "For Python files")

    line 22
  2. Distinctive:

    Use bullet points for clarity

    line 27
  3. Distinctive:

    Token efficiency: Keep rules under 100 lines when possible

    line 40
  4. Very specific:

    Context-aware: Use globs to apply rules only when relevant

    line 42
  5. Distinctive:

    Always-applied rules: Only for essential project context (1-2 rules max)

    line 47
  6. Very specific:

    File-specific rules: Use globs to target relevant file types

    line 48
  7. Distinctive:

    Keep examples current: Use real patterns from the codebase

    line 65
  8. Distinctive:

    Review regularly: Update rules when patterns change

    line 69
  9. Distinctive:

    Remove outdated: Delete obsolete rules to reduce token usage

    line 70
  10. Distinctive:

    Minimize always-applied rules: Use only for critical project context

    line 76
  11. Distinctive:

    Avoid redundancy: Don't repeat information across rules

    line 78
  12. Distinctive:

    Prioritize important: Put key guidelines first in rule content

    line 79

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
cursor-rules.mdc
---
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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.