Comprehensive PR code review - checks diff, patterns, runs validation, comments on PR. Single-pass by default; pass --agents for a multi-agent specialist fan-out (comments, tests, errors, types, code, docs, simplify). Use when the user wants to review a pull request, wants a thorough/multi-agent review, or invokes $prp-review.
72
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
Arguments:
$ARGUMENTS(and$1,$2, ...) refer to the arguments given when this skill was invoked. Take them from the user's request; if absent, infer them from the conversation.
Input: $ARGUMENTS
# --- PRP store resolver (canonical; keep byte-identical across skills) ---
_gd="$(git rev-parse --path-format=absolute --git-common-dir 2>/dev/null)"
case "$_gd" in */.git) _root="${_gd%/.git}" ;; "") _root="$PWD" ;; *) _root="$_gd" ;; esac
_root="$(cd "$_root" && pwd -P)"
_name="$(basename "$_root" | tr '[:upper:]' '[:lower:]' | tr -cs 'a-z0-9' '-' | sed 's/^-*//;s/-*$//')"
PRP_DIR="${PRP_HOME:-$HOME/.prp}/${_name:-project}-$(printf %s "$_root" | git hash-object --stdin | cut -c1-8)"
mkdir -p "$PRP_DIR"; [ -f "$PRP_DIR/project.json" ] || printf '{"path": "%s", "name": "%s"}\n' "$_root" "${_name:-project}" > "$PRP_DIR/project.json"This skill has two modes:
| Mode | Trigger | What it does |
|---|---|---|
| Single-pass (default) | no --agents flag | One reviewer performs the full 8-phase review below |
| Multi-agent fan-out | --agents flag present, or aspect keywords (comments/tests/errors/types/code/docs/simplify/all), or the user asks for a "multi-agent"/"thorough" review | Dispatches specialized agents in parallel, one per aspect |
If multi-agent mode is selected: follow workflows/agents.md instead of the phases below, then stop. Everything below this section is the single-pass review.
Single-pass is the cheaper default; reach for --agents on large diffs or when explicitly asked.
Perform a thorough, senior-engineer-level code review:
Golden Rule: Be constructive and actionable. Every issue should have a clear recommendation. Acknowledge good work too.
Determine input type:
| Input Format | Action |
|---|---|
Number (123, #123) | Use as PR number |
URL (https://github.com/.../pull/123) | Extract PR number |
Branch name (feature-x) | Find associated PR |
# If branch name provided, find PR
gh pr list --head {branch-name} --json number -q '.[0].number'# Get comprehensive PR details
gh pr view {NUMBER} --json number,title,body,author,headRefName,baseRefName,state,additions,deletions,changedFiles,files,reviews,comments
# Get the diff
gh pr diff {NUMBER}
# List changed files
gh pr diff {NUMBER} --name-onlyExtract:
# Fetch and checkout the PR branch
gh pr checkout {NUMBER}| State | Action |
|---|---|
MERGED | STOP: "PR already merged. Nothing to review." |
CLOSED | WARN: "PR is closed. Review anyway? (historical analysis)" |
DRAFT | NOTE: "Draft PR - focusing on direction, not polish" |
OPEN | PROCEED with full review |
PHASE_1_CHECKPOINT:
Read and internalize:
# Project conventions
cat CLAUDE.md
# Check for additional reference docs
ls -la .claude/docs/ 2>/dev/null
ls -la docs/ 2>/dev/nullExtract key constraints:
Look for implementation artifacts:
# Find implementation report by branch name. Legacy hits require migration.
ls "$PRP_DIR"/reports/*{branch-name}*.md 2>/dev/null || ls .claude/PRPs/reports/*{branch-name}*.md 2>/dev/null
# Find completed plans. Legacy hits require migration.
ls "$PRP_DIR"/plans/completed/ 2>/dev/null || ls .claude/PRPs/plans/completed/ 2>/dev/null
# Find issue investigations. Legacy hits require migration.
ls "$PRP_DIR"/issues/completed/ 2>/dev/null || ls .claude/PRPs/issues/completed/ 2>/dev/nullIf a legacy in-repo path is found, tell the user to run the PRP home-store migration before continuing.
If implementation report exists:
If no implementation report:
$prp-implementFrom PR title, description, AND implementation report (if available):
For each changed file, determine:
PHASE_2_CHECKPOINT:
For each file in the diff:
For EVERY changed file, check:
any)?Important: Check implementation report first!
If a deviation from expected patterns is documented in the implementation report with a valid reason, it is NOT an issue - it's an intentional decision. Only flag undocumented deviations.
Finding Categories (shared with --agents mode — see templates/review-report.md):
| Category | Icon | Criteria | Examples |
|---|---|---|---|
| Critical | RED | Must fix before merge - blocking | Security vulnerabilities, data loss potential, crashes |
| Important | ORANGE | Should fix before merge | Type safety violations, missing error handling, logic errors |
| Suggestions | YELLOW | Nice to have - consider | Pattern inconsistencies, missing edge cases, undocumented deviations, style preferences, minor optimizations, documentation |
| Strengths | GREEN | What's good - acknowledge | Good patterns, clean code, thorough tests |
PHASE_3_CHECKPOINT:
# Type checking (adapt to project)
npm run type-check || bun run type-check || npx tsc --noEmit
# Linting
npm run lint || bun run lint
# Tests
npm test || bun test
# Build
npm run build || bun run buildCapture for each:
Based on what changed:
| Change Type | Additional Validation |
|---|---|
| New API endpoint | Test with curl/httpie |
| Database changes | Check migration exists |
| Config changes | Verify .env.example updated |
| New dependencies | Check package.json/lock file |
# Full test suite
npm test || bun test
# Specific tests for changed functionality
npm test -- {relevant-test-pattern}PHASE_4_CHECKPOINT:
APPROVE if:
REQUEST CHANGES if:
BLOCK if:
| Situation | Handling |
|---|---|
| Draft PR | Comment only, no approve/block |
| Large PR (>500 lines) | Note thoroughness limits, suggest splitting |
| Security-sensitive | Extra scrutiny, err on caution |
| Missing tests | Strong recommendation, may not block |
PHASE_5_CHECKPOINT:
mkdir -p "$PRP_DIR/reviews"Path: $PRP_DIR/reviews/pr-{NUMBER}-review.md (report the expanded absolute path to the user).
---
pr: {NUMBER}
title: "{TITLE}"
author: "{AUTHOR}"
reviewed: {ISO_TIMESTAMP}
recommendation: {approve|request-changes|block}
---
# PR Review: #{NUMBER} - {TITLE}
**Author**: @{author}
**Branch**: {head} -> {base}
**Files Changed**: {count} (+{additions}/-{deletions})
---
## Summary
{2-3 sentences: What this PR does and overall assessment}
---
## Implementation Context
| Artifact | Path |
|----------|------|
| Implementation Report | `{path}` or "Not found" |
| Original Plan | `{path}` or "Not found" |
| Documented Deviations | {count} or "N/A" |
{If implementation report exists: Brief note about deviation documentation quality}
---
## Changes Overview
| File | Changes | Assessment |
|------|---------|------------|
| `{path/to/file.ts}` | +{N}/-{M} | {PASS/WARN/FAIL} |
---
## Issues Found
### Critical
{If none: "No critical issues found."}
- **`{file.ts}:{line}`** - {Issue description}
- **Why**: {Explanation of the problem}
- **Fix**: {Specific recommendation}
### Important
{Issues that should be fixed before merge}
### Suggestions
{Issues worth considering but not blocking, nice-to-haves, and future improvements}
---
## Validation Results
| Check | Status | Details |
|-------|--------|---------|
| Type Check | {PASS/FAIL} | {notes} |
| Lint | {PASS/WARN} | {count} warnings |
| Tests | {PASS/FAIL} | {count} passed |
| Build | {PASS/FAIL} | {notes} |
---
## Pattern Compliance
- [{x}] Follows existing code structure
- [{x}] Type safety maintained
- [{x}] Naming conventions followed
- [{x}] Tests added for new code
- [{x}] Documentation updated
---
## Strengths
{Acknowledge positive aspects - good patterns, clean code, thorough tests, etc.}
---
## Recommendation
**{APPROVE/REQUEST CHANGES/BLOCK}**
{Clear explanation of recommendation and what needs to happen next}
---
*Reviewed by Claude*
*Report: `{expanded absolute path to $PRP_DIR/reviews/pr-{NUMBER}-review.md}`*PHASE_6_CHECKPOINT:
Based on recommendation and flags:
# If --approve flag AND no Critical/Important issues
gh pr review {NUMBER} --approve --body-file "$PRP_DIR/reviews/pr-{NUMBER}-review.md"
# If --request-changes flag OR Important issues found
gh pr review {NUMBER} --request-changes --body-file "$PRP_DIR/reviews/pr-{NUMBER}-review.md"
# Otherwise just comment
gh pr comment {NUMBER} --body-file "$PRP_DIR/reviews/pr-{NUMBER}-review.md"# Get the review/comment URL
gh pr view {NUMBER} --json reviews,comments --jq '.reviews[-1].url // .comments[-1].url'PHASE_7_CHECKPOINT:
## PR Review Complete
**PR**: #{NUMBER} - {TITLE}
**URL**: {PR_URL}
**Recommendation**: {APPROVE/REQUEST CHANGES/BLOCK}
### Issues Found
| Category | Count |
|----------|-------|
| Critical | {N} |
| Important | {N} |
| Suggestions | {N} |
### Validation
| Check | Result |
|-------|--------|
| Type Check | {PASS/FAIL} |
| Lint | {PASS/FAIL} |
| Tests | {PASS/FAIL} |
| Build | {PASS/FAIL} |
### Artifacts
- Report: `{expanded absolute path to $PRP_DIR/reviews/pr-{NUMBER}-review.md}`
- PR Comment: {comment_url}
### Next Steps
{Based on recommendation:}
- APPROVE: "PR is ready for merge"
- REQUEST CHANGES: "Author should address {N} Important issues"
- BLOCK: "Fundamental issues need resolution before proceeding"Understand before judging. Read full context, not just the diff.
Be specific. "This could be better" is useless. "Use execFile instead of exec to prevent command injection at line 45" is helpful.
Prioritize. Not everything is critical. Use the categories honestly.
Be constructive. Offer solutions, not just problems.
Acknowledge good work. If something is done well, say so.
Run validation. Don't skip automated checks.
Check patterns. Read existing similar code to understand expectations.
Think about edge cases. What happens with null, empty, very large, concurrent?
Check implementation report. Documented deviations are intentional, not issues.
1142738
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.