Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from bundle
Drive Live Log Viewer implement-to-review flows from an agent.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: review-loop3description: Drive Live Log Viewer's implement→review flows — start a review cycle for a conversation, monitor rounds, relay verdicts, and recover stuck rounds. Use when the user asks to run a review loop / review cycle on agent work, wants a fresh reviewer per round, or asks to orchestrate implement→review with the viewer.4---56# Review loops (implement → review flows)78Live Log Viewer ships a flow engine that orchestrates the implement→review9cycle: one long-lived implementer agent writes code, a fresh reviewer session10audits the full diff each round, findings are relayed back automatically, and11the cycle repeats until the reviewer approves. This skill explains how to12drive it from an agent.1314The viewer must be running (default `http://127.0.0.1:8898`). All endpoints15are same-origin: call them from localhost without an Origin header.1617## Concepts1819- **Implementer** — an interactive CLI agent (claude or codex) in a tmux pane,20tracked by its transcript path. It lives across all rounds.21- **Reviewer** — a fresh session per round, headless by default22(`codex exec` / `claude -p` with edit tools disabled), so every round is a23blind, independent look at the full diff.24- **Round scope** — `git diff <baseRef>...HEAD` plus uncommitted changes.25`baseRef` is captured once at flow creation, so later rounds re-check26earlier fixes.27- **Marker protocol** — the implementer prints a line starting with28`REVIEW_READY:` when the tree is reviewable; the scanner detects it and29starts a round. The implementer answers findings with `FIXED` or30`REJECTED — <reason>` per item.3132## Start a flow3334From the UI: open the project scheme, click the «Flow» chip above a35conversation pane → "Start a flow" dialog (that conversation becomes the36implementer).3738From an agent:39401. Spawn or pick the implementer conversation. To spawn fresh:41`POST /api/spawn`42`{"engine":"claude"|"codex","cwd":"<abs dir>","prompt":"<kickoff>","src":"<your transcript path>"}`43— returns the transcript `path` for claude; for codex, find the newest44`~/.codex/sessions/**/rollout-*.jsonl` whose `cwd` matches. **Always pass45`src`** with the absolute path of your own conversation transcript: the46viewer records the spawn as a handoff and draws the link from your47conversation to the implementer on the scheme; without it the new agent48stands as an unrelated root. Optional `effort` (claude: low…max, codex:49low…xhigh) and codex-only `fast: true|false` set the reasoning level and50speed tier per spawn.512. Create the flow:5253```54POST /api/flows55{56"implementerPath": "<transcript path>",57"preset": "<preset name>", // or "roles": {implementer, reviewer}58"baseMode": "head" | "merge-base",59"mode": "auto" | "manual",60"reviewerMode": "headless" | "pane",61"roundLimit": 562}63```6465A role is `{engine: "claude"|"codex", model: string|null, effort: string|null}`66(codex effort: low|medium|high|xhigh). `GET /api/flows` lists flows and the67editable presets (stored in `~/.claude/viewer-state/review-loop-presets.json`).68693. The engine relays its own kickoff protocol to the implementer. Instruct70your implementer to print `REVIEW_READY:` only when the tree is stable and71the build is green.7273## Monitor and control7475- `GET /api/flows` — states: `waiting_ready → spawning → reviewing →76relaying → fixing → …`, terminal `approved` / `commented` / `closed`, and77`needs_decision` (with `stateDetail`) when the engine will not guess.78- `PATCH /api/flows/<id>` with `{"action": ...}`:79`pause`, `resume`, `set-mode`, `advance` (manual-mode transitions or force a80round from `waiting_ready`), `retry-round` (re-run the current round from81`needs_decision`), `cancel-round` (stop a running reviewer mid-round; the82flow lands in `needs_decision`), `extend` (+N rounds at the limit),83`another-round`, `close` (also stops a still-running reviewer — one click removes the reviewer side, the implementer keeps working), `set-round-limit` (absolute limit via `rounds`,840 = unlimited). `advance` and `retry-round` take an optional `note` string85delivered to the next reviewer as the round's ready note — use it to steer86a re-review after cancelling.87- Round artifacts: `~/.claude/viewer-state/flows/<flowId>/round-<n>-review.md`88— first line `VERDICT: APPROVE | REQUEST_CHANGES | COMMENT`, findings below.8990## Recovering stuck rounds9192- Restarting the viewer service (`systemctl --user restart agent-log-viewer`)93kills in-flight headless reviewers too — they live in the unit's cgroup.94Cancel the round first or let it finish; after an unavoidable restart the95artifact stays empty and the only path is `retry-round`.9697- `needs_decision: "reviewer process is missing after server restart"` — a98dev-server reload killed or orphaned the headless reviewer. Check99`pgrep -af "codex exec"` first: if the reviewer still runs, wait for it to100exit, then set the flow state back to `reviewing` (edit101`~/.claude/viewer-state/flows.json`; the engine is stateless and re-reads102it) so the engine picks the verdict up from the transcript. If nothing103survives, `retry-round`.104- `needs_decision: "reviewer verdict was unparseable"` — read the round105artifact. A usage-limit banner means the reviewer engine ran out of quota:106switch `roles.reviewer` in `flows.json`, then `retry-round`.107- Round limit reached — `{"action":"extend","rounds":N}` to keep going, or108`close`.109110## Conventions111112- Prompts to agents: English.113- One orchestrator: while the implementer fixes, do not edit the same files114yourself.115- Keep flow panes/windows around after completion; the user inspects them in116the viewer.117