| name | bug-fix |
| description | Systematic bug investigation and fix workflow. Use when fixing bugs, investigating issues, or debugging test failures. |
| argument-hint | [issue-number or description] |
Bug Fix Workflow
Fix $ARGUMENTS using this systematic process.
Step 1: Investigation (parallel)
- Search for related issues:
gh issue list --label bug
- Search error patterns:
rg "unwrap\(\)|expect\(" src/ and rg "TODO|FIXME" src/
- Review recent commits for potential causes:
git log --oneline -20
Step 2: Reproduction
- Extract error messages and affected context
- Create a minimal failing test:
#[test]
fn test_reproduce_issue() {
}
- Verify the issue:
cargo test test_reproduce_issue -- --nocapture
Step 3: Root Cause Analysis
Common categories in this project:
- Parsing: Malformed JSONL handling
- Date/Time: Timezone or format issues
- Paths: Cross-platform path handling
- Memory: Large file processing
- Display: Terminal width/color issues
Step 4: Fix Implementation
- Add a failing test first
- Implement the fix
- Verify the test passes
- Check for regressions
Step 5: Verification
cargo test <specific_test>
cargo test
cargo test --all-features
Step 6: Regression Prevention
Add a dedicated regression test to prevent recurrence:
#[cfg(test)]
mod regression_tests {
#[test]
fn issue_NNN_description() {
}
}
Checklist