GitHub Issues Auto-Fixer
Fetch GitHub issues, implement fixes, and open PRs — all automated.
Prerequisites
ghCLI installed and authenticated:brew install gh && gh auth login- Or:
GH_TOKENenvironment variable set
Process
1. Fetch Issues
# List open issues (default: bug label, limit 5)
gh issue list --repo <owner/repo> --label bug --limit 5 --json number,title,body,labels
2. For Each Issue
- Read the issue body and comments for reproduction steps
- Clone/navigate to the repo
- Create a feature branch:
git checkout -b fix/issue-<number> - Implement the fix (read code, understand context, make changes)
- Run tests if available
- Commit with message:
fix: <description> (closes #<number>) - Push and create PR:
gh pr create --repo <owner/repo> \
--title "fix: <title>" \
--body "Closes #<number>\n\n## Changes\n- <description>"
3. Monitor PRs (optional --watch flag)
# Check for review comments
gh pr view <number> --repo <owner/repo> --json reviewDecision,reviews,comments
Address review feedback and push updates.
Commands Reference
| Command | Purpose |
|---|---|
gh issue list --repo R --json number,title,body |
List open issues |
gh issue view N --repo R --json body,comments |
Read issue details |
gh pr create --repo R --title T --body B |
Create PR |
gh pr view N --repo R --json reviews,comments |
Check PR reviews |
gh pr merge N --repo R --squash |
Merge PR (with user approval) |
Usage Examples
/gh-issues octocat/hello-world --label bug --limit 3/gh-issues my-org/api --label "good first issue" --dry-run/gh-issues owner/repo --watch(monitor and address PR reviews)
Rules
- Always check if
ghis installed first - Never merge PRs without explicit user approval
- Create one PR per issue (not batch)
- Run existing tests before creating PR
- If fix is unclear, comment on the issue asking for clarification instead of guessing
- Dry-run mode: show what would be done without making changes