-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy path.cursorrules
171 lines (171 loc) · 5.89 KB
/
.cursorrules
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
{
"rules": [
{
"name": "Verify Information",
"pattern": "(?i)\\b(assume|assumption|guess|speculate)\\b",
"message": "Always verify information before presenting it. Do not make assumptions or speculate without clear evidence."
},
{
"name": "Preserve Existing Code",
"pattern": "(?i)\\b(remove|delete|eliminate|destroy)\\b",
"message": "Don't remove unrelated code or functionalities. Pay attention to preserving existing structures."
},
{
"name": "No Apologies",
"pattern": "(?i)\\b(sorry|apologize|apologies)\\b",
"message": "Never use apologies."
},
{
"name": "No Understanding Feedback",
"pattern": "(?i)\\b(understand|understood|got it)\\b",
"message": "Avoid giving feedback about understanding in comments or documentation."
},
{
"name": "No Whitespace Suggestions",
"pattern": "(?i)\\b(whitespace|indentation|spacing)\\b",
"message": "Don't suggest whitespace changes."
},
{
"name": "No Summaries",
"pattern": "(?i)\\b(summary|summarize|overview)\\b",
"message": "Don't summarize changes made."
},
{
"name": "No Inventions",
"pattern": "(?i)\\b(suggest|recommendation|propose)\\b",
"message": "Don't invent changes other than what's explicitly requested."
},
{
"name": "No Unnecessary Confirmations",
"pattern": "(?i)\\b(make sure|confirm|verify|check)\\b",
"message": "Don't ask for confirmation of information already provided in the context."
},
{
"name": "Single Chunk Edits",
"pattern": "(?i)\\b(first|then|next|after that|finally)\\b",
"message": "Provide all edits in a single chunk instead of multiple-step instructions or explanations for the same file."
},
{
"name": "No Implementation Checks",
"pattern": "(?i)\\b(make sure|verify|check|confirm) (it's|it is|that) (correctly|properly) implemented\\b",
"message": "Don't ask the user to verify implementations that are visible in the provided context."
},
{
"name": "No Unnecessary Updates",
"pattern": "(?i)\\b(update|change|modify|alter)\\b.*\\bno changes\\b",
"message": "Don't suggest updates or changes to files when there are no actual modifications needed."
},
{
"name": "Provide Real File Links",
"pattern": "(?i)\\b(file|in)\\b.*\\b(x\\.md)\\b",
"message": "Always provide links to the real files, not x.md."
},
{
"name": "No Current Implementation",
"pattern": "(?i)\\b(current|existing)\\s+(implementation|code)\\b",
"message": "Don't show or discuss the current implementation unless specifically requested."
},
{
"name": "Check Context Generated File Content",
"pattern": "(?i)\\b(file|content|implementation)\\b",
"message": "Remember to check the context generated file for the current file contents and implementations."
},
{
"name": "Use Descriptive Variable Names",
"pattern": "(?i)\\b(var|x|temp)\\b",
"message": "Prefer descriptive, explicit variable names over short, ambiguous ones to enhance code readability."
},
{
"name": "Follow Consistent Coding Style",
"pattern": "(?i)\\b(not consistent|different style)\\b",
"message": "Adhere to the existing coding style in the project for consistency."
},
{
"name": "Prioritize Performance",
"pattern": "(?i)\\b(slow|inefficient)\\b",
"message": "When suggesting changes, consider and prioritize code performance where applicable."
},
{
"name": "Security-First Approach",
"pattern": "(?i)\\b(insecure|vulnerable)\\b",
"message": "Always consider security implications when modifying or suggesting code changes."
},
{
"name": "Error Handling",
"pattern": "(?i)\\b(missing error|no exception)\\b",
"message": "Implement robust error handling and logging where necessary."
},
{
"name": "Modular Design",
"pattern": "(?i)\\b(mixed responsibilities|not modular)\\b",
"message": "Encourage modular design principles to improve code maintainability and reusability."
},
{
"name": "Avoid Magic Numbers",
"pattern": "(?i)\\b\\b\\d{2,}\\b",
"message": "Replace hardcoded values with named constants to improve code clarity and maintainability."
},
{
"name": "Consider Edge Cases",
"pattern": "(?i)\\b(edge case|not handled)\\b",
"message": "When implementing logic, always consider and handle potential edge cases."
},
{
"name": "Use Assertions",
"pattern": "(?i)\\b(no assertion|missing assert)\\b",
"message": "Include assertions wherever possible to validate assumptions and catch potential errors early."
}
],
"coding_practices": {
"modularity": true,
"DRY_principle": true,
"performance_optimization": true,
"documentation": {
"require_docs": true,
"doc_tool": "docstrings",
"style_guide": "Numpy"
},
"error_handling": {
"prefer_try_catch": true,
"log_errors": true
},
"naming_conventions": {
"variables": "snake_case",
"functions": "snake_case",
"classes": "PascalCase",
"interfaces": "PascalCase",
"files": "snake_case"
}
},
"project_configuration": {
"language": "Python",
"version": "3.13.2",
"dependencies": {
"management_tool": "Poetry",
"libraries": [
"discord.py",
"pyright",
"prisma",
"ruff",
"loguru",
"httpx",
"pre-commit",
"sentry-sdk",
"python-dotenv",
"pytz",
"pillow",
"rich",
"aiofiles",
"reactionmenu"
]
},
"development": {
"environment": "Docker",
"deployment_tool": "Docker Compose"
},
"error_handling": {
"logging_tool": "Loguru",
"exception_management": "Sentry and handlers/error.py"
}
}
}