Fix GitHub Issue
Context
- •Current repository: !
gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null || echo "Not a GitHub repository" - •Current branch: !
git branch --show-current - •Project standards: @.claude/CLAUDE.md
- •TDD approach: Follow t-wada's TDD methodology when applicable
Your task
Analyze and fix a GitHub issue by its issue number. Understand the problem, implement a solution following project standards, and ensure proper testing.
Usage
code
Fix issue #<issue-number>
Steps
- •
View the issue details
bashgh issue view <issue-number> gh issue view <issue-number> --comments # Include comments for more context
- •
Create a feature branch
bashgit checkout -b fix/issue-<issue-number> # Or for features: git checkout -b feat/issue-<issue-number>
- •
Analyze the problem
- •Read issue description and acceptance criteria
- •Check linked issues or PRs
- •Review any provided error messages or logs
- •Understand the expected vs actual behavior
- •
Search the codebase
- •Use grep/glob to find relevant files
- •Look for error messages mentioned in the issue
- •Find related tests and documentation
- •
Implement the fix
- •Follow TDD principles if requested
- •Make minimal changes to fix the issue
- •Follow existing code conventions
- •Add comments only if explicitly needed
- •
Run quality checks
bash# Format code npm run format || cargo fmt # Run linter npm run lint || cargo clippy # Type check npm run typecheck || cargo check # Run tests npm test || cargo test
- •
Create commit
bashgit add . git commit -m "fix: <description> (#<issue-number>)" # Example: git commit -m "fix: handle null response in API client (#123)"
- •
Push and create PR
bashgit push -u origin fix/issue-<issue-number> gh pr create --title "fix: <description>" --body "Fixes #<issue-number>" --assignee @me
Commit Message Format
- •Use
fix:prefix for bug fixes - •Use
feat:prefix for new features - •Reference the issue:
(#123)or in body:Fixes #123 - •Keep subject line under 50 characters
Notes
- •Always link the PR to the issue using "Fixes #123" in the PR body
- •The issue will automatically close when the PR is merged
- •If the issue is in a different repo, use full reference: "Fixes owner/repo#123"
- •Run all checks locally before pushing to avoid CI failures