/review:reviewfrom review
Orchestrates comprehensive PR review combining analysis, code review, security, documentation, and risk-gated quality-review passes, posted as one unified GitHub comment. Use when asked to review a pull request, run a full review on a PR, or right after opening a PR that should be reviewed before merge — including when that instruction arrives as part of a larger task such as "open a PR and review it".
Ships in review. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Master orchestrator. Runs comprehensive PR review by coordinating specialized skills. Produces single unified review comment with all findings and recommendations.
Workflow:
Phase 1: Foundation
Phase 2: Quality Checks (parallel) 3. Security scanning (OWASP deepen) 4. Documentation validation (incl. light DX fold)
Phase 3: Synthesis 5. Combine all findings (bug-finder + QR passes + security + docs) 6. Determine merge recommendation (Clean Code blockers count as critical/high) 7. Post comprehensive review to PR
# Invoke with PR URL
> /review:review https://github.com/org/repo/pull/123
# The skill will automatically:
# - Analyze the PR
# - Run applicable reviews
# - Post results to PR
gh --version && gh auth status
If not authenticated:
Error: GitHub CLI not authenticated
Run: gh auth login
Or for enterprise: gh auth login --hostname <host>
PR_NUMBER=$(echo "$PR_URL" | grep -oE 'pull/[0-9]+' | grep -oE '[0-9]+')
SESSION_ID=$(uuidgen | tr '[:upper:]' '[:lower:]' | cut -d'-' -f1)
OUTPUT_DIR="/tmp/pr-review-${PR_NUMBER}-${SESSION_ID}"
mkdir -p "$OUTPUT_DIR" && chmod 700 "$OUTPUT_DIR"
echo "Session output directory: $OUTPUT_DIR" >&2
If PR URL not found, ask user for it.
Steps 7.5 and 8 run bundled scripts. A bare relative path resolves against the reviewed repo's working directory, not this plugin — the same trap called out in Step 3.1 — so resolve the root once, here.
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-}"
if [ ! -f "$PLUGIN_ROOT/scripts/review_formatter.py" ]; then
PLUGIN_ROOT="$(cd "${CLAUDE_SKILL_DIR:-.}/../.." 2>/dev/null && pwd)"
fi
[ -f "$PLUGIN_ROOT/scripts/review_formatter.py" ] \
|| echo "WARN: plugin scripts not found; Glob for review_formatter.py" >&2
If both variables are unset, Glob for **/scripts/review_formatter.py and use
that file's parent-of-parent.
gh pr diff "$PR_URL" > "$OUTPUT_DIR/pr.diff"
gh pr diff "$PR_URL" --name-only > "$OUTPUT_DIR/pr.files"
gh pr view "$PR_URL" --json number,title,url,body,baseRefName,headRefName,headRefOid,author,state,additions,deletions,files,commits \
> "$OUTPUT_DIR/pr-view.json"
Every pass reads these three files and fetches nothing itself. They are the
pass's inputs, read-only: passes run in parallel in one $OUTPUT_DIR, so a
pass that rewrote pr.diff would change the diff under every other pass
mid-read. A pass run standalone, with no pr.diff in its directory, fetches
its own.
If gh pr diff fails, stop — there is nothing to review.
Use Skill tool:
- skill: "review:analyze"
- args: "<PR_URL> <OUTPUT_DIR>"
Wait for completion and read analysis:
Read tool: $OUTPUT_DIR/pr-analysis-<PR_NUMBER>.json
Store key findings:
primary_languagesecurity_sensitiveimpact_analysisrisk_class (array)If analysis fails: continue with limited info; note in final review.
Spawn 2 independent bug-finders in parallel with Task tool. Different models per pass — one model twice shares one set of blind spots, so a finding both models agree on is far stronger signal:
| Pass | model | Model ID | Role |
|---|---|---|---|
| 1 | opus | claude-opus-4-8 | Deepest reasoning — subtle logic, races, security data-flow |
| 2 | sonnet | claude-sonnet-5 | Strong, different family — diversifies findings |
Each:
subagent_type: general-purposemodel: from table. Do not omit — an omitted model inherits the session model, collapsing both passes onto one.description: Bug hunter pass [1 opus / 2 sonnet]prompt: Bug-Finder Prompt below, with the contents of $OUTPUT_DIR/pr.diff as {{DIFF}} and the contents of references/anti-patterns.md as {{ANTI_PATTERNS}}.Read references/anti-patterns.md yourself and paste it in. These are raw Task prompts, not skill invocations — the subagents run with the reviewed repo as their working directory and cannot resolve a path in this skill.
A pass's prompt is its template with the placeholders filled — nothing else. Every pass reviews the diff cold: what another pass found, and what you suspect, stays out of the prompt. The QR, security and docs passes read the analysis JSON themselves; the bug-finders see only the diff. Two passes primed with the same hunch report the same hunch, and the "[Found by 2/2 models]" agreement in Step 5 stops meaning two independent reads.
You are a bug hunter. Find bugs that will crash production or create security vulnerabilities. Trace, don't scan.
## Anti-patterns
{{ANTI_PATTERNS}}
## Critical Checks
- **NPE / null-deref:** for every dereference, trace the variable's lifecycle (declared? assigned? set null in cleanup/error paths? nulled by another thread?). Show the full trace for each risk.
- **Resource leaks:** every opened resource (connection, stream, file, cursor) — is it closed on all paths, including exceptions?
- **Security:** trace every external input to dangerous sinks (SQL, HTML, shell, file paths, logs) without sanitization. Also flag hardcoded secrets, sensitive data in logs, missing auth checks.
- **Race conditions:** shared mutable state without synchronization; check-then-act gaps.
- **Concurrency (expanded):** deadlocks / lock ordering; TOCTOU (filesystem/authz); async cancellation / lost wakeups / unstructured concurrency; concurrent idempotency (handler unsafe under parallel retries; missing unique constraints); poison messages / missing DLQ isolation.
- **Control flow:** missing returns after cleanup/error handling, early exits that skip cleanup, unreachable code.
- **Architectural:** inconsistent patterns (mixing two APIs for one purpose), wrappers/utilities removed without justification.
- **Clean Code (blocking):** silent catch / swallowed errors, shared mutable globals, or craft issues that hit correctness/invariants — emit as critical/high, not nits, **regardless of module reach**. Blast radius sets critical-vs-high, not blocking-vs-not. Name the resolving refactoring (Fowler/Kerievsky) in `suggestion`. Style-only with no domain-language conflict → omit or nitpick.
## Output
Return a JSON array of findings, each: {"severity":"critical|high|medium","label":"issue|suggestion|nitpick|question|thought|praise","decoration":"blocking|non-blocking|if-minor","path":"exact/path","line":N,"title":"5-10 words","body":"explanation with lifecycle/data-flow trace","suggestion":"concrete fix","suggested_change":"exact replacement for lines start_line..line"}.
- `severity`: `critical` (crashes/security), `high` (fix soon), `medium` (fix later).
- `label`/`decoration` optional — omit for severity defaults (`critical`/`high` → `issue (blocking)`, `medium` → `suggestion (non-blocking)`).
- `path`/`line` required when mapped to diff (`line` = NEW-file line); add `start_line` for a multi-line range. Omit both for general findings.
- `suggested_change` posts as a GitHub suggested change — one click commits it to the branch. Emit it only when **every** condition holds: the fix is confined to the commented lines (no new import, no second call site, no cross-file edit); you can reproduce every line from `start_line` through `line` verbatim, indentation included, from the diff you were given; the whole range is inside the diff; and it is under ~10 lines. Otherwise omit it. It is the file's new text for that range — never a fragment, a `...` elision, or a diff with `+`/`-` markers. Always set `suggestion` as well; it is what the author reads when the range cannot be anchored.
- Wrap code refs in backticks; keep `body` to 1–2 terse sentences.
- After the JSON, add a 1-2 sentence summary. Focus on crashes and vulnerabilities, not style.
## Code to Review
{{DIFF}}
Merge (Step 5): group by path+line; prepend "[Found by 2/2 models]" when both passes agree; take highest severity.
Read shared/risk-class-routing.md. From risk_class, decide which of these skills to run:
| Gate | Skill |
|---|---|
domain ∈ risk_class | review:domain-architecture |
data or api ∈ risk_class | review:data-contracts |
ops or concurrency ∈ risk_class | review:ops-reliability |
| Large/mixed/CD/design signals | review:change-evolution |
For each selected skill, spawn a Task (prefer sonnet unless domain/architecture needs opus):
Use Task tool:
- subagent_type: "general-purpose"
- model: "sonnet" # use "opus" for domain-architecture when risk is high
- description: "QR pass <name>"
- prompt: |
Invoke Skill "review:<name>" with args "<PR_URL> <OUTPUT_DIR>".
Follow that skill exactly — it scopes its own anti-pattern slice.
Write $OUTPUT_DIR/<name>-<PR_NUMBER>.json. Return a one-line finding-count summary.
These invoke the skill, so they resolve its references themselves — unlike the bug-finders, they need nothing inlined.
If risk_class is empty, skip QR passes (bug-finder still runs).
Do not dispatch yet — Step 4's Tasks go out in the same message.
Use Task tool:
- subagent_type: "general-purpose"
- model: "sonnet"
- description: "Security scan (sonnet)"
- prompt: |
Invoke Skill "review:security-scan" with args "<PR_URL> <OUTPUT_DIR>".
Deepen OWASP authz/IDOR, business-logic abuse, SSRF, PII-in-logs per that
skill. Write security-scan-<PR_NUMBER>.json. One-line summary.
Use Task tool:
- subagent_type: "general-purpose"
- model: "haiku"
- description: "Docs drift check (haiku)"
- prompt: |
Invoke Skill "review:docs-drift" with args "<PR_URL> <OUTPUT_DIR>".
Include light DX fold (ADR/runbook/caller migration) per that skill.
Write docs-drift-<PR_NUMBER>.json. One-line summary.
Send every Step 3 and Step 4 Task in ONE message — 2 bug-finders, 0–4 QR passes, security-scan, docs-drift. They are independent and all read the same Step 1.4 capture. Collect in Step 5.
Wait for: bug-finder ×2, QR passes (if any), security-scan, docs-drift.
Parse:
$OUTPUT_DIR/pr-analysis-*.json — risk_class$OUTPUT_DIR/domain-architecture-*.json, data-contracts-*.json, ops-reliability-*.json, change-evolution-*.json — each findings array$OUTPUT_DIR/security-scan-*.json$OUTPUT_DIR/docs-drift-*.jsonBoth bug-finders return their findings in context, not on disk. Write the
merged array to $OUTPUT_DIR/bug-finder-<PR_NUMBER>.json as
{"findings": [...]} — Step 7.5 collects the ledger from these files, and a pass
with no file on disk is a pass whose findings /review:fix will never see.
IF (any finding carries decoration "blocking"):
RECOMMENDATION = "REQUEST CHANGES"
RATIONALE = "<N> blocking findings — <top 3 titles by priority stack>"
ELIF (missing_critical_docs) OR (security_sensitive === true):
RECOMMENDATION = "COMMENT"
RATIONALE = "Non-blocking findings; manual review required"
ELSE:
RECOMMENDATION = "COMMENT"
RATIONALE = "Review completed - findings noted for consideration"
A finding decorated (blocking) that yields a COMMENT verdict teaches the
author to ignore the decoration. One blocking finding is enough for
REQUEST CHANGES; counts and severity tiers only order the output.
Always default to COMMENT (never APPROVE) — human-in-the-loop.
risk_class. No inline findings.domain-architecture (omit if skipped/empty).data-contracts (omit if skipped/empty).ops-reliability (omit if skipped/empty).change-evolution (omit if skipped/empty).Set review_metadata.model to your model ID. Note bug-finder pass models in Code Review body. Set tool_version from .claude-plugin/plugin.json (do not hardcode).
Formatter applies <label> [decoration]: <subject>. Finding fields match bug-finder schema. Severity defaults per shared/severity-rubric.md. Clean Code and category 4 design quality → blocking regardless of module reach.
Carry each finding's suggested_change through to the section findings array
verbatim — the formatter renders it as a committable inline suggestion and drops
the prose remedy for that comment. QR, security and docs passes use the same
field; where one reports only prose (fix, remedy) and the diff gives you the
exact replacement for the mapped range, write suggested_change yourself under
the Bug-Finder Prompt's conditions. Where it does not, leave prose.
Do not invent the replacement from the finding's description. The author commits it with one click, so a suggestion reconstructed from memory lands as a broken commit under your name.
required_actionsBlocking design and craft dimensions mean most non-trivial PRs return
REQUEST CHANGES. Order required_actions by the taxonomy priority stack
(shared/quality-review-pr-review-taxonomy.md, "QR / Staff-style priority
stack"): intent → system fit → domain invariants → failure behavior →
contracts → test adequacy → design simplicity → security → maintainability →
craft.
List every blocking finding. Do not cap, summarize, or elide. The consumer may be an agent working the list to completion, so an omitted action is an unfixed finding. Ordering sets the sequence; it never sets the membership.
Each entry must be actionable on its own, without reading the rest of the review: name the path (and line, when mapped), the symptom, and the fix. For a craft or design finding, name the resolving refactoring.
{
"pr_url": "<FULL_PR_URL>",
"recommendation": "<REQUEST_CHANGES|COMMENT>",
"rationale": "<Brief summary from Step 6>",
"required_actions": ["<action1>"],
"optional_improvements": ["<suggestion1>"],
"sections": [
{"title": "Change Analysis", "summary_line": "...", "body": "..."},
{"title": "Code Review Results (2 Passes)", "summary_line": "...", "body": "...", "findings": []},
{"title": "Domain & Architecture", "summary_line": "...", "body": "...", "findings": []},
{"title": "Data & Contracts", "summary_line": "...", "body": "...", "findings": []},
{"title": "Ops & Reliability", "summary_line": "...", "body": "...", "findings": []},
{"title": "Change & Evolution", "summary_line": "...", "body": "...", "findings": []},
{"title": "Security Analysis", "summary_line": "...", "body": "...", "findings": []},
{"title": "Documentation Check", "summary_line": "...", "body": "..."}
],
"review_metadata": {
"tool_name": "review",
"review_title": "Review",
"tool_version": "<from plugin.json>",
"model": "<orchestrator model ID>"
}
}
Omit skipped/failed/empty QR sections. Formatter omits empty sections.
Write this JSON to $OUTPUT_DIR/review-payload.json — Steps 7.5 and 8 both
read it from there.
Steps 1-7 wrote everything to $OUTPUT_DIR, which is a /tmp dir keyed on a
random session id. A later session cannot find it, so the findings — and the
refactorings they name — die with this run. Write them somewhere durable instead,
so /review:fix can work the list to completion.
LEDGER=$(python3 "$PLUGIN_ROOT/scripts/findings_ledger.py" build \
--pr-url "$PR_URL" \
--analysis "$OUTPUT_DIR/pr-analysis-${PR_NUMBER}.json" \
--payload "$OUTPUT_DIR/review-payload.json" \
--run "$SESSION_ID" \
$(for f in "$OUTPUT_DIR"/*-${PR_NUMBER}.json; do
case "$(basename "$f")" in
pr-analysis-*) continue ;;
esac
printf ' --source %s=%s' "$(basename "$f" | sed "s/-${PR_NUMBER}\.json$//")" "$f"
done) \
| cut -f1)
The script derives ~/.claude/review-findings/<owner>__<repo>/pr-<N>.json from
the PR URL, normalizes all four finding shapes into one schema, and copies the
test_setup / build_system / languages slice of the analysis into the ledger.
That slice is copied rather than referenced because $OUTPUT_DIR is gone by the
time fix runs.
The ledger holds source excerpts from security findings, so the script writes it
0600 under a 0700 directory and replaces any reported credential with a
digest. Do not copy ledger contents into a log line or a PR comment.
If this step fails, the review is still complete — report the failure and move
on. The ledger is an optimization for fix, not part of the review verdict.
cat "$OUTPUT_DIR/review-payload.json" \
| python3 "$PLUGIN_ROOT/scripts/review_formatter.py" --post
On failure, --dry-run and show the user.
Comprehensive Review Complete
Summary:
- Languages: <primary>
- Risk classes: <list or none>
- Code Review: <X Critical, Y High, Z Medium>
- QR passes: <which ran>
- Security: <counts>
- Documentation: <status>
- Recommendation: <REQUEST CHANGES | COMMENT>
View full review: <PR_URL>
$OUTPUT_DIRdomain-architecture, data-contracts, ops-reliability, change-evolution) + security-scan + docs-driftskills/<pass>/references/anti-patterns.md, so it can address no otherWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ozzycodes2/claudellum --plugin review11 skills in this plugin
/analyzeAnalyze PR changes to detect languages, frameworks, test setup, impact areas, and risk classes. Use when starting a PR review and you need to understand what changed before deeper analysis./change-evolutionReviews PR diffs for CD readiness, reversibility, and design-quality risks such as YAGNI, deep modules, and complexity budget. Use when a PR is large, mixes refactor with behavior, or introduces flags/migrations/stranglers./codegenGenerates simple tests, docstrings, and documentation updates for PR changes. Use when reviewing a PR and you want draft tests, docstrings, or CHANGELOG entries to fill the gaps it surfaced (human review required before committing)./data-contractsReviews PR diffs for data consistency, schema/migration safety, and API/event contract compatibility. Use when analyze risk_class includes data or api, or when a PR changes schemas, migrations, public APIs, or event payloads./docs-driftDetect documentation drift in a repo's docs/ folder — ADRs, glossaries, API specs (OpenAPI), rendered artifacts, READMEs, code comments, runbooks, and caller-migration notes — that has fallen out of sync with the code a PR changes, and flag documentation-completeness gaps (missing CHANGELOG/README/ docstring updates). Use when reviewing a PR to verify docs still describe the CURRENT model: stale comments describing a removed mechanism, docs asserting a superseded design, a rendered file lagging its source, ADR index rows that don't reflect an amendment or supersede, env/config docs that name the wrong app or variable, missing runbooks for ops-facing changes, or missing caller migration notes for breaking APIs. Use even when the PR doesn't obviously touch docs — code changes silently invalidate docs elsewhere in the tree.
/domain-architectureReviews PR diffs for domain model integrity, architecture dependency rules, and team/org boundary risks. Use when analyze risk_class includes domain, or when a PR crosses bounded contexts, ownership, or layering boundaries.