Skip to content

Commit a1b9dc5

Browse files
committed
cursor(rules[avoid-debug-loops]) Prevent AI digging us a hole
Add a new cursor rule 'avoid-debug-loops' that helps identify when debugging efforts are becoming circular and counterproductive. The rule provides: - Clear indicators for detecting debug loops - A 4-step action plan to break the cycle - A structured format for documenting issues completely - A portable template for sharing problems in a fresh context This will help reduce time spent in frustrating debugging loops and facilitate more efficient problem-solving approaches.
1 parent 7edf528 commit a1b9dc5

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.cursor/rules/avoid-debug-loops.mdc

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
description: When stuck in debugging loops, break the cycle by minimizing to an MVP, removing debugging cruft, and documenting the issue completely for a fresh approach
3+
globs: *.py
4+
alwaysApply: false
5+
---
6+
# Avoid Debug Loops
7+
8+
When debugging becomes circular and unproductive, follow these steps:
9+
10+
## Detection
11+
- You have made multiple unsuccessful attempts to fix the same issue
12+
- You are adding increasingly complex code to address errors
13+
- Each fix creates new errors in a cascading pattern
14+
- You are uncertain about the root cause after 2-3 iterations
15+
16+
## Action Plan
17+
18+
1. **Pause and acknowledge the loop**
19+
- Explicitly state that you are in a potential debug loop
20+
- Review what approaches have been tried and failed
21+
22+
2. **Minimize to MVP**
23+
- Remove all debugging cruft and experimental code
24+
- Revert to the simplest version that demonstrates the issue
25+
- Focus on isolating the core problem without added complexity
26+
27+
3. **Comprehensive Documentation**
28+
- Provide a clear summary of the issue
29+
- Include minimal but complete code examples that reproduce the problem
30+
- Document exact error messages and unexpected behaviors
31+
- Explain your current understanding of potential causes
32+
33+
4. **Format for Portability**
34+
- Present the problem in quadruple backticks for easy copying:
35+
36+
````
37+
# Problem Summary
38+
[Concise explanation of the issue]
39+
40+
## Minimal Reproduction Code
41+
```python
42+
# Minimal code example that reproduces the issue
43+
```
44+
45+
## Error/Unexpected Output
46+
```
47+
[Exact error messages or unexpected output]
48+
```
49+
50+
## Failed Approaches
51+
[Brief summary of approaches already tried]
52+
53+
## Suspected Cause
54+
[Your current hypothesis about what might be causing the issue]
55+
````
56+
57+
This format enables the user to easily copy the entire problem statement into a fresh conversation for a clean-slate approach.

0 commit comments

Comments
 (0)