fix-issue
Fix a GitHub issue by number. Reads the issue, implements the fix, writes tests, and commits the result. Use when the user says "fix issue #123", "work on issue", or "implement the bug fix for #N".
Fix GitHub issue #$ARGUMENTS:
-
Read the issue details:
gh issue view $ARGUMENTSUnderstand the reported problem, reproduction steps, and acceptance criteria.
-
Explore the codebase to find relevant files:
- Search for symbols, file names, or keywords mentioned in the issue
- Read the relevant source files to understand the current implementation
- Check existing tests for the affected area
-
Plan the fix:
- Identify the root cause (not just the symptom)
- Outline the minimal change needed to fix the issue without breaking existing behavior
-
Write a failing test first (TDD approach):
- Add a test that reproduces the reported bug or missing behavior
- Confirm it fails before the fix
-
Implement the fix:
- Make the targeted change to source code
- Keep the diff minimal - avoid unrelated refactors in the same commit
-
Run the test suite to verify:
- The new test passes
- No existing tests were broken
-
Commit with a message referencing the issue:
fix(<scope>): <description> Fixes #$ARGUMENTS
Requirements
ghCLI must be installed and authenticated- The issue number must exist in the current repository
- Tests must pass before committing
Error Handling
- If the issue is not found: report the error and stop
- If the issue is already closed: confirm with the user before proceeding
- If tests fail after the fix: report failures and do not commit
- If the fix requires a design decision: outline the options and ask the user to choose