Fix GitHub issues systematically by analyzing the problem, implementing solutions, and creating well-tested pull requests
/plugin marketplace add claudeforge/marketplace/plugin install fix-github-issue@claudeforge-marketplaceSystematically resolve GitHub issues from analysis through PR creation with proper testing and documentation.
Provide the issue number you want to fix:
/fix-github-issue 123
The command will guide you through the entire fix process.
1. Fetch Issue Details
gh issue view 123 --json title,body,labels,comments
2. Understand the Problem
3. Find Related Code
# Search for relevant files
grep -r "error message" src/
find . -name "*component-name*"
4. Implement the Fix
5. Write Tests
// Example test
test('should handle edge case correctly', () => {
const result = functionName(edgeCaseInput);
expect(result).toBe(expectedOutput);
});
6. Verify Everything Works
npm test
npm run lint
npm run build
7. Create Pull Request
gh pr create --title "Fix: Issue description (#123)" \
--body "Fixes #123\n\nChanges:\n- Fixed X\n- Added test for Y"
Here's a real-world example:
Issue: "Validation fails for email addresses with plus signs"
Analysis:
src/utils/validation.tsSolution:
// Before
const emailRegex = /^[a-z0-9._-]+@[a-z0-9.-]+\.[a-z]{2,}$/i;
// After
const emailRegex = /^[a-z0-9._+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i;
Test:
test('validates emails with plus signs', () => {
expect(isValidEmail('user+tag@example.com')).toBe(true);
});
Null/Undefined Errors
// Add defensive checks
if (!user?.profile) {
return defaultProfile;
}
Logic Errors
// Fix conditional logic
if (count > 0 && isActive) { // Was: count >= 0 || isActive
processItems();
}
Validation Issues
// Strengthen validation
if (!email || !email.includes('@')) {
throw new Error('Invalid email');
}
Race Conditions
// Add proper async handling
await saveData(); // Was missing await
await updateUI();
When creating your PR, include:
## Fixes
Closes #123
## Problem
Brief description of the issue and its impact
## Solution
Explanation of how the fix works
## Testing
- Added unit test for X
- Verified manually with Y
- Checked edge cases A, B, C
## Changes
- `file1.ts`: Fixed validation logic
- `file1.test.ts`: Added test coverage
Can't Reproduce: Ask reporter for more details, exact steps, environment info
Multiple Possible Causes: Fix the most likely cause first, test thoroughly
Tests Failing: Ensure your fix doesn't break existing functionality
Unclear Requirements: Comment on the issue asking for clarification
A good fix includes: