Bug fixing with root cause analysis and regression testing
Diagnoses root causes, implements fixes with regression tests, and documents solutions in knowledge base.
/plugin marketplace add barnabasJ/claude/plugin install essentials@essentials-marketplaceissue-descriptionSystematically diagnoses root causes, implements fixes, and creates regression tests. Emphasizes finding the actual problem (not symptoms), knowledge-first debugging, and ensuring the bug never returns.
šØ Before any debugging, search ./notes/knowledge/:
./notes/knowledge/hard-won-knowledge/ - Similar problems solved./notes/knowledge/technical-patterns/ - Tech-specific solutions./notes/knowledge/project/ - Project-specific approachesLook for: similar errors, symptoms, previous solutions.
git checkout -b fix/[issue-description]
Establish reliable reproduction:
Document:
Check logs and errors:
Isolate the problem:
Five Whys technique:
Root cause: Date parsing doesn't handle timezones
šØ Fix the root cause, not symptoms.
Write to ./notes/fixes/[issue-name].md:
# Fix: [Issue Name]
## Issue Description
- Problem: [what's broken]
- Steps to reproduce: [numbered steps]
- Expected: [what should happen]
- Actual: [what happens]
## Root Cause Analysis
- Where: [file:line]
- Why: [technical explanation]
- Affected: [related components]
## Solution
- Approach: [how to fix]
- Changes: [files to modify]
## Testing
- Regression test: [test that fails before, passes after]
- Edge cases: [additional tests]
## Rollback Plan
- Revert: [how to undo]
- Monitor: [what to watch]
šØ Before implementing fix:
Use review agents in parallel:
Address any issues found.
git commit -m "fix(scope): description
Root cause: [brief explanation]
Solution: [what was changed]
Closes #[issue-number]"
šØ Immediately after solving, document in
./notes/knowledge/hard-won-knowledge/:
# [Problem Title]
## Symptoms
- Error message: [exact message]
- When it occurs: [conditions]
## Root Cause
[Technical explanation]
## Solution
[What fixed it]
## Prevention
[How to avoid in future]
| Agent | When to Use |
|---|---|
| qa-reviewer | Test strategy, regression tests |
| security-reviewer | Security implications |
| senior-engineer-reviewer | Fix approach validation |
| research-agent | Technical documentation |
Location: ./notes/fixes/[issue-name].md
Required sections:
šØ Do:
šØ Don't:
Input: /fix login-timeout-too-short
Process:
1. Check knowledge base ā No similar issue found
2. Reproduce:
- Login, wait 35 seconds, submit
- Get timeout error
- Expected: 5 min timeout
3. Investigate:
- Check session config
- Found: timeout = 30000 (30 sec)
- Should be: 300000 (5 min)
- Root cause: Typo in config
4. Write regression test:
- Test session timeout is 5 minutes
- Verify test FAILS with current config
5. Fix:
- Update config/session.conf: 30000 ā 300000
6. Verify:
- Regression test PASSES
- Full suite passes
7. Commit:
"fix(session): correct timeout from 30s to 5min"
8. Store in knowledge base:
- Problem: Session timeout too short
- Cause: Config typo (missing zero)
- Solution: Verify timeout values have correct zeros