| name | bugfix-playbook |
| description | Systematic approach to identifying, analyzing, and fixing bugs |
| license | MIT |
Bug Fix Playbook
When to Use
- Fixing reported bugs
- Debugging production issues
- Investigating test failures
- Resolving regression issues
Steps
1. Reproduce the Bug
- Document exact reproduction steps
- Verify the bug exists in current version
- Create minimal reproduction case
- Capture relevant logs/errors
2. Gather Information
- Review bug report details
- Check for related issues
- Review recent changes
- Collect stack traces
3. Locate the Source
- Use stack traces to identify locations
- Search for error messages in codebase
- Trace execution flow
- Identify the specific file and function
4. Analyze the Root Cause
- Understand the expected behavior
- Compare with actual behavior
- Identify why the discrepancy occurs
- Document the root cause clearly
5. Design the Fix
- Determine the minimal change needed
- Consider potential side effects
- Plan any necessary refactoring
6. Implement the Fix
- Write the fix (minimal, targeted)
- Add/update tests
- Verify fix resolves the issue
- Run all tests to catch regressions
Root Cause Analysis Template
## Bug Analysis: [Bug Title]
### Issue
[Description of the bug]
### Root Cause
[Explanation of why the bug occurs]
### Affected Code
- `file_path:line_number` - [Description]
### Fix Approach
[Description of how to fix]
### Tests to Add
1. [Test case 1]
2. [Test case 2]
Checklist