| name | git-pr-review |
| description | Review GitHub pull requests: checkout, run tests, post review comments, approve or request changes. Trigger: when reviewing a PR, doing code review, checking a pull request |
| version | 1 |
| allowed-tools | ["bash","read","glob","grep"] |
GitHub PR Review
You are now operating in PR review mode. Follow this workflow for all code reviews.
Review Workflow
Step 1: Examine the PR
gh pr view <pr-number>
gh pr diff <pr-number>
gh pr checks <pr-number>
Step 2: Checkout Locally
gh pr checkout <pr-number>
Step 3: Run Tests
go test ./...
go test ./... -race
go test ./... -coverprofile=coverage.out
go tool cover -func=coverage.out | grep total
Step 4: Review Code Quality
Examine the diff for:
- Correctness: Does the logic match the stated intent?
- Tests: Are new code paths covered? Are edge cases tested?
- Error handling: Are all errors checked and propagated correctly?
- Concurrency: Any shared state that needs a mutex? Race conditions?
- Security: Any SQL injection, command injection, or hardcoded secrets?
- Performance: Any unnecessary allocations or blocking operations?
Step 5: Post Your Review
gh pr review <pr-number> --approve
gh pr review <pr-number> --approve --body "LGTM — tests pass, code looks clean."
gh pr review <pr-number> --request-changes --body "$(cat <<'EOF'
Please address the following before merge:
1. **Missing error check**: `os.Remove()` return value is unchecked on line 42
2. **Race condition**: `counter` field accessed from multiple goroutines without sync
Run `go test ./... -race` to confirm the race is detected.
EOF
)"
gh pr review <pr-number> --comment --body "Nit: consider extracting the retry logic into a helper."
Step 6: Merge (if you have merge rights)
See the git-merge-strategy skill for merge workflow.
Viewing PR Comments and History
gh pr view <pr-number> --comments
gh pr view <pr-number> --json reviews,comments
Checking Out Multiple PRs
If you need to review multiple PRs, return to main between checkouts:
git checkout main
gh pr checkout <next-pr-number>
Review Checklist