-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkflow-rule.mdc
More file actions
104 lines (86 loc) · 2.91 KB
/
workflow-rule.mdc
File metadata and controls
104 lines (86 loc) · 2.91 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
description: When a user asks you to create a a rule, follow these instructions to create a comprehensive, structured rule.
globs:
alwaysApply: false
---
# Guidelines for Creating New Rules or Updating Existing Rules
## Rule Structure
Each rule file should follow this structure:
```
---
description: Brief description of what the rule covers
globs: [optional file patterns where this rule applies]
alwaysApply: true/false (whether to apply this rule to all conversations)
---
## Rule Title
## Context (Optional)
Brief explanation of when and why this rule is useful.
## Guidelines
Specific guidelines to follow when this rule applies:
1. Guideline one
2. Guideline two
3. ...and so on
```
## Rule Creation Process
1. **Identify the need**: Determine what guidance would be helpful for future projects
2. **Research best practices**: Gather information on best practices in this area
3. **Draft guidelines**: Create specific, actionable guidelines
4. **Test the rule**: Apply the rule to a real scenario to verify its usefulness
5. **Refine and improve**: Update the rule based on experience using it
## Rule Naming Convention
- Use kebab-case for filenames (e.g., `some-rule.mdc`)
- Keep names short but descriptive
- Focus on the primary purpose of the rule
## Rule Location
1. **Always place rule files in PROJECT_ROOT/.cursor/rules/:**
```
.cursor/rules/
├── your-rule-name.mdc
├── another-rule.mdc
└── ...
```
2. **Follow the naming convention:**
- Use kebab-case for filenames (e.g., my-rule-name.mdc)
- Always use the .mdc extension
- Make names descriptive of the rule's purpose
3. **Organize rules into subdirectories within .cursor/rules/ if needed for larger projects:**
```
.cursor/rules/
├── coding-style/
│ ├── python-style.mdc
│ └── javascript-style.mdc
├── git/
│ └── commit-messages.mdc
└── ...
```
4. **Never place rule files:**
- In the project root
- In subdirectories outside .cursor/rules (or its subdirectories)
- In any other location
## Rule location examples
### **Bad: Rule file in wrong location**
- rules/my-rule.mdc
- my-rule.mdc
- .rules/my-rule.mdc
- .cursor/rules/my-rule/my-rule.mdc # Too deep, but .cursor/rules/my-rule.mdc is good.
### **Good: Rule file in correct location**
- .cursor/rules/my-rule.mdc
- .cursor/rules/category/my-rule.mdc
## Tips for Effective Rules
- Always create files in `.cursor/rules/`
- Use consistent formatting
- Verify file content after creation
- Make guidelines specific and actionable
- Focus on practical advice rather than theory
- Include examples where helpful
- Keep guidelines concise (1-2 sentences each)
- Ensure guidelines are mutually supportive
- Consider both immediate and long-term implications
<metadata>
priority: critical
version: 1.0
changelog:
- version: 1.0
changes:
- Initial version
</metadata>