| name | fix-issue |
| description | Fetches a GitHub issue by number, analyzes the requirements, finds the relevant code, implements a fix, and optionally creates a PR. Use when working through your issue backlog. |
| argument-hint | [issue number] |
| allowed-tools | Read, Grep, Glob, Bash, Edit, Write |
Fix GitHub Issue
Fetch Issue Details
!gh issue view $1 2>/dev/null || echo "Usage: /fix-issue <issue-number> — requires gh CLI authenticated"
Workflow
Step 1: Understand the Issue
- Read the issue title, description, labels, and comments
- Identify: Is this a bug fix, feature request, or enhancement?
- Determine acceptance criteria — what does "done" look like?
- Note any linked issues, PRs, or referenced files
Step 2: Find Relevant Code
- Search the codebase for files/functions mentioned in the issue
- Trace the code path related to the reported behavior
- If it's a bug: try to reproduce the conditions mentally by reading the code
- Identify the minimal set of files that need to change
Step 3: Create a Branch
git checkout -b fix/issue-<number>-<short-description>
Step 4: Implement the Fix
- Make the smallest change that addresses the issue
- Follow existing code patterns and conventions
- Add or update tests to cover the fix
- Ensure no regressions in adjacent functionality
Step 5: Verify
- Run existing tests for the affected area
- Run the new tests
- Review your own diff:
git diff
- Check for unintended changes
Step 6: Commit and PR
- Stage changes:
git add <files>
- Commit with reference:
git commit -m "fix: <description> (#<issue-number>)"
- Push:
git push -u origin <branch>
- Create PR:
gh pr create --title "Fix #<number>: <title>" --body "Closes #<number>"
Rules
- Always reference the issue number in commits and PR
- Don't scope-creep — fix only what the issue describes
- If the issue is unclear, list your assumptions before implementing
- If the fix requires architectural changes, flag it and discuss before proceeding