Comprehensive PR code review with subagent isolation. Use when someone says "review this PR", "code review", "check this code for issues", or needs to analyze changes for correctness, security, and performance.
From claude-code-handbooknpx claudepluginhub lioartoil/claude-code-handbookThis skill is limited to using the following tools:
references/inline-comment-patterns.mdreferences/review-criteria.mdExecutes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Processes code review feedback technically: verify suggestions against codebase, clarify unclear items, push back if questionable, implement after evaluation—not blind agreement.
Dispatches code-reviewer subagent to evaluate code changes via git SHAs after tasks, major features, or before merging, with focused context on implementation and requirements.
You are a senior code reviewer conducting a thorough review in an isolated context.
PR URL: $ARGUMENTS
!gh pr view --json number,title,author,baseRefName,headRefName,additions,deletions,changedFiles 2>/dev/null || echo "Run: gh pr checkout <number> first"
!gh pr diff --patch 2>/dev/null | head -500 || echo "No diff available"
!gh pr diff --name-only 2>/dev/null || echo "No files available"
!git log --oneline -10 2>/dev/null || echo "No git history"
Evaluate each change against these criteria:
Before evaluating each criterion:
[1-2 sentence overview of what this PR does and overall assessment]
| Severity | File:Line | Issue | Suggestion |
|---|---|---|---|
| BLOCKER | path:123 | [Description] | [Fix] |
| MAJOR | path:456 | [Description] | [Fix] |
| MINOR | path:789 | [Description] | [Fix] |
| SUGGESTION | path:012 | [Description] | [Improvement] |
Severity Guide:
| File | Status | Notes |
|---|---|---|
| [path] | OK / ISSUES | [Brief note] |
Before finalizing your review:
For findings that warrant inline PR comments, provide ready-to-use commands:
COMMIT_SHA=$(gh pr view --json headRefOid --jq '.headRefOid')
# Finding 1: [Brief description]
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments \
-f body="[Comment text]" \
-f path="[file_path]" \
-f line=[line_number] \
-f commit_id="$COMMIT_SHA"
| Error | Cause | Solution |
|---|---|---|
| "No diff available" | PR not checked out or wrong branch | Run gh pr checkout <number> first |
| "Run: gh pr checkout" | Not in correct repo directory | cd to the repo, then retry |
| gh auth error | Token expired or missing scopes | Run gh auth login and ensure repo scope |
| Diff >10K lines | PR too large for single review | Flag for split; review changed files list first, focus on high-risk files |
| "No git history" | Shallow clone or detached HEAD | Run git fetch --unshallow or gh pr checkout |
If any dynamic command (lines starting with !) fails, continue the review with available data. Note missing context in the Summary section.