Skip to content

Commit 64689c3

Browse files
committed
rules
1 parent 9418424 commit 64689c3

File tree

2 files changed

+80
-1
lines changed

2 files changed

+80
-1
lines changed

.cursor/rules/json.mdc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: working with json fileshttps://ui.shadcn.com/docs/components/form
2+
description: working with json files
33
globs: *.json
44
---
55
If you're running a command to inspect a json file, or logging JSON in your code – always use `jq` to filter the object.

.cursor/rules/rules.mdc

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
description: working with json files
3+
globs: *.mdc
4+
---
5+
---
6+
description: Cursor Rules Location
7+
globs: *.mdc
8+
---
9+
# Cursor Rules Location
10+
11+
Rules for placing and organizing Cursor rule files in the repository.
12+
13+
<rule>
14+
name: cursor_rules_location
15+
description: Standards for placing Cursor rule files in the correct directory
16+
filters:
17+
# Match any .mdc files
18+
- type: file_extension
19+
pattern: "\\.mdc$"
20+
# Match files that look like Cursor rules
21+
- type: content
22+
pattern: "(?s)<rule>.*?</rule>"
23+
# Match file creation events
24+
- type: event
25+
pattern: "file_create"
26+
27+
actions:
28+
- type: reject
29+
conditions:
30+
- pattern: "^(?!\\.\\/\\.cursor\\/rules\\/.*\\.mdc$)"
31+
message: "Cursor rule files (.mdc) must be placed in the .cursor/rules directory"
32+
33+
- type: suggest
34+
message: |
35+
When creating Cursor rules:
36+
37+
1. Always place rule files in PROJECT_ROOT/.cursor/rules/:
38+
```
39+
.cursor/rules/
40+
├── your-rule-name.mdc
41+
├── another-rule.mdc
42+
└── ...
43+
```
44+
45+
2. Follow the naming convention:
46+
- Use kebab-case for filenames
47+
- Always use .mdc extension
48+
- Make names descriptive of the rule's purpose
49+
50+
3. Directory structure:
51+
```
52+
PROJECT_ROOT/
53+
├── .cursor/
54+
│ └── rules/
55+
│ ├── your-rule-name.mdc
56+
│ └── ...
57+
└── ...
58+
```
59+
60+
4. Never place rule files:
61+
- In the project root
62+
- In subdirectories outside .cursor/rules
63+
- In any other location
64+
65+
examples:
66+
- input: |
67+
# Bad: Rule file in wrong location
68+
rules/my-rule.mdc
69+
my-rule.mdc
70+
.rules/my-rule.mdc
71+
72+
# Good: Rule file in correct location
73+
.cursor/rules/my-rule.mdc
74+
output: "Correctly placed Cursor rule file"
75+
76+
metadata:
77+
priority: high
78+
version: 1.0
79+
</rule>

0 commit comments

Comments
 (0)