This repository was archived by the owner on Jun 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcursor_rules_best_practices.mdc
More file actions
68 lines (54 loc) · 2.66 KB
/
cursor_rules_best_practices.mdc
File metadata and controls
68 lines (54 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
description: Advanced Cursor rules organization and effectiveness tips - use when optimizing rule performance
globs:
alwaysApply: false
---
# Cursor Rules: Best Practices and Organization
## Rule Evolution Strategy
- **Start minimal**: Begin with few, essential rules
- **Iterate based on usage**: Add rules when you notice inconsistent AI behavior
- **Monitor effectiveness**: Remove rules that AI consistently ignores
- **Adapt to model changes**: Rule effectiveness varies with different AI models
## Advanced Organization Patterns
### Rule Naming Conventions
- Use descriptive, searchable names: `elixir_testing_patterns.mdc`
- Group by technology: `phoenix_liveview.mdc`, `javascript_hooks.mdc`
- Separate by workflow: `deployment_checklist.mdc`, `code_review_standards.mdc`
- Version specialized rules: `api_v2_standards.mdc`
### Rule Hierarchy Strategy
- **Foundation rules**: Core standards that apply broadly (Always rules)
- **Technology rules**: Language/framework specific (Auto-Attach rules)
- **Workflow rules**: Process and procedure guidance (Agent rules)
- **Emergency rules**: Troubleshooting and fixes (Manual rules)
### Content Optimization
- **Lead with action verbs**: "Use", "Apply", "Check", "Avoid"
- **Prioritize common scenarios**: Put frequent use cases first
- **Use consistent formatting**: Standardize bullet points, code blocks, headings
- **Include negative examples**: Show what NOT to do
- **Add context clues**: Help AI understand when rule applies
## Effectiveness Measurement
### Tracking Rule Usage
- Note which rules appear in AI responses
- Monitor consistency of rule application
- Track when rules are ignored vs applied
### Performance Indicators
- **High effectiveness**: Rule consistently applied when relevant
- **Medium effectiveness**: Rule applied sometimes, may need refinement
- **Low effectiveness**: Rule rarely applied, consider removal or rewrite
- **Negative effectiveness**: Rule causes confusion or wrong behavior
### Optimization Techniques
- **A/B test descriptions**: Try different trigger phrases
- **Simplify complex rules**: Break into smaller, focused components
- **Update based on AI feedback**: Refine when AI misinterprets
- **Remove redundancy**: Eliminate overlapping or conflicting rules
## Advanced Techniques
### Dynamic Rule Content
- Use conditional language: "If using Phoenix 1.7+, then..."
- Include version-specific guidance
- Reference external documentation when appropriate
- Provide fallback approaches for edge cases
### Rule Composition
- Create modular rules that reference each other
- Use consistent terminology across related rules
- Build rule hierarchies for complex workflows
- Maintain clear separation of concerns