Review-fix iteration loop -- dispatches review agents then review-fixer, iterating up to 5 times with early termination on zero issues
Iterates through parallel code reviews and targeted fixes until all issues are resolved or max cycles reached.
npx claudepluginhub kenkenmain/ken-cc-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Dispatch 5 parallel review agents, aggregate their findings, then dispatch a fixer agent to resolve ALL issues (including info-level). Iterate up to 5 times. Early termination happens only when the review phase finds zero issues across all reviewers.
The review pipeline follows the same Ralph Loop pattern used by other minions workflows.
Orchestrator dispatches R1 (5 parallel review agents)
|
Each reviewer writes to .agents/tmp/phases/review-{N}/r1-{agent}.json
|
SubagentStop hook fires:
- waits for all 5 outputs
- validates JSON
- aggregates into r1-verdict.json
- clean (0 issues) => currentPhase = DONE
- issues + iteration < max => currentPhase = R2
- issues + iteration == max => currentPhase = STOPPED
|
Stop hook fires:
- R1 => inject review-dispatch prompt
- R2 => inject fixer-dispatch prompt
- DONE/STOPPED => allow stop
|
review-fixer agent runs in R2:
- reads all r1-*.json files for current iteration
- applies targeted fixes for critical/warning/info
- writes r2-fix-summary.md
|
SubagentStop hook fires for review-fixer:
- marks R2 complete
- increments iteration
- creates next review-{N+1} directory
- sets currentPhase = R1
|
Repeat until DONE or STOPPED
on-subagent-stop-review.sh handles side-effects only (validate output, aggregate verdicts, advance state).on-stop-review.sh handles prompt reinjection only (phase-specific orchestrator instructions)..agents/tmp/state.json.| Phase | subagent_type | model | Notes |
|---|---|---|---|
| R1 | minions:critic, minions:pedant, minions:witness, minions:security-reviewer, minions:silent-failure-hunter | inherit | Parallel review batch |
| R2 | minions:review-fixer | inherit | Single write-enabled fixer |
Read, Glob, Grep, Bash; no Edit/Write/Task)..agents/tmp/phases/review-{iteration}/r1-{agent}.json.issues[] with severity, category, file, line, description, evidence, suggestionsummary with critical, warning, info, verdicton-subagent-stop-review.sh aggregates all 5 into r1-verdict.json.minions:review-fixer.Read, Write, Edit, Glob, Grep, Bash; no Task).r1-*.json review outputs..agents/tmp/phases/review-{iteration}/r2-fix-summary.md.{
"plugin": "minions",
"pipeline": "review",
"status": "in_progress",
"task": "<description>",
"ownerPpid": "<session pid>",
"sessionId": "<session id>",
"iteration": 1,
"maxIterations": 5,
"currentPhase": "R1",
"startedAt": "<ISO timestamp>",
"updatedAt": "<ISO timestamp>",
"iterations": [
{
"iteration": 1,
"startedAt": "<ISO timestamp>",
"r1": { "status": "pending" },
"r2": { "status": "pending" },
"verdict": null
}
]
}
Field highlights:
pipeline: "review" enables review-specific hook delegation.iteration and maxIterations control bounded looping.currentPhase drives dispatch (R1, R2, DONE, STOPPED).iterations[] keeps per-iteration status and audit history.R1 (review) --[0 issues]-----------------> DONE
R1 (review) --[issues, iter < max]-------> R2 (fix) -> iteration++ -> R1
R1 (review) --[issues, iter == max]------> STOPPED
.agents/tmp/phases/
review-1/
r1-critic.json
r1-pedant.json
r1-witness.json
r1-security-reviewer.json
r1-silent-failure-hunter.json
r1-verdict.json
r2-fix-summary.md
review-2/
...
review-fixer to read all current r1-*.json files and fix every issue.[PHASE R1] / [PHASE R2] tags for phase clarity in orchestration output.review-fixer).issues_found.maxIterations (default: 5), then transitions to STOPPED.on-subagent-stop-review.sh).on-subagent-stop-review.sh).on-stop-review.sh).on-task-gate-review.sh).on-edit-gate-review.sh).on-stop.sh delegates to on-stop-review.sh when pipeline == "review".on-subagent-stop.sh delegates to on-subagent-stop-review.sh when pipeline == "review".on-task-gate.sh delegates to on-task-gate-review.sh when pipeline == "review".on-edit-gate.sh delegates to on-edit-gate-review.sh when pipeline == "review"./minions:review initializes review state and starts R1.You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.