Unified Review
Run review in two phases: review phase then optional fix phase. $ARGUMENTS
Parameters
Required
scopedetermines review target:scope=branch→ review branch diff against detected basescope=changes→ review uncommitted changes (git diff+git diff --cached)scope=prorscope=pr:<id|#id|url>→ review PR diff
If scope missing or invalid, ask the user.
Optional
- Coverage parameter decides reviewer set:
full→ 7 reviewerspartialorhalf→ 4 reviewers
Default coverage: full
autofixdecides whether fix phase runs:- explicit
autofixorautofix=true→ force ON - explicit
autofix=false→ force OFF - omitted → auto mode (ON when total findings
< 10, otherwise OFF)
- explicit
Reviewer Sets
Full (7)
mp-reviewer-code-qualitymp-reviewer-best-practicesmp-reviewer-spec-alignmentmp-reviewer-test-qualitymp-reviewer-securitymp-reviewer-performancemp-reviewer-error-handling
Partial/Half (4)
mp-reviewer-code-qualitymp-reviewer-best-practicesmp-reviewer-spec-alignmentmp-reviewer-test-quality
Workflow
Step 1: Resolve scope
Branch scope
- Determine current branch (
git branch --show-current) - Run
node ${CLAUDE_PLUGIN_ROOT}/scripts/detect-base-branch.js [explicit-branch](pass user hint as arg if given). It checksorigin/<branch>existence and commits-ahead fordev > develop > main > masterand prints one branch name to stdout (falls back tomain). - Use the printed branch as
<base> - Build diff scope:
<base>...HEADusinggit diff <base>...HEAD
Changes scope
- Collect
git diffandgit diff --cached - If both empty, report "no changes" and stop
PR scope
- Resolve PR from
scope=pr:<...>; otherwise use current branch PR - Fetch metadata + diff (
gh pr view,gh pr diff, draft allowed) - If PR cannot be resolved, report blocker and stop
Step 2: Review phase
- Select reviewer set from coverage param
- Spawn reviewers in parallel with resolved scope context:
- diff body/scope
- changed files
- original task/spec text when available
- stack/conventions context
- Accept high-confidence findings only
- Merge findings and classify exactly in this order:
- Critical
- Important
- Minor (optional)
- Write report only if findings exist into
REVIEW.md
Report shape:
- Actionable Checklist
- Critical items with location, why, concrete fix
- Important items with location, why, concrete fix
- Nice-to-Have
- Minor observations
If no findings, skip the report file and return a clean summary in conversation.
Step 3: Autofix decision
Compute total issues from merged findings (Critical + Important + Minor).
- If user explicitly set
autofixparam, honor it always. - If omitted:
- total findings
< 10→ autofix ON - total findings
>= 10→ autofix OFF
- total findings
Step 4: Fix phase (conditional)
Run only when autofix ON and at least one finding exists.
Analyze each finding and determine the concrete fix — identify exact file paths, lines, and the specific code change needed. Then spawn mp-executor sub-agent with pre-analyzed fix instructions:
- concrete fix per finding: file path, current code, and exact change to apply (the executor applies — it does not diagnose)
- resolved scope summary (branch/changes/pr)
- report path (
REVIEW.md) - requirement: fix only in-scope findings
After executor completes, run the same selected reviewer set again on updated scope.
- If issues remain, append
## Post-Fix Reviewsection to the same report and repeat Fix Phase up to 3 iterations or until clean - If no issues remain, append
## Post-Fix Reviewwith clean status
Behavior Contract
- Read-only when fix phase does not run
- Source edits only in fix phase via
mp-executor - No commits
- No GitHub comments/reviews
Output
Mode: review
Scope: [branch|changes|pr]
Coverage: [full|partial]
Autofix: [true|false|auto-resolved]
Findings:
- total: [N]
- critical: [N]
- important: [N]
- minor: [N]
Report:
- [path or "none"]
Fix Step:
- executed: [yes/no]
- result: [clean/remaining issues/not requested]