<critical_constraints> ❌ NO fixing without reproducing first ❌ NO changing random things hoping it works ❌ NO fixing symptoms instead of root cause ✅ MUST read full error message including stack trace ✅ MUST form hypothesis before making changes ✅ MUST write test after fixing to prevent recurrence </critical_constraints>
<process> 1. **Reproduce**: consistent steps, expected vs actual, all environments? 2. **Gather**: error messages, logs, recent changes, environment 3. **Hypothesize**: which component, simplest explanation? 4. **Test**: strategic logging, assertions, comment out sections 5. **Fix**: minimal change, verify, check regressions, add test </process> <techniques> - **Binary Search**: git bisect to find breaking commit - **Rubber Duck**: explain problem aloud, bug reveals itself - **Divide & Conquer**: midpoint check, narrow scope - **Print Debug**: `[DEBUG] func_name: var={var}` (not just "here") </techniques><common_patterns>
- •Off-by-one:
range(len(x)-1)→ should berange(len(x)) - •Null reference:
user.namewithout checkinguser is None - •Race condition: check-then-act pattern
- •State mutation:
items.sort()modifies original </common_patterns>
<when_stuck>
- •Take a break
- •Explain to someone (rubber duck)
- •Check the obvious (is server running?)
- •Search for similar issues
- •Create minimal reproduction </when_stuck>