plugins/gh-pr-tools/skills/pr_review/SKILL.md
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 skillsauth add shouenlee/ghcp-dev-plugin pr_reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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} |
tools
Decomposes feature descriptions or GitHub issues into ordered subtasks with file-level scope, acceptance criteria, and optional gh issue create. Use when asked to "break down task", "decompose feature", "create subtasks", "plan implementation", "break this into tasks", "task list", or "implementation plan".
documentation
Generates changelogs from conventional commits, bumps semantic versions in pyproject.toml or package.json, and publishes GitHub releases. Use when asked to "create release", "release notes", "changelog", "bump version", "semantic version", "tag release", "publish release", or "what changed since last release".
development
Runs ruff, mypy, and bandit on changed Python files — explains violations and auto-fixes with ruff check --fix. Use when asked to "lint", "fix lint", "check types", "type check", "run mypy", "run ruff", "python quality", or "lint python files".
development
Create new Agent Skills for GitHub Copilot from prompts or by duplicating this template. Use when asked to "create a skill", "make a new skill", "scaffold a skill", or when building specialized AI capabilities with bundled resources. Generates SKILL.md files with proper frontmatter, directory structure, and optional scripts/references/assets folders.