| name | pr-review |
| description | Comprehensive GitHub PR review — diff analysis, CI status check, multi-perspective code review, and actionable feedback. Activate when #pr appears anywhere in the user message. |
| argument-hint | [pr-number-or-url] |
| disable-model-invocation | false |
| allowed-tools | Read, Glob, Grep, Bash, Task |
Review pull request: $ARGUMENTS
Prerequisite check:
- Verify
gh CLI is available by running command -v gh. If missing:
- What's wrong: GitHub CLI (
gh) is not installed.
- How to fix: Install with
brew install gh (macOS) or see https://cli.github.com/
- If a PR number is provided, verify the current directory is a git repo with a GitHub remote.
- If
gh is not available, fall back to git diff for local-only review.
Phase 1 — PR context:
- If a PR number or URL is provided, fetch PR details using
gh pr view.
- If no PR specified, check current branch against base branch.
- Gather:
- PR title and description
- Changed files list (
gh pr diff --stat or git diff --stat)
- CI status (
gh pr checks if available)
- Number of commits
Phase 2 — Diff analysis:
- Read the full diff.
- Categorize changes: new features, bug fixes, refactoring, tests, docs, config.
- Identify scope — is the PR focused or does it mix concerns?
Phase 3 — Multi-perspective review (run in parallel if possible):
- Correctness: Logic errors, edge cases, off-by-one, null handling.
- Security: OWASP Top 10, secret exposure, injection risks, auth bypasses.
- Performance: O(n²) patterns, unnecessary allocations, missing indexes.
- Maintainability: Code clarity, naming, duplication, test coverage.
- Scope: Does the PR do what it claims? Any scope creep?
Phase 4 — Report:
PR Review: #<number> — <title>
================================
CI Status: passing/failing/pending
Files changed: N (+additions, -deletions)
Verdict: APPROVE / REQUEST_CHANGES / COMMENT
Critical issues:
- [list if any]
Suggestions:
- [list if any]
Highlights:
- [good things worth noting]