with one click
rb-review
// Use when you need code review of changed files with parallel specialist agents for correctness, security, testing, Active Record, Grape, and Sidekiq boundaries. Use after implementation before commit or PR.
// Use when you need code review of changed files with parallel specialist agents for correctness, security, testing, Active Record, Grape, and Sidekiq boundaries. Use after implementation before commit or PR.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | rb:review |
| description | Use when you need code review of changed files with parallel specialist agents for correctness, security, testing, Active Record, Grape, and Sidekiq boundaries. Use after implementation before commit or PR. |
| when_to_use | Triggers: "review my changes", "code review", "review before commit", "check this PR", "review for security". Does NOT handle: fixing code, full project audit, planning, verification/test runs. |
| argument-hint | [test|security|sidekiq|deploy|iron-laws|all] |
| effort | xhigh |
Review changed code by spawning specialist agents. Review is read-only - never fix during review.
Reviews catch issues before they reach production. Each specialist focuses on their domain:
Resolve the base ref via ${CLAUDE_PLUGIN_ROOT}/bin/resolve-base-ref,
compute $MERGE_BASE, then capture in ONE shell session:
$CHANGED_FILES (file list, --name-only --diff-filter=ACMR)$DIFF_STAT (git diff --stat)Pass $CHANGED_FILES, $BASE_REF, $MERGE_BASE, and $DIFF_STAT to
every spawned reviewer. Reviewers scope analysis to $CHANGED_FILES
and NEVER scan unchanged files.
Reviewers own diff strategy.
For exact shell commands + reviewer diff discipline, see
${CLAUDE_SKILL_DIR}/references/review-playbook.md ยง "Diff Collection".
/rb:review spawns specialist agents directly from the main session in
parallel. Subagents are leaf workers โ they return findings; they do not
spawn further agents.
MUST spawn in foreground. Never pass run_in_background: true on
any Agent call. Use parallel via multiple Agent tool calls in a single
message.
review-slug. Resolve BASE_REF via
${CLAUDE_PLUGIN_ROOT}/bin/resolve-base-ref.${CLAUDE_PLUGIN_ROOT}/bin/manifest-update prepare-run --skill=rb:review --slug="$REVIEW_SLUG" --base-ref="$BASE_REF" --agents=<csv-of-reviewer-slugs>.
Captures stdout as $MANIFEST (absolute manifest path). Helper
archives any prior manifest, computes datesuffix, agent paths,
consolidated path, git pins; writes fresh manifest atomically.${CLAUDE_PLUGIN_ROOT}/bin/manifest-update prepare-respawn "$MANIFEST".
Rotates existing files at manifest-tracked agent paths to
<agent-slug>.stale-<rename-ts>.md.status: in-flight via
printf '{"agents":{"%s":{"status":"in-flight"}}}\n' "$AGENT_SLUG" | ${CLAUDE_PLUGIN_ROOT}/bin/manifest-update patch "$MANIFEST".${CLAUDE_PLUGIN_ROOT}/bin/manifest-update spawn-paths "$MANIFEST"
(tab-separated agent_slug<TAB>absolute_path). Pass each absolute
path verbatim in the spawn prompt.status
field with its recovery-state value (artifact |
stub-replaced | recovered-from-return | stub-no-output).${CLAUDE_PLUGIN_ROOT}/bin/manifest-update field "$MANIFEST" consolidated_path.
Write the consolidated review to that path.status: complete.--skill + --slug +
--agents + datesuffix.manifest-update spawn-paths "$MANIFEST".prepare-respawn..claude/reviews/{review-slug}/RUN-CURRENT.json.${CLAUDE_PLUGIN_ROOT}/references/run-manifest.md.${CLAUDE_PLUGIN_ROOT}/bin/manifest-update
(prepare-run, field, spawn-paths, patch, prepare-respawn,
archive, resume-check, status, init). NEVER call raw mv,
cp, rm, or jq -i against manifest or per-agent artifact paths.prepare-run computes manifest path, datesuffix, agent paths,
consolidated path, and (for review) git pins; archives any prior
manifest; inits fresh in a single call.Classify the review before spawning agents. Tier = max(file_tier, loc_tier).
Critical-path files force escalation regardless of count or LOC.
| Tier | Files Changed | Diff LOC | Depth | Agents |
|---|---|---|---|---|
| Simple | 1-3 | โค 200 | Lean: correctness + security only | 2 |
| Medium | 4-10 | 201-1000 | Core + conditional by file type | 4-8 |
| Complex | 11+ | > 1000 | All relevant reviewers, detailed output | 8-11 |
Compute DIFF_LOC = git diff --shortstat "$MERGE_BASE"...HEAD | awk '{n=$4+$6} END{print n+0}'.
Columns 4 + 6 are insertions + deletions. END{print n+0} emits 0
on empty diff. Range matches $DIFF_STAT and $CHANGED_FILES.
Log the classification in the consolidated review header:
**Complexity**: Simple (2 files, 87 LOC) | Medium (7 files, 412 LOC) | Complex (15 files, 1834 LOC, escalated: db/migrate)
Spawn from main session in single parallel block based on tier + file patterns:
ruby-reviewer - Ruby idioms, syntax, correctnesssecurity-analyzer - Security vulnerabilitiestesting-reviewer - Test coverage and qualityverification-runner - Automated checks passiron-law-judge - When diff is risky or touches critical pathssidekiq-specialist - When workers or jobs changeddeployment-validator - When container or deploy config changedrails-architect - When service layer, Grape APIs, or architecture changedruby-runtime-advisor - When performance, memory, or hot paths changeddata-integrity-reviewer - When models, constraints, or transactions changedmigration-safety-reviewer - When migrations add columns or modify tablesWhen ANY changed file matches a pattern below, force Complex tier and add the matching specialist to the spawn list (in addition to base tier):
| File pattern matched | Add specialist |
|---|---|
**/auth/**, **/authentication/**, **/authorization/** | iron-law-judge (security-analyzer always already core) |
**/payment/**, **/billing/**, **/checkout/** | iron-law-judge + data-integrity-reviewer |
db/migrate/** | migration-safety-reviewer + data-integrity-reviewer |
config/routes* | rails-architect |
config/initializers/devise* | iron-law-judge (security-analyzer already core) |
**/middleware/** | rails-architect (security-analyzer already core) |
Every Agent() call must include in its prompt:
$CHANGED_FILES (the diff manifest from main session)$BASE_REF (from resolve-base-ref output)$MERGE_BASE (from git merge-base HEAD "$BASE_REF")$DIFF_STAT (from git diff --stat)manifest-update spawn-paths "$MANIFEST" (one row per agent slug).
Worker MUST use the exact path passed to it โ do NOT invent,
modify, shorten, or extension-change the filename.file:line, Severity (Critical|Warning|Info),
Confidence (HIGH|MEDIUM|LOW), description, current code, suggested
code. Synthesis maps Critical/Warning/Info into consolidated
BLOCKER/WARNING/SUGGESTION per playbook ยง "Worker Severity Mapping".For full briefing template (verbatim text to use in prompts), see
${CLAUDE_SKILL_DIR}/references/review-playbook.md ยง "Worker Briefing Template".
/rb:review - findings only, fixes laterCritical | Warning | Info; synthesis maps to BLOCKER | WARNING | SUGGESTION per playbook ยง "Worker Severity Mapping"Most review findings are code-local and can be justified directly from the diff.
Use output-verifier only when the review depends on external evidence,
versioned sources, or claims that need explicit verification, for example:
If the finding is already proven directly by changed code, line references in the review itself are enough and no provenance sidecar is needed.
When used:
output-verifier against the draft.claude/reviews/{review-slug}-{datesuffix}.provenance.mdUse the shared provenance contract:
${CLAUDE_PLUGIN_ROOT}/references/output-verification/provenance-template.mdDetailed reviewer focus areas, file-type checklists, and common Ruby
anti-patterns live in
${CLAUDE_SKILL_DIR}/references/review-playbook.md.
Every /rb:review run produces two artifact layers:
.claude/reviews/{agent-slug}/{review-slug}-{datesuffix}.md.claude/reviews/{review-slug}-{datesuffix}.mdoutput-verifier is used:
.claude/reviews/{review-slug}-{datesuffix}.provenance.md.claude/reviews/{review-slug}/RUN-CURRENT.json.claude/reviews/{review-slug}/RUN-HISTORY.jsonlRules:
PASS, files reviewed, and why no findings were raised.claude/plans/...Read ${CLAUDE_SKILL_DIR}/references/review-playbook.md ยง "Synthesis
Procedure" before writing the consolidated artifact. Apply the 5-step
procedure verbatim.
Output path:
${CLAUDE_PLUGIN_ROOT}/bin/manifest-update field "$MANIFEST" consolidated_path.
For each manifest entry:
CHECK pause signature first per
${CLAUDE_PLUGIN_ROOT}/references/agent-resume.md. If matched,
apply that protocol (resume via SendMessage if available, else
mark stub-no-output). The state machine below applies ONLY after
the resume attempt resolves or is skipped.
STAT the expected path. Apply the state machine:
size_bytes >= 1000 โ trust. Do NOT overwrite.size_bytes < 1000, return text substantially larger AND
parses as findings โ replace stub with extracted findings.size_bytes < 1000, return text empty/unusable โ keep
stub, treat as coverage gap (stub-no-output).# {agent-slug} โ recovery stub and body Run produced no artifact and no usable return text. Reviewer coverage gap.NEVER copy or symlink prior-run artifacts to the current-run path. Each run owns a per-second-unique path. Decide from the filesystem; ignore Agent return text denial claims. Never re-spawn.
Full table + manifest status mapping:
${CLAUDE_SKILL_DIR}/references/review-playbook.md ยง "Artifact Recovery".
Every finding MUST include a confidence label
(HIGH | MEDIUM | LOW). Level definitions, examples, and
deduplication strategy live in
${CLAUDE_SKILL_DIR}/references/review-playbook.md
ยง "Confidence Levels".
Write artifacts to:
.claude/reviews/{agent-slug}/{review-slug}-{datesuffix}.md for each reviewer.claude/reviews/{review-slug}-{datesuffix}.md for the synthesized outputreview-slug must be filesystem-safe:
/ and whitespace with -[a-z0-9._-]-Use the current branch name only after slugifying it. If the branch name is not meaningful, derive the slug from the reviewed diff or user-supplied target.
Emit exactly one verdict from the canonical 4-set:
PASSPASS WITH WARNINGSREQUIRES CHANGESBLOCKEDEmit each verdict VERBATIM. Do NOT abbreviate, hyphenate, paraphrase, or compress:
| Reject | Use |
|---|---|
PASS WARN, PASS-WITH-WARNS, PWW | PASS WITH WARNINGS |
BLOCK, BLK, BLOCKER (verdict, not severity tag) | BLOCKED |
REQ-CHANGES, RC | REQUIRES CHANGES (only when actual test-coverage gap on NEW public behavior; see playbook ยง "Verdict Decision Rules") |
OK, LGTM, Approved | PASS |
Needs fixes does NOT auto-route to REQUIRES CHANGES โ infer per
worker counts (Critical โ BLOCKED; else Warning โ PASS WITH WARNINGS;
else PASS).
Use canonical strings only for manifest status enum (pending,
in-flight, artifact, stub-replaced, recovered-from-return,
stub-no-output, complete) and severity buckets (BLOCKER,
WARNING, SUGGESTION). The synthesizing skill body owns this
discipline; bin/manifest-update does not validate enums on patch.
Decision rules + chat scripts:
${CLAUDE_SKILL_DIR}/references/review-playbook.md
ยง "Verdict Decision Rules" + ยง "Review Outcomes (chat scripts)".
Review happens after /rb:work and before commit. Standard order:
/rb:plan โ /rb:work โ /rb:review โ /rb:triage (if issues) โ commit/PR.
Reviews can also be triggered standalone for existing code audits.
When a finding cites a sidecar, read the sidecar's trust_state (see
${CLAUDE_PLUGIN_ROOT}/references/output-verification/trust-states.md):
conflicted: escalate severity by one level.missing: tag the finding [unverified]; do not gate merge.weak: keep severity; add a provenance note.clean: proceed silently..claude/reviews/<agent-slug>/<review-slug>-<datesuffix>.md.
Consolidated at .claude/reviews/<review-slug>-<datesuffix>.md.
Consolidation reads per-agent. Downstream (compound, triage,
follow-up) reads consolidated only.base_ref at fanout start. User
rebase mid-review โ recovery state mismatch. Re-fanout if base shifts.stub-no-output (agent ran but
produced empty file) is NOT pending (agent never ran). Distinguish
before retry vs respawn.**Counts:** line. Reviewers MUST emit Counts: first.
Missing line breaks consolidator severity-bucket counts.| Need | Reference |
|---|---|
| reviewer focus areas, file-type checklists, anti-patterns, severity, verdict, mandatory finding table, chat scripts, deduplication | ${CLAUDE_SKILL_DIR}/references/review-playbook.md |
| review-slug derivation + filesystem-safe slug rules | ${CLAUDE_SKILL_DIR}/references/conventions.md |
| worked example of consolidated review output | ${CLAUDE_SKILL_DIR}/references/example-review.md |
| production-incident review context (when review covers a live failure) | ${CLAUDE_PLUGIN_ROOT}/skills/investigate/references/incident-playbook.md |