From custom-reviewer
Review code changes by orchestrating specialist reviewer subagents. Supports two scopes — `working` (uncommitted changes in the working tree) and `branch` (PR-style, base branch → current HEAD, optionally including uncommitted work). Use when the user asks to review the working tree, review the current diff, run a code review, review before committing, or review a branch/PR against a base. Builds a diff file for the chosen scope, fans out to the `reviewer` subagent once per active specialist review context, then returns a consolidated summary.
How this skill is triggered — by the user, by Claude, or both
Slash command
/custom-reviewer:code-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Orchestrates a multi-perspective review of a code diff. Build a diff for the requested scope, spawn one reviewer subagent per active specialist context in parallel, and return a consolidated summary. For review of plan/spec documents, use the `plan-review` skill instead.
Orchestrates a multi-perspective review of a code diff. Build a diff for the requested scope, spawn one reviewer subagent per active specialist context in parallel, and return a consolidated summary. For review of plan/spec documents, use the plan-review skill instead.
| Mode | What it diffs |
|---|---|
working | Uncommitted changes (staged + unstaged against HEAD). |
branch | merge-base(<base>, HEAD)..HEAD — PR-style. Working-tree changes, if any, are appended. |
Auto-selection (when the user doesn't specify a mode): the helper script decides. If HEAD == resolved base and the tree is dirty → working; if HEAD differs from base → branch; else stop with "nothing to review".
Base branch resolution for branch mode, in order: user --base → upstream (@{u}) → origin/HEAD → origin/main / origin/master / main / master. If none, ask the user.
| Specialist | Review context |
|---|---|
| architect | @${CLAUDE_PLUGIN_ROOT}/context/review-architect.md |
| comment | @${CLAUDE_PLUGIN_ROOT}/context/review-comment.md |
| simplification | @${CLAUDE_PLUGIN_ROOT}/context/review-simplification.md |
| test-coverage | @${CLAUDE_PLUGIN_ROOT}/context/review-test-coverage.md |
A context file that is empty or missing means the specialist is not yet ready — skip it. Add a new row here when a new review-*.md context is authored; no other edits are needed.
The reviewer subagent (@${CLAUDE_PLUGIN_ROOT}/agents/reviewer.md) reads any @-referenced documents inside a context file itself, so this skill only needs to point it at the context.
Build the diff. From the target repo root, run:
${CLAUDE_PLUGIN_ROOT}/skills/code-review/scripts/build_diff.sh --mode <working|branch|auto> [--base <ref>] [-- <pathspec>...]
The script writes the diff to <target-repo>/.claude/tmp/code-review-<timestamp>.diff and prints DIFF_PATH=, MODE=, and (for branch mode) BASE= on stdout. Exit code 2 means "nothing to review" — stop and report that back.
Enumerate active specialists. For every row in the Available Specialists table, resolve the @${CLAUDE_PLUGIN_ROOT}/... reference and confirm the context file exists and is non-empty. Build the list of active specialists.
Fan out in parallel. In a single assistant message, emit one Agent tool call per active specialist. The reviewer agent is file-based (not a registered subagent_type), so use subagent_type: "general-purpose" and instruct the agent to follow the reviewer contract exactly:
description: "<specialist> review"
subagent_type: "general-purpose"
prompt: |
Follow the instructions in @${CLAUDE_PLUGIN_ROOT}/agents/reviewer.md exactly.
Diff file: <absolute DIFF_PATH from build_diff.sh>
Review context: @${CLAUDE_PLUGIN_ROOT}/context/review-<specialist>.md
Output must match the reviewer template verbatim.
Collect outputs. Each reviewer returns a Markdown block in the template from @${CLAUDE_PLUGIN_ROOT}/agents/reviewer.md. Do not alter individual outputs.
Consolidate and report. Before emitting, deduplicate overlapping findings. Two findings overlap when they describe the same underlying problem at the same (or adjacent, within ~2 lines) location — e.g. architect and comment both flagging a misleading docstring. For each overlap cluster:
comment; SOLID/DRY/KISS/YAGNI/boundary issues → architect; untested public behavior / missing regression tests → test-coverage).(also flagged by <specialist>[, …]).Then emit the final summary in this exact shape:
# Code Review Summary
**Mode:** <working | branch (base=<ref>)> • **Diff:** <DIFF_PATH> • **Specialists:** architect[, …] • **Overall Verdict:** APPROVE | REQUEST CHANGES
## Consolidated Findings
### Critical
- [<perspective>] file:line — … [(also flagged by <specialist>)]
### Important
- [<perspective>] file:line — … [(also flagged by <specialist>)]
### Suggestions
- [<perspective>] file:line — … [(also flagged by <specialist>)]
Overall verdict = REQUEST CHANGES if any specialist returned REQUEST CHANGES or reported a Critical finding; otherwise APPROVE.
Agent calls), never sequentially.file:line inside the diff.To add a new perspective: author @${CLAUDE_PLUGIN_ROOT}/context/review-<name>.md and add a row to the Available Specialists table above. The reviewer agent does not need to change.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub kimharry99/ai-agent-plugins --plugin custom-reviewer