Agent skill
review-loop
Use when code changes need multi-pass automated review before merge. Use when preparing branch for PR. Use when thorough code quality check needed.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/review-loop-onsails-cc-52793c7e
SKILL.md
MANDATORY FIRST ACTION
STOP. Before ANY other tool call, you MUST call TaskCreate.
If you're about to:
- Run setup.sh → STOP. TaskCreate first.
- Dispatch reviewer → STOP. TaskCreate first.
- Read any file → STOP. TaskCreate first.
Step 1: Create Tasks
First, check if code-simplifier:code-simplifier subagent is available in your Task tool's subagent_type list.
If code-simplifier IS available:
TaskCreate(subject: "Simplify code", description: "Run code-simplifier before review", activeForm: "Simplifying code")
TaskCreate(subject: "Iteration 1: Review", description: "Review and fix", activeForm: "Running iteration 1")
TaskCreate(subject: "Iteration 2: Review", description: "Review and fix", activeForm: "Running iteration 2")
TaskCreate(subject: "Iteration 3: Review", description: "Review and fix", activeForm: "Running iteration 3")
TaskCreate(subject: "Iteration 4: Review", description: "Review and fix", activeForm: "Running iteration 4")
Then set dependencies (ITER1 blocked by SIMPLIFY):
TaskUpdate(taskId: ITER1, addBlockedBy: [SIMPLIFY])
TaskUpdate(taskId: ITER2, addBlockedBy: [ITER1])
TaskUpdate(taskId: ITER3, addBlockedBy: [ITER2])
TaskUpdate(taskId: ITER4, addBlockedBy: [ITER3])
TaskUpdate(taskId: SIMPLIFY, status: "in_progress")
If code-simplifier is NOT available:
TaskCreate(subject: "Iteration 1: Review", description: "Review and fix", activeForm: "Running iteration 1")
TaskCreate(subject: "Iteration 2: Review", description: "Review and fix", activeForm: "Running iteration 2")
TaskCreate(subject: "Iteration 3: Review", description: "Review and fix", activeForm: "Running iteration 3")
TaskCreate(subject: "Iteration 4: Review", description: "Review and fix", activeForm: "Running iteration 4")
Then set dependencies and start:
TaskUpdate(taskId: ITER2, addBlockedBy: [ITER1])
TaskUpdate(taskId: ITER3, addBlockedBy: [ITER2])
TaskUpdate(taskId: ITER4, addBlockedBy: [ITER3])
TaskUpdate(taskId: ITER1, status: "in_progress")
Report to user: "code-simplifier plugin not installed. Recommended: claude plugin install code-simplifier@anthropic-official from https://github.com/anthropics/claude-plugins-official"
CHECKPOINT: Have you created tasks? If NO → do it now. If YES → continue.
Review Loop
You are an ORCHESTRATOR. You dispatch subagents. You do NOT touch code.
Process
digraph review_loop {
rankdir=TB;
"TaskCreate" [shape=box, style=bold];
"Get REVIEW_DIR/TARGET_BRANCH" [shape=box];
"code-simplifier available?" [shape=diamond];
"Dispatch code-simplifier" [shape=box];
"TaskList → find unblocked" [shape=box];
"Dispatch reviewer" [shape=box];
"Invoke /fix skill" [shape=box];
"TaskUpdate completed" [shape=box];
"Iteration < 4?" [shape=diamond];
"Commit" [shape=box];
"TaskCreate" -> "Get REVIEW_DIR/TARGET_BRANCH";
"Get REVIEW_DIR/TARGET_BRANCH" -> "code-simplifier available?";
"code-simplifier available?" -> "Dispatch code-simplifier" [label="yes"];
"code-simplifier available?" -> "TaskList → find unblocked" [label="no"];
"Dispatch code-simplifier" -> "TaskList → find unblocked";
"TaskList → find unblocked" -> "Dispatch reviewer";
"Dispatch reviewer" -> "Invoke /fix skill";
"Invoke /fix skill" -> "TaskUpdate completed";
"TaskUpdate completed" -> "Iteration < 4?";
"Iteration < 4?" -> "TaskList → find unblocked" [label="yes"];
"Iteration < 4?" -> "Commit" [label="no"];
}
Step 2: Get Config
If args provided, use them. Otherwise:
~/.claude/plugins/cache/onsails-cc/review-loop/*/skills/review-loop/scripts/setup.sh
Step 2.5: Code Simplification (if available)
If code-simplifier:code-simplifier subagent is available, dispatch it to simplify code changes between current branch and TARGET_BRANCH:
Task(subagent_type: "code-simplifier:code-simplifier",
prompt: "Simplify code changes between HEAD and ${TARGET_BRANCH}. Focus only on files modified in this branch.")
TaskUpdate(taskId: SIMPLIFY, status: "completed")
Step 3: Each Iteration
TaskList→ find first unblocked task- Dispatch reviewer:
Task(subagent_type: "review-loop:local-reviewer", prompt: "OUTPUT: ${REVIEW_DIR}/iterN.md\nTARGET: ${TARGET_BRANCH}") - Invoke fix:
Skill(skill: "review-loop:fix", args: "${REVIEW_DIR}/iterN.md") TaskUpdate(taskId: CURRENT, status: "completed")- Repeat
Step 4: Completion
After 4+ iterations with no critical/major:
git add -A && git commit -m "fix: address review issues (N iterations)"
Rationalization Table
| Excuse | Reality |
|---|---|
| "I know what review-loop does" | You pattern-matched. Read the skill. TaskCreate FIRST. |
| "Let me run setup first" | NO. TaskCreate comes before setup.sh |
| "I'll create tasks after starting" | NO. Tasks FIRST, always. |
| "Two iterations enough" | NO. Minimum 4. |
| "I'll fix this quickly" | NO. /fix skill does fixes. |
| "Would you like me to..." | NO. Never ask. Execute. |
| "Skip code-simplifier, it's optional" | Check availability first. If available, run it. |
Red Flags - STOP IMMEDIATELY
If you catch yourself:
- Dispatching reviewer without tasks created → STOP
- Running setup.sh as first action → STOP
- Using Read/Edit/Grep on code → STOP
- Fixing issues directly → STOP
- Asking permission → STOP
- Skipping code-simplifier without checking availability → STOP
All mean: You skipped TaskCreate. Go back to MANDATORY FIRST ACTION.
Iron Rules
- TaskCreate BEFORE anything else
- Check code-simplifier availability, run if present
- MINIMUM 4 review iterations
- ONLY Task and Skill tools on code
- SEQUENTIAL iterations
- /fix skill does fixes, not you
- Never ask permission
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?