|
| 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