Loading...
Loading...
Reviewer-gated iterative fleet for headless `claude -p` or `codex exec` workers that run in cycles until a designated reviewer approves the output. Use when the work needs multiple rounds of iteration with a quality gate — a reviewer worker reads all worker logs, writes a verdict (lgtm | iterate | escalate), and the orchestrator decides whether to continue, pause, or stop. NEVER kills or restarts workers automatically; the operator owns all kill/pause decisions.
npx skill4agent add quickcall-dev/skills iterative-fleetclaude -pcodex exec{
"fleet_name": "my-iterative-fleet",
"type": "iterative",
"config": {
"max_concurrent": 3,
"model": "sonnet",
"fallback_model": "haiku",
"max_iterations": 10,
"cost_cap_usd": 10.0
},
"workers": [
{ "id": "builder-a", "type": "code-run", "task": "...", "max_budget_per_iter": 1.0 },
{ "id": "builder-b", "type": "code-run", "task": "...", "max_budget_per_iter": 1.0 },
{ "id": "reviewer", "type": "reviewer", "task": "Review output, write verdict: lgtm | iterate | escalate",
"depends_on": ["builder-a", "builder-b"] }
],
"stop_when": {
"reviewer_lgtm_count": 3,
"max_iterations": 10,
"cost_cap_usd": 10.0
}
}depends_ondepends_on{ "id": "reviewer", "type": "reviewer", "depends_on": ["builder-a", "builder-b"] }iteration 1: [builder-a, builder-b] → [reviewer] → verdict: iterate
iteration 2: [builder-a, builder-b] → [reviewer] → verdict: lgtm → stoplib/dag.shdepends_on$FLEET_ROOT/
fleet.json
iterations/
1/
builder-a.log
builder-b.log
review.md # reviewer writes verdict here
2/
...
workers/
builder-a/
prompt.md
session.jsonl
...
orchestrator.sh # generated — reads logs, decides iterate/pause/stop
.paused # exists when paused (touch to pause, rm to resume)iterations/<N>/*.logiterations/<N>/review.mdverdict: lgtmverdict: iterateverdict: escalateiterate## Writing your verdict
1. Determine the current iteration number: list the `iterations/` directory and find the
highest-numbered subdirectory that does NOT yet contain a `review.md`.
2. Write your verdict to `iterations/<N>/review.md` (relative to your working directory).
**Never use absolute paths.**
3. The file MUST contain a line exactly like one of:
- `verdict: lgtm`
- `verdict: iterate`
- `verdict: escalate`
4. Below the verdict line, list **actionable fix instructions** per worker — not just what's
wrong, but exactly where and how to fix it (file path, function name, what to change).
The builder sees this feedback on the next iteration, so vague issues waste a cycle.
Example `iterations/1/review.md`:src/parser.py:parse_input()src/parser.py:validate_schema()"timestamp": {"type": "string", "required": True}src/utils.pyformat_output()__all____init__.pysrc/__init__.pyfrom .utils import format_outputundefined| Script | Purpose |
|---|---|
| Parse fleet.json, generate orchestrator.sh, spawn workers + orchestrator in tmux |
| Show iteration count, reviewer verdict history, per-worker status, cost |
| Touch |
| Remove |
| Hard stop: kill tmux session, sweep orphans, unregister |
$FLEET_ROOT/fleet.jsontype: "reviewer"depends_on$FLEET_ROOT/workers/<id>/prompt.mdbash ${CLAUDE_SKILL_DIR}/scripts/launch.sh $FLEET_ROOTbash ${CLAUDE_SKILL_DIR}/scripts/status.sh $FLEET_ROOTbash ${CLAUDE_SKILL_DIR}/scripts/pause.sh $FLEET_ROOTbash ${CLAUDE_SKILL_DIR}/scripts/kill.sh $FLEET_ROOT all| Agent says | Rebuttal |
|---|---|
| "The worker has been running for 10 minutes with no output — it must be stuck, I should pause it" | Long thinking blocks look like silence. The orchestrator waits for |
| "The reviewer said 'looks mostly good' — I'll count that as LGTM" | Only |
| "I should kill this worker and restart it with a better prompt" | The orchestrator NEVER kills workers. Workers run to natural completion. If you need a different prompt, pause the fleet, edit prompt.md, and let the next iteration pick it up. |
| "The cost is getting high — I'll reduce max_iterations mid-run" | Stop conditions are baked into orchestrator.sh at generation time. To change them, kill the fleet, regenerate with new fleet.json, and relaunch. Do not edit orchestrator.sh directly. |
| "I can skip the reviewer for this simple task" | If the task doesn't need a reviewer, use dag-fleet (one-shot) or worktree-fleet (independent). Iterative-fleet without a reviewer is a runaway loop. |
1. Tasks independent (no shared files/state)? YES → worktree-fleet
2. Need iteration with reviewer quality gate? YES → iterative-fleet (this skill)
3. One-shot DAG with dependencies? YES → dag-fleet
4. None of the above? → open multiple Claude Code sessions