From gh-pr-tools
Review a GitHub PR or self-review local changes. Fetches PR data via gh CLI, analyzes code quality, verifies tests, checks best practices, and posts inline review comments. Use when asked to review a PR, check a pull request, or self-review before creating a PR.
npx claudepluginhub shouenlee/ghcp-dev-plugin --plugin gh-pr-toolsThis skill uses the workspace's default tool permissions.
Review pull request changes or self-review local work before creating a PR.
Reviews GitHub pull requests using gh CLI, analyzing diffs for code quality, security, testing, best practices, and providing structured feedback.
Reviews GitHub pull requests end-to-end using gh CLI: analyzes diffs, commits, CI/CD checks; provides blocking/suggestion/nit/praise feedback and submits review. Use for assigned PRs, self-reviews, or post-merge audits.
Reviews a pull request for code quality and correctness. Use when asked to review a PR or when running as an automated PR reviewer.
Share bugs, ideas, or general feedback.
Review pull request changes or self-review local work before creating a PR.
Uses gh CLI for efficient data fetching.
gh CLI must be installed and authenticated (gh auth status)Trigger: /pr-review <PR-number-or-URL> or /pr-review when on a branch with an open PR
#123 or 123), use that directly.gh pr view --json number --jq '.number'
Gather all necessary information about the PR:
Metadata:
gh pr view <number> --json title,body,author,baseRefName,headRefName,state,additions,deletions,changedFiles,labels,reviewRequests,reviews,comments
Diff:
gh pr diff <number>
CI status:
gh pr checks <number>
Changed files list:
gh pr diff <number> --name-only
Existing review comments (GraphQL):
gh api graphql -f query='
query($owner:String!, $repo:String!, $pr:Int!) {
repository(owner:$owner, name:$repo) {
pullRequest(number:$pr) {
reviewThreads(first:100) {
nodes {
isResolved
isOutdated
comments(first:10) {
nodes {
body
author { login }
path
line
}
}
}
}
}
}
}' -f owner='{owner}' -f repo='{repo}' -F pr='{number}'
Use gh repo view --json owner,name --jq '.owner.login + " " + .name' to get owner and repo dynamically.
File content (when full context is needed):
git show origin/{headRefName}:{path} if the branch is fetchedgh api repos/{owner}/{repo}/contents/{path}?ref={sha}Commit history:
gh api repos/{owner}/{repo}/pulls/<number>/commits --paginate
Before reviewing any code, understand what the PR is trying to accomplish:
main vs a feature branch).Evaluate the PR at a high level:
Review the diff in detail, reading full files for context when needed:
Assess the testing quality of the PR:
gh pr checks. If checks are failing, flag this prominently regardless of code quality.Present a clear, actionable review:
## PR Review: <PR title> (#<number>)
**Author:** <author> | **Base:** <base branch> | **Changes:** +<additions> / -<deletions> across <N> files
### Summary
<1-3 sentence summary of what the PR does and overall assessment>
### Verdict: <APPROVE | REQUEST CHANGES | COMMENT>
### Findings
#### Critical
- [ ] <file:line> — <description of blocking issue>
#### Warning
- [ ] <file:line> — <description of non-trivial concern>
#### Suggestion
- <file:line> — <optional improvement>
### Test Coverage Assessment
<Summary of test quality, missing coverage, and CI status>
### What's Done Well
<Acknowledge good patterns, clean code, or thorough tests>
If there are no findings, say so explicitly and explain why the PR looks good.
For each finding from the review, post an inline review comment directly on the PR so feedback appears on the relevant lines in GitHub:
gh api repos/{owner}/{repo}/pulls/<number>/reviews \
--method POST \
--field event=PENDING \
--field body="" \
--jq '.id'
gh api repos/{owner}/{repo}/pulls/<number>/reviews/<review_id>/comments \
--method POST \
--field path="<file>" \
--field line=<line_number> \
--field side=RIGHT \
--field body="**[<severity>]** <description>"
After presenting the review, offer the user relevant follow-up actions:
gh pr review <number> --approve --body "<summary>"gh pr review <number> --request-changes --body "<summary>"gh pr review <number> --comment --body "<summary>"gh pr view <number> --webAsk which action the user would like to take, or if they want to adjust any findings before submitting.
Trigger: /pr-review (no arguments, and no open PR for the current branch)
Self-review local changes before creating a PR.
Uses git diff locally — no API calls needed.
git branch --show-current
Find the target branch (usually main or master):
git rev-parse --verify main 2>/dev/null && echo "main" || echo "master"
git diff --stat {target}...HEAD
git diff --name-only {target}...HEAD
git log --oneline {target}...HEAD
For each changed file, read the full diff:
git diff {target}...HEAD -- {file}
Read surrounding context as needed (use Read tool on local files).
Review the local changes using the same criteria as the remote review (Steps 4-7 above). Present the structured report without the inline comment posting steps.
../../secrets/, /etc/passwd, ~/.ssh/).
Only read and modify files within the local repository checkout.| Issue | Solution |
|---|---|
gh not authenticated | Run gh auth login first |
| PR not found | Verify the PR number and that the remote matches |
| No PR for current branch | Specify a PR number explicitly: /pr-review 123 |
| CI checks not visible | The repo may not have CI configured, or checks haven't run yet |
| Cannot post comments | Verify gh has write access to the repository |
| File not found locally | The PR branch may not be checked out. Suggest git checkout {branch} |