From winrey-toolkit
Use when code changes need iterative multi-round review until no Critical or Important issues remain, with isolated independent reviewers, verification of findings, and parallel review after fixes
How this skill is triggered — by the user, by Claude, or both
Slash command
/winrey-toolkit:review-loopThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Iterative code review with isolated subagents. Loops until clean.
Iterative code review with isolated subagents. Loops until clean.
Dispatch independent reviewer subagents → screen and verify findings → fix confirmed issues → parallel dual-path re-review (fix diff + full review) → repeat until no Critical or Important issues remain.
Each reviewer is fully isolated: no prior review conclusions, no conversation history, no knowledge of previous fixes. Only the round number and diff range are provided.
requesting-code-review) isn't sufficientDon't use for:
requesting-code-review insteaddigraph review_loop {
"Determine diff range\nand reviewer count" [shape=box];
"Dispatch 1~N reviewer\nsubagents (isolated)" [shape=box];
"Collect results" [shape=box];
"Screen each issue" [shape=box];
"Issue clearly valid?" [shape=diamond];
"Add to fix list" [shape=box];
"Issue clearly false?" [shape=diamond];
"Skip with reason" [shape=box];
"Dispatch verifier\nsubagent" [shape=box];
"Any Important+\nissues?" [shape=diamond];
"PASS" [shape=doublecircle];
"Report round\nsummary to user" [shape=box];
"Fix issues" [shape=box];
"Parallel dual-path\nreview" [shape=box];
"Merge and deduplicate\nresults" [shape=box];
"Exceeded MAX_ROUNDS?" [shape=diamond];
"STOP: Pause, ask user" [shape=octagon, style=filled, fillcolor=red, fontcolor=white];
"Determine diff range\nand reviewer count" -> "Dispatch 1~N reviewer\nsubagents (isolated)";
"Dispatch 1~N reviewer\nsubagents (isolated)" -> "Collect results";
"Collect results" -> "Screen each issue";
"Screen each issue" -> "Issue clearly valid?";
"Issue clearly valid?" -> "Add to fix list" [label="yes"];
"Issue clearly valid?" -> "Issue clearly false?" [label="no"];
"Issue clearly false?" -> "Skip with reason" [label="yes"];
"Issue clearly false?" -> "Dispatch verifier\nsubagent" [label="uncertain"];
"Add to fix list" -> "Any Important+\nissues?";
"Skip with reason" -> "Any Important+\nissues?";
"Dispatch verifier\nsubagent" -> "Any Important+\nissues?";
"Any Important+\nissues?" -> "Report round\nsummary to user" [label="yes"];
"Any Important+\nissues?" -> "PASS" [label="no"];
"Report round\nsummary to user" -> "Exceeded MAX_ROUNDS?";
"Exceeded MAX_ROUNDS?" -> "STOP: Pause, ask user" [label="yes"];
"Exceeded MAX_ROUNDS?" -> "Fix issues" [label="no"];
"Fix issues" -> "Parallel dual-path\nreview";
"Parallel dual-path\nreview" -> "Merge and deduplicate\nresults";
"Merge and deduplicate\nresults" -> "Screen each issue";
}
All optional — infer from context:
| Parameter | Default | Description |
|---|---|---|
| BASE_SHA | Auto-inferred | Review start point |
| HEAD_SHA | HEAD | Review end point |
| DESCRIPTION | From git log | Brief change description |
| PLAN_OR_REQUIREMENTS | From context | Spec or requirements doc |
| MAX_ROUNDS | 5 | Max rounds before pausing |
Auto-inference:
Assess change scope with git diff --stat:
| Scope | Reviewers | Example focus split |
|---|---|---|
| Small (<100 lines, 1-2 files) | 1 | Full coverage |
| Medium (100-500 lines, multi-file) | 2 | A: logic/security/edge; B: architecture/maintainability |
| Large (>500 lines, cross-module) | 2-3 | A: logic/security; B: architecture/patterns; C: spec/tests |
Adapt focus areas to code characteristics. Database-heavy → SQL injection/transactions reviewer. UI-heavy → accessibility/UX reviewer.
For each reviewer, fill reviewer-prompt.md template and dispatch via Agent tool:
requesting-code-review, code-reviewer agents) and reference their output format conventions to keep reviewer output consistent with project normsYou MUST dispatch subagents. Do NOT review the code yourself. Even for 1 reviewer on a small diff, dispatch a subagent. The controller's job is to coordinate, screen, and fix — not to review. Reviewing your own code (or code you just read) defeats the isolation principle. If you catch yourself thinking "I'll just review it myself, it's small" — that's the exact rationalization this rule prevents.
For each issue reported by any reviewer:
verifier-prompt.md:
Multi-reviewer dedup: Same file:line with same issue type → merge, take higher severity.
After screening, report with full issue details:
## Round N Review
### Issue Details
| # | Level | Description | Decision | Reason |
|---|-------|-------------|----------|--------|
| 1 | Critical | ... | Fix | ... |
| 2 | Important | ... | Fix | ... |
| 3 | Important | ... | Rejected | False positive: ... |
| 4 | Minor | ... | Verified → Fix | Verifier confirmed |
| 5 | Minor | ... | Skipped | Non-blocking, cosmetic |
Decision values: Fix / Rejected / Verified → Fix / Verified → Rejected / Skipped
### Summary
- Issues found: X (Critical: a, Important: b, Minor: c)
- Confirmed to fix: Y, Rejected: Z
- Status: continuing / passed / paused at limit
### Convergence Trend (Round 2+)
- Round 1: 5 issues (C:1 I:3 M:1) → Round 2: 2 issues (C:0 I:1 M:1) → ...
- Trend: converging / stable / diverging
- If diverging or stable after 2+ rounds: note possible cause and suggest strategy adjustment
Convergence rules:
If no Important+ issues → report and exit (PASS).
Choose strategy based on issue characteristics:
Fixer subagents receive: issue description, file paths, project conventions, concrete fix suggestion from reviewer. They commit their fixes.
After fixes, dispatch two review paths in parallel:
Path A — Fix diff review:
fix-reviewer-prompt.mdPath B — Full review (new round):
reviewer-prompt.md (same count logic as Step 1)Both paths return results → merge and deduplicate → back to Step 3.
Pass condition: No Critical or Important issues after screening. Minor issues listed but don't block.
Max rounds (default 5): After MAX_ROUNDS cycles, pause and present to user:
Ask user when:
## Review Loop Result
### Convergence Summary
- Round 1: X issues (C:a I:b M:c) → Round 2: Y issues (C:d I:e M:f) → ...
- Trend: converging / stable / diverging
- Important+ trajectory: [count per round, e.g. 4 → 2 → 0]
### Result
- Total rounds: N
- Status: Passed / User terminated
- Total issues found: X, Total fixed: Y, Total rejected: Z
- Remaining Minor issues: (list, optional fix)
| What | Rule |
|---|---|
| Prior review conclusions | Never passed to next round's reviewers |
| Prior fix content | Full reviewers don't know; fix reviewer only sees diff range |
| Conversation history | Not inherited; every subagent starts fresh |
| Round info | Only round number ("Round N") — no history details |
| Controller opinions | Never shared with verifiers |
Why isolation matters: Without it, later-round reviewers anchor on earlier findings and miss new issues.
| Mistake | Fix |
|---|---|
| Passing prior review results to new reviewer | Only provide round number and diff range |
| Skipping verification for "obvious" issues | If unsure, dispatch verifier — it's cheap |
| Fixing all issues yourself instead of parallelizing | Multiple independent issues → parallel fixer subagents |
| Running only full review after fix (no fix-diff review) | Always dual-path: fix diff + full review in parallel |
| Telling fix reviewer what the original issues were | Causes confirmation bias — let them judge independently |
| Batching all rounds before reporting to user | Report after EVERY round — user needs visibility |
| Omitting issues from review output | Reviewers MUST list ALL issues exhaustively |
| Stopping loop after one clean round without verifying | If fixes were made, dual-path review IS the verification |
| Reviewing the code yourself instead of dispatching subagent | Controller coordinates — NEVER reviews. Even for small diffs, dispatch a subagent |
| Skill | Relationship |
|---|---|
requesting-code-review | Complementary — single-shot vs. iterative loop |
subagent-driven-development | Can invoke review-loop as review step per task |
receiving-code-review | Controller applies its verify-before-act principles |
verification-before-completion | Use after review-loop passes for final check |
Provides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub winrey/claude-code-toolkit --plugin winrey-toolkit