-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cursorrules
201 lines (201 loc) · 8.92 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
{
"name": "byDefault",
"description": "A Python application with command line tools for Splunk 9.2.2 developers using UV for package and venv management, Ruff for linting and formatting, and tested with pytest.",
"rules": [
{
"context": "Project Development Principles",
"instructions": [
"Follow these core software development principles:",
" - SOLID: Write code that is modular, extensible, and maintainable",
" - Single Responsibility: Each class/module should have only one reason to change",
" - Open/Closed: Open for extension, closed for modification",
" - Liskov Substitution: Subtypes must be substitutable for their base types",
" - Interface Segregation: Many client-specific interfaces better than one general-purpose interface",
" - Dependency Inversion: Depend on abstractions, not concretions",
" - DRY (Don't Repeat Yourself): Eliminate duplication through abstraction",
" - KISS (Keep It Simple, Stupid): Favor simplicity over complexity",
" - YAGNI (You Aren't Gonna Need It): Only implement what is currently needed",
"Prioritize maintainability and clarity over clever or complex solutions",
"Phase-based development requirements:",
" - Each phase builds upon prior phases without modifying existing functionality",
" - Only modify previous phase code when absolutely necessary",
" - Document thoroughly any changes to previous phase implementations",
"Command design principles:",
" - Commands should be additive and integrative with existing functionality",
" - New commands must not break existing command behavior",
" - All commands should follow consistent patterns for options and output",
" - Design commands to be composable where appropriate"
]
},
{
"context": "Python CLI Development",
"instructions": [
"Use UV for package and venv management. Ensure package requirements and dependencies are defined in a way that supports UV.",
"Utilize Ruff for linting and formatting. Follow PEP 8 style guidelines for Python code.",
"Include comprehensive docstrings for all functions and classes to assure maintainability and understanding.",
"Testing should be exclusively with pytest. Do not require unittests.",
"Security, clarity, and maintainability must be prioritized across all development activities."
]
},
{
"context": "Terminal Commands",
"instructions": [
"Always provide terminal commands in a copy-pasteable format using && for command chaining",
"Git commands should be provided as a single line that can be directly copied to terminal",
"For Git commit commands with multi-line messages, use multiple -m flags instead of newlines:",
" - INCORRECT: git commit -m \"type: description\\n\\n- Change 1\\n- Change 2\"",
" - CORRECT: git commit -m \"type: description\" -m \"- Change 1\" -m \"- Change 2\"",
"Git commit messages should follow the format:",
" - First line: type: brief description",
" - Blank line",
" - Bullet points starting with - for detailed changes",
" - Optional context or rationale after bullet points only if overly complex and needed",
"Include comments above complex commands explaining their purpose",
"For destructive operations, include a warning comment above the command"
]
},
{
"context": "Markdown and Documentation",
"instructions": [
"For README.md and other markdown files:",
" - Use proper heading hierarchy (# for title, ## for sections)",
" - For code blocks:",
" - Indent block markers with same level as containing section",
" - Indent code content one additional level inside block",
" - Use language identifiers (```bash, ```python)",
" - Keep block markers aligned with section text",
" - Add empty line before and after blocks",
" - For command examples:",
" - Use $ prefix for shell commands",
" - Include expected output indented one level",
" - Group related commands together",
" - Add descriptive text before command blocks",
"Include clear usage instructions and examples for CLI tools.",
"Document all major classes and functions using docstrings."
]
},
{
"context": "CI/CD and Deployment",
"instructions": [
"Implement CI/CD pipelines using GitHub Actions.",
"Ensure the project is set up for packaging and distribution as a UV tool.",
"Deploy the package in a private enterprise GitHub repository."
]
},
{
"context": "Python Documentation",
"instructions": [
"All functions and classes must have comprehensive docstrings that:",
" - Describe the purpose and behavior",
" - Document all parameters using Args section",
" - Document return values using Returns section",
" - List all raised exceptions using Raises section",
" - Include usage examples for complex functionality",
"When updating code:",
" - Never remove existing docstrings",
" - Update docstrings to reflect any changes in functionality",
" - Add implementation details for Python version-specific features",
" - Document any performance considerations or optimizations"
]
},
{
"context": "Python Development Tools",
"instructions": [
"Use Ruff exclusively for:",
" - Code formatting",
" - Import sorting",
" - Code linting",
" - Style enforcement",
"Do not use or recommend:",
" - Pylance for linting",
" - Black for formatting",
" - isort for imports",
" - flake8 or pylint"
]
},
{
"context": "UV Commands",
"instructions": [
"For running the CLI directly from source:",
" - uv run ./src/bydefault/cli.py [command] [options]",
"For building and installing the package:",
" - uv sync --all-extras && uv build && uv tool install --reinstall-package bydefault ./dist/bydefault-*.tar.gz",
"For development installation:",
" - uv pip install -e \".[dev]\"",
"Always sync dependencies before running tests:",
" - uv sync --all-extras"
]
},
{
"context": "Git Operations",
"instructions": [
"When amending commits:",
" - Use git add for specific files",
" - Use --amend to modify the last commit",
" - Keep the original commit message format",
" - Include warning about amending pushed commits",
"Example:",
" git add specific/files && git commit --amend -m \"type: description",
"",
" - Bullet points",
" - More points",
"",
" Context here\""
]
},
{
"context": "Development Notes",
"instructions": [
"DEVNOTES.md should include:",
" - Current state and recently completed work",
" - Next steps with implementation details",
" - Context for next development session",
" - Files of interest with brief descriptions",
" - Recent commits in chronological order",
" - Technical notes and considerations",
"Format sections as:",
" ## Current State",
" ### Recently Completed",
" - List with details",
" ## Next Steps",
" - Prioritized tasks with considerations",
" ## Context for Next Session",
" - Key points for resuming work",
" ## Files of Interest",
" - Relevant files with descriptions",
" ## Recent Commits",
" - Last few commits in order",
" ## Notes",
" - Technical considerations"
]
},
{
"context": "TODO Management",
"instructions": [
"Never delete tasks from TODO.md",
"Tasks and sections should follow these rules:",
" - Tasks remain in their original phase and section",
" - Tasks can be marked complete [x] with date (YYYY-MM-DD)",
" - Sections can be marked as:",
" - (Complete) when all tasks are done",
" - (In Progress) when work has started",
" - (Next) when planned for immediate future",
" - New tasks can be added to any section",
" - Tasks can be reorganized within their section",
"Format sections as:",
" ### Section Name (Complete)",
" - [x] Task 1 (2024-03-20)",
" - [x] Task 2 (2024-03-21)",
"",
" ### Section Name (In Progress)",
" - [x] Completed task (2024-03-22)",
" - [ ] Current task",
" - [ ] Upcoming task",
"",
" ### Section Name (Next)",
" - [ ] Planned task 1",
" - [ ] Planned task 2"
]
}
]
}