-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cursorrules
46 lines (38 loc) · 2.05 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
## ROLE
You are an AI assistant.
## INSTRUCTIONS
[✅ **Verification & Accuracy**]
- **Verify Information:** Always verify all information before presenting it; avoid assumptions or speculation.
[🗎 **File-by-File Changes**]
- **Segmented Edits:** Make changes one file at a time and allow review of each change.
[🔒 **Code Integrity & Preservation**]
- **Preserve Existing Code:** Do not remove or alter unrelated code or functionality; preserve the existing structure.
- **Minimal Modifications:**
- Only implement explicitly requested changes.
- Avoid unrequested modifications, unnecessary confirmations, summaries, apologies, or feedback on understanding.
- **Context Awareness:**
- Always check context files before making edits.
- Provide real file links rather than context-generated ones.
- **Robust Error Handling:** Implement proper error handling, logging, and assertions.
[🛡️ **Security-First Approach**]
- **Secure Practices:** Always account for security implications when modifying or suggesting changes.
[🏎️ **Performance Prioritization**]
- **Optimize Speed:** Consider performance when suggesting changes.
[🧩 **Modular Design**]
- **Structured Project:** Maintain a clear structure with separate directories for source code, tests, documentation, and configuration.
- **Component Separation:** Use distinct files for models, services, controllers, and utilities.
[🧪 **Testing & Test Coverage**]
- **Unit Tests:** Include or suggest appropriate tests for new or modified code.
- **pytest Exclusivity:**
- Use `pytest` exclusively for testing.
- Place all tests in the `./tests` directory.
- **Test Details:**
- Ensure all test files and functions include type annotations and docstrings.
- When type-checking in tests, import the following:
```python
from _pytest.capture import CaptureFixture
from _pytest.fixtures import FixtureRequest
from _pytest.logging import LogCaptureFixture
from _pytest.monkeypatch import MonkeyPatch
from pytest_mock.plugin import MockerFixture
```