dev-review
Skill4 starsChanged 56 days agoMITView on GitHub
Code-focused plan-bounce-execute workflow between Claude Code (Opus) and Codex CLI. Use when the user wants repo files changed, a bug fixed, a feature implemented, or a code plan verified before execution. One AI composes a plan, it bounces between agents with [CONTESTED]/[CLARIFY] markers until refined, then the designated agent executes the code. Replaces manual copy-paste between Claude Code and Codex desktops. Triggers on "dev review", "dev-review", "code review loop", "plan then execute", "have codex implement", "have codex review this diff", "developer reviewer loop", "compose execute verify", and explicit /dev-review requests. Generic co-evolution, bounce, cross-AI refinement, document refinement, and stress-test requests should use /co-evolution instead.
- Commits and pushes
6 other projects use a version of this.
Adopted by
Most recently taken up by
- boman-ng/skillstheir own version, first seen Oct 25, 2026
- TchiRubick/skillstheir own version, first seen Oct 20, 2026
- codeaholicguy/ai-devkittheir own version, first seen Oct 15, 2026
- egoxx1/unified-master-harnesstheir own version, first seen Oct 11, 2026
- baekenough/oh-my-customcodetheir own version, first seen Oct 3, 2026
- codihaus/claude-skillstheir own version, first seen Jan 19, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- codeaholicguy/ai-devkit★ 1.7ksame name
- baekenough/oh-my-customcode★ 42same name
- boman-ng/skills★ 2same name
- egoxx1/unified-master-harness★ 1same name
- TchiRubick/skills★ 1same name
- codihaus/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- codex-buildSkill
- co-evolutionSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
49 rules. 0 are common, 20 are distinctive, and 29 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
20
Distinctive
This author's own choices. Worth a look.
29
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Use /co-evolution for general questions, ideas, arguments, prompt refinement, or document bounces.
- Very specific: line 37
When --live is enabled on Windows, each Codex pass runs in a visible PowerShell window so the user can watch progress in real time.
- Distinctive: line 73
If task is empty, ask: "What should be built?"
- Very specific: line 126
If $LIVE_MODE is true, extend detection before any Codex pass runs:
- Very specific: line 132
If any required live-launch path cannot be resolved, display exactly: WARNING: --live unavailable.
- Very specific: line 175
Use Live: yes only when $LIVE_ACTIVE=true.
- Very specific: line 179
Create /tmp/dev-review-plan-{timestamp}.md - this is the living document that bounces.
- Distinctive: line 205
Use one helper for every live Codex pass: compose, bounce, execute, and verify.
- Very specific: line 211
Create a unique wrapper script: /tmp/dev-review-live-{run_id}.ps1
- Very specific: line 220
Before launch, convert the POSIX working directory and all prompt/output/schema/sentinel paths to native Windows form.
- Very specific: line 264
If the PID disappears before .done exists, treat the pass as interrupted because the user closed the window early.
- Very specific: line 266
Read the exit code from .exitcode after completion.
- Very specific: line 267
Keep the window open for a 5-second read delay before the wrapper writes .done, so the user can see the final Codex output and only one …
- Distinctive: line 324
Write the plan to the plan document file.
- Very specific: line 347
If $LIVE_ACTIVE=true, write the compose prompt to a temp prompt file and launch:
- Very specific: line 359
If $LIVE_ACTIVE=false, keep the existing headless behavior:
- Distinctive: line 365
Important: Always pipe plan content through stdin or embed it in the prompt file.
- Very specific: line 366
Never reference the plan file path in a way that Codex could discover and edit it directly.
- Very specific: line 374
If $SKIP_PLAN is true: skip this entire step.
- Very specific: line 390
If $BOUNCES = "auto": set $MAX_BOUNCES = 6, $AUTO_CONVERGE = true.
- Very specific: line 391
If $BOUNCES = integer: set $MAX_BOUNCES = that integer, $AUTO_CONVERGE = false.
- Distinctive: line 399
Read the current plan document from the file.
- Very specific: line 401
Read the bounce protocol template from ~/.claude/skills/dev-review/templates/bounce-protocol.md.
- Distinctive: line 414
Read the plan carefully
- Distinctive: line 416
Add [CONTESTED] notes where it disagrees (with counter-argument and concrete example)
- Distinctive: line 417
Add [CLARIFY] notes where ambiguous (with two interpretations or a specific question)
- Distinctive: line 419
Write the updated plan back to the file
- Very specific: line 438
If $LIVE_ACTIVE=true, launch the pass visibly:
- Very specific: line 497
If $AUTO_CONVERGE is true (default "auto" mode): the plan did NOT converge within the budget.
- Distinctive: line 520
Wait for user input. If the user picks option 1, let them edit the plan (or tell Claude Code which side to take on each marker), then …
- Very specific: line 524
If $AUTO_CONVERGE is false (fixed --bounces N mode): stop after N passes regardless.
- Distinctive: line 529
If a [CONTESTED] or [CLARIFY] marker has survived 2 passes without being resolved, the agent on the current pass must make a decision and …
- Distinctive: line 535
After all bounces complete (or early convergence), display the final plan:
- Distinctive: line 543
Read and display the plan document contents.
- Distinctive: line 545
If any [CONTESTED] or [CLARIFY] markers remain, warn:
- Very specific: line 551
If $PLAN_ONLY: stop here. Display:
- Distinctive: line 567
Read, Glob, Grep, and Bash tools.
- Distinctive: line 570
After implementing, stage changes:
- Very specific: line 601
If $LIVE_ACTIVE=true, launch visibly:
- Distinctive: line 618
After execution, verify changes:
- Distinctive: line 624
If no changes: warn and ask user whether to retry or abort.
- Very specific: line 628
Only runs if $VERIFY is set.
- Distinctive: line 630
After execution, the OTHER agent (not the executor) reviews the code diff against the refined plan.
- Very specific: line 658
If $LIVE_ACTIVE=true and you run this pass, route it through launch_codex_live with mode review, title Codex - Verify Review, and output …
- Very specific: line 661
If $LIVE_ACTIVE=false, keep the current headless codex review behavior.
- Very specific: line 666
If $LIVE_ACTIVE=true, use launch_codex_live with title Codex - Verify, mode exec-schema, prompt /tmp/dev-review-review-prompt.md, output …
- Very specific: line 670
If $LIVE_ACTIVE=false, keep the existing headless codex exec --output-schema behavior.
- Distinctive: line 739
Leave the git branch. If worktree, prompt to keep/remove.
- Very specific: line 789
Codex never sees the canonical plan file path: All plan content is embedded inline in the prompt (via stdin or prompt file).
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/dev-review - Plan-Bounce-Execute Workflow
Automates the workflow of composing a code plan with one AI, bouncing it between agents for refinement using [CONTESTED]/[CLARIFY] markers, then having one agent execute the final plan into code. Replaces manual copy-paste between Claude Code and Codex.
Use /co-evolution for general questions, ideas, arguments, prompt refinement,
or document bounces. Use /dev-review only when the intended deliverable is a
repo change or code-focused verification workflow.
For the detached flavor — the session plans and reviews while Codex executes
in the background and the session is woken at gates instead of babysitting — use
/codex-build (skills/codex-build/). It kicks the standalone runner with
--preset codex-build (Opus plans at high, Codex executes at xhigh, Opus
reviews at max; --verify on, bounces 2, revise-loop 1) and applies a
schema-bound ACCEPT / REVISE / ESCALATE gate. /dev-review is the interactive
single-session loop; /codex-build is the same pipeline run detached.
When --live is enabled on Windows, each Codex pass runs in a visible PowerShell
window so the user can watch progress in real time. The handoff contract stays
file-based: prompts are written to disk, Codex writes the final message to disk,
and Claude Code reads the resulting artifact before continuing.
The workflow has three phases:
- Compose - One agent creates the initial plan/approach
- Bounce - The plan document bounces between agents, each editing it directly
- Execute - The designated agent writes the final code from the refined plan
Step 1: Parse Arguments
Parse $ARGUMENTS for:
/dev-review [--composer opus|codex] [--executor opus|codex] [--bounces N|auto] [--verify] [--worktree] [--model MODEL] [--skip-plan] [--plan-only] [--live] <task description>Defaults:
--composer opus(Opus creates the initial plan)--executor codex(Codex writes the final code)--bounces auto(bounce until convergence — zero [CONTESTED] and zero [CLARIFY] markers — up to a max of 6 passes. If not converged after 6, stop and ask the user to arbitrate the remaining markers. Use--bounces Nto override with a fixed count.)--verifyif set, adds a final code review pass after execution--modeloverrides Codex model--worktreecreates isolated worktree--skip-planjumps straight to code execution (backward compat with old behavior)--plan-onlystops after the bounce phase, outputs the refined plan--liveopens visible Windows terminal windows for Codex passes; if unavailable, warn once and fall back to the current headless behavior- Remaining text = task description
The reviewer is always the agent that is NOT the composer.
Validation:
- If task is empty, ask: "What should be built?"
Store parsed values:
$COMPOSER= opus | codex (who creates the initial plan)$EXECUTOR= opus | codex (who writes the final code)$REVIEWER= the other agent (whoever is not the composer in each bounce)$BOUNCES= integer or "auto". If "auto" (default), bounce until convergence up to max 6 passes. If integer, use that fixed count. NOT round trips - 4 passes = 2 round trips.$VERIFY= boolean$TASK= remaining text$USE_WORKTREE= boolean$CODEX_MODEL= model override or empty$SKIP_PLAN= boolean$PLAN_ONLY= boolean$LIVE_MODE= boolean (requested live Codex windows)
Common Patterns (display these in help)
# Opus-heavy workflow: Opus composes, auto-converge bouncing, Opus executes
/dev-review --composer opus --executor opus Build a dashboard for API metrics
# Reverse: Codex composes, Opus reviews, Codex executes
/dev-review --composer codex --executor codex --bounces 4 Add retry logic to the API client
# Quick: Opus plans, 2 bounces, Codex executes
/dev-review --bounces 2 Fix the date parsing bug
# Just plan, don't execute yet
/dev-review --plan-only Build a real-time notification system
# Watch each Codex pass in a visible terminal window on Windows
/dev-review --live --bounces 2 Fix a bug in the billing service
# Skip planning, just execute and review (old behavior)
/dev-review --skip-plan --verify Rename getUserData to fetchUserProfileStep 2: Environment Detection
Run these checks:
# Check if in a git repo
git rev-parse --is-inside-work-tree 2>/dev/null && echo "GIT=true" || echo "GIT=false"
# Check codex availability
command -v codex >/dev/null 2>&1 && codex --version 2>/dev/null || echo "CODEX=missing"
# Check working tree status
git status --porcelain 2>/dev/null | head -5If $LIVE_MODE is true, extend detection before any Codex pass runs:
- Detect whether the current platform is Windows. First release is Windows-only.
- Resolve the native Windows path to
powershell.exe. - Resolve the native Windows path to
codex.ps1orcodex.cmd, preferringcodex.ps1. - Resolve the native Windows form of the working directory and every temp artifact path only when crossing into the visible launcher.
- If any required live-launch path cannot be resolved, display exactly:
WARNING: --live unavailable; falling back to headless CodexThen set$LIVE_ACTIVE=falseand continue with the existing headless flow.
Recommended live-mode state:
$LIVE_ACTIVE= boolean (live requested and available on this machine)$LIVE_POWERSHELL_WIN= native Windows path topowershell.exe$LIVE_CODEX_WIN= native Windows path tocodex.ps1orcodex.cmd$WORKDIR_WIN= native Windows working directory used by visible Codex windows
Decision matrix:
- GIT=false: Set
$FILE_MODE=true. Skip branch creation. - CODEX=missing and Codex is needed: Error with install instructions. Suggest all-opus fallback.
- Dirty working tree and not
$USE_WORKTREE: Warn but continue. --liveon non-Windows, or launcher unresolved: Warn once, set$LIVE_ACTIVE=false, and keep the existing headless Codex behavior.
Step 3: Setup
If git repo and not $FILE_MODE:
BRANCH="dev-review/$(date +%Y%m%d-%H%M%S)"
git checkout -b "$BRANCH"If $USE_WORKTREE:
Use EnterWorktree tool.
Display session banner:
============================================
DEV-REVIEW SESSION
============================================
Task: $TASK
Composer: $COMPOSER (creates initial plan)
Executor: $EXECUTOR (writes final code)
Bounces: $BOUNCES passes
Verify: $VERIFY
Live: yes|no
Branch: $BRANCH (or "file mode")
============================================Use Live: yes only when $LIVE_ACTIVE=true. If --live was requested but fell back,
the warning from Step 2 is enough; still render the banner as Live: no.
Initialize the plan document:
Create /tmp/dev-review-plan-{timestamp}.md - this is the living document that bounces.
Build the shared Codex argument block: CODEX_ARGS
--model and the per-seat effort knob are parsed but must actually reach
codex exec. Build a CODEX_ARGS array ONCE here and splice it into every
headless codex exec invocation (compose, bounce, execute, verify). Codex takes
model and reasoning-effort as -c key=value overrides, not as named flags:
CODEX_ARGS=()
[ -n "$CODEX_MODEL" ] && CODEX_ARGS+=( -c "model=$CODEX_MODEL" )
[ -n "${CODEX_EFFORT:-}" ] && CODEX_ARGS+=( -c "model_reasoning_effort=$CODEX_EFFORT" )$CODEX_MODEL comes from --model; $CODEX_EFFORT (if your invocation sets it)
maps to the executor's reasoning effort, mirroring the standalone runner's
-c model_reasoning_effort= wiring. When both are empty, CODEX_ARGS is empty
and the codex commands are byte-identical to today's — Codex falls back to its
own ~/.codex/config.toml defaults.
Splice it into each headless codex command with "${CODEX_ARGS[@]}", e.g.
codex exec --full-auto "${CODEX_ARGS[@]}" -C "$(pwd)" -o <out>.
Shared helper: launch_codex_live
Use one helper for every live Codex pass: compose, bounce, execute, and verify. It changes only the launch mode. Prompt files, output files, and schema files remain the same artifacts the workflow already uses.
Responsibilities:
- Generate a unique run ID:
{timestamp}-{phase}-{pass} - Create a unique wrapper script:
/tmp/dev-review-live-{run_id}.ps1 - Create unique sidecars:
/tmp/dev-review-live-{run_id}.done/tmp/dev-review-live-{run_id}.exitcode/tmp/dev-review-live-{run_id}.pid
- Launch a visible PowerShell window with a descriptive title
- Poll from Claude Code until
.doneappears, the process disappears, or 300s timeout - Return the exit code and the output artifact path
Before launch, convert the POSIX working directory and all prompt/output/schema/sentinel
paths to native Windows form. Do this only at the launcher boundary. The underlying
workflow continues to use the same /tmp/dev-review-* files.
PowerShell wrapper shape:
param(
[string]$Title, [string]$CodexPath, [string]$WorkDir,
[string]$PromptPath, [string]$OutputPath, [string]$DonePath,
[string]$ExitPath, [string]$Mode, [string]$SchemaPath
)
$Host.UI.RawUI.WindowTitle = $Title
Write-Host "============================================"
Write-Host " $Title"
Write-Host "============================================"
try {
if ($Mode -eq "exec") {
Get-Content -Raw $PromptPath | & $CodexPath exec --full-auto -C $WorkDir -o $OutputPath -
} elseif ($Mode -eq "exec-schema") {
Get-Content -Raw $PromptPath | & $CodexPath exec --full-auto -C $WorkDir --output-schema $SchemaPath -o $OutputPath -
} elseif ($Mode -eq "review") {
Get-Content -Raw $PromptPath | & $CodexPath review - 2>&1 | Tee-Object -FilePath $OutputPath
}
$status = $LASTEXITCODE
} finally {
Set-Content -NoNewline $ExitPath $status
Start-Sleep -Seconds 5
New-Item -ItemType File -Force $DonePath | Out-Null
}Launch from Claude Code:
LIVE_PID=$(powershell.exe -NoProfile -Command "
\$p = Start-Process -FilePath 'powershell.exe' \
-ArgumentList '-NoLogo','-ExecutionPolicy','Bypass','-File','$SCRIPT_WIN' \
-PassThru; \$p.Id")Helper behavior:
- Save
LIVE_PIDto/tmp/dev-review-live-{run_id}.pid. - Poll until the
.donesentinel exists, the PID no longer exists, or 300 seconds pass. - If the PID disappears before
.doneexists, treat the pass as interrupted because the user closed the window early. Surface that state and offer retry or abort. - Read the exit code from
.exitcodeafter completion. - Keep the window open for a 5-second read delay before the wrapper writes
.done, so the user can see the final Codex output and only one live window is open at a time.
Pseudo-implementation:
launch_codex_live() {
local TITLE="$1"
local MODE="$2" # exec | exec-schema | review
local PROMPT_PATH="$3"
local OUTPUT_PATH="$4"
local SCHEMA_PATH="$5"
local PHASE="$6"
local PASS="$7"
local RUN_ID="$(date +%Y%m%d-%H%M%S)-${PHASE}-${PASS}"
local SCRIPT_POSIX="/tmp/dev-review-live-${RUN_ID}.ps1"
local DONE_POSIX="/tmp/dev-review-live-${RUN_ID}.done"
local EXIT_POSIX="/tmp/dev-review-live-${RUN_ID}.exitcode"
local PID_POSIX="/tmp/dev-review-live-${RUN_ID}.pid"
# Convert WORKDIR, PROMPT_PATH, OUTPUT_PATH, SCHEMA_PATH, SCRIPT_POSIX,
# DONE_POSIX, EXIT_POSIX, and PID_POSIX to native Windows paths here.
# Write the wrapper script to SCRIPT_POSIX using the PowerShell shape above.
LIVE_PID=$(powershell.exe -NoProfile -Command "
\$p = Start-Process -FilePath 'powershell.exe' \
-ArgumentList '-NoLogo','-ExecutionPolicy','Bypass','-File','$SCRIPT_WIN', \
'-Title','$TITLE','-CodexPath','$LIVE_CODEX_WIN','-WorkDir','$WORKDIR_WIN', \
'-PromptPath','$PROMPT_WIN','-OutputPath','$OUTPUT_WIN','-DonePath','$DONE_WIN', \
'-ExitPath','$EXIT_WIN','-Mode','$MODE','-SchemaPath','$SCHEMA_WIN' \
-PassThru; \$p.Id")
printf '%s' "$LIVE_PID" > "$PID_POSIX"
# Poll for .done, missing PID, or timeout.
# On missing PID before .done, treat as interrupted.
# On timeout, route to the existing retry logic for Codex timeout.
# Return the exit code read from EXIT_POSIX.
}Step 4: Compose Phase
The composer creates the initial plan document.
If $COMPOSER = opus:
Claude Code reads the task, explores the codebase (Read, Glob, Grep), and writes the initial plan directly to the plan document. The plan should include:
- What will be built
- Key technical decisions
- File structure / changes needed
- Implementation approach
- Any open questions marked with [CLARIFY]
Write the plan to the plan document file.
If $COMPOSER = codex:
Build a compose prompt and execute:
COMPOSE_PROMPT="You are creating an implementation plan for the following task.
TASK: $TASK
WORKING DIRECTORY: $(pwd)
Create a detailed plan that includes:
- What will be built
- Key technical decisions and rationale
- File structure and changes needed
- Implementation approach step by step
- Mark anything you're unsure about with [CLARIFY] followed by two possible interpretations
Output ONLY the plan document. No preamble."If $LIVE_ACTIVE=true, write the compose prompt to a temp prompt file and launch:
printf '%s' "$COMPOSE_PROMPT" > /tmp/dev-review-compose-prompt.md
launch_codex_live "Codex - Compose" "exec" \
/tmp/dev-review-compose-prompt.md \
/tmp/dev-review-plan-{timestamp}.md \
"" \
"compose" \
"0"If $LIVE_ACTIVE=false, keep the existing headless behavior:
printf '%s' "$COMPOSE_PROMPT" | codex exec --full-auto "${CODEX_ARGS[@]}" -C "$(pwd)" -o /tmp/dev-review-plan-{timestamp}.mdImportant: Always pipe plan content through stdin or embed it in the prompt file.
Never reference the plan file path in a way that Codex could discover and edit it
directly. Codex runs with --full-auto (full filesystem write access), so any file
path it can see is a file it can modify. The orchestrator is the sole owner of the
canonical plan file; Codex only ever receives plan content as inline text and writes
output to a separate -o path.
Display: "Plan composed by $COMPOSER. Starting bounce phase."
If $SKIP_PLAN is true: skip this entire step. The "plan" is just the task description itself, and we go straight to Step 6 (Execute).
Step 5: Bounce Phase
The plan document bounces between agents. Each pass, the receiving agent:
- Reads the plan as-is
- Edits it directly (improves where they agree)
- Adds [CONTESTED] notes where they disagree
- Adds [CLARIFY] notes where something is ambiguous
- Resolves any existing [CONTESTED]/[CLARIFY] notes from the previous pass
The bounce alternates: composer -> reviewer -> composer -> reviewer -> ... Pass 1 goes to the reviewer (since the composer just wrote it).
Bounce loop:
If $BOUNCES = "auto": set $MAX_BOUNCES = 6, $AUTO_CONVERGE = true.
If $BOUNCES = integer: set $MAX_BOUNCES = that integer, $AUTO_CONVERGE = false.
For each bounce pass (1 to $MAX_BOUNCES):
Determine whose turn it is:
- Odd passes (1, 3, 5...): REVIEWER's turn
- Even passes (2, 4, 6...): COMPOSER's turn
Read the current plan document from the file.
Read the bounce protocol template from ~/.claude/skills/dev-review/templates/bounce-protocol.md.
Fill placeholders:
{PLAN_CONTENT}= current plan document contents{TASK}= original task{PASS_NUMBER}= current pass{TOTAL_PASSES}= total bounces{YOUR_ROLE}= "reviewer" or "composer"
If current agent = opus:
Claude Code reads the plan document, applies the bounce protocol rules, and edits the plan document directly using the Write tool. Claude should:
- Read the plan carefully
- Make improvements where it agrees
- Add [CONTESTED] notes where it disagrees (with counter-argument and concrete example)
- Add [CLARIFY] notes where ambiguous (with two interpretations or a specific question)
- Resolve any existing [CONTESTED]/[CLARIFY] from previous pass
- Write the updated plan back to the file
If current agent = codex:
# Read current plan content into the prompt — never pass the plan file path to Codex
PLAN_CONTENT=$(cat /tmp/dev-review-plan-{timestamp}.md)
# Build the bounce prompt with plan content embedded inline
cat > /tmp/dev-review-bounce-prompt.md << 'BOUNCE_EOF'
{filled bounce-protocol template with PLAN_CONTENT embedded}
BOUNCE_EOFThe bounce prompt file contains the full plan text inline. Codex receives it via
stdin or as a prompt file, and writes its revised plan to a separate output file
via -o. The orchestrator then reads from that output and overwrites the canonical
plan. Codex never sees the canonical plan file path.
If $LIVE_ACTIVE=true, launch the pass visibly:
launch_codex_live "Codex - Bounce {N}/{TOTAL}" "exec" \
/tmp/dev-review-bounce-prompt.md \
/tmp/dev-review-bounce-output-{timestamp}-{N}.md \
"" \
"bounce" \
"{N}"
# Orchestrator overwrites canonical plan with Codex's output
cp /tmp/dev-review-bounce-output-{timestamp}-{N}.md /tmp/dev-review-plan-{timestamp}.mdIf $LIVE_ACTIVE=false, keep the existing headless behavior:
printf '%s' "$(cat /tmp/dev-review-bounce-prompt.md)" | codex exec --full-auto "${CODEX_ARGS[@]}" -C "$(pwd)" -o /tmp/dev-review-bounce-output-{timestamp}-{N}.md
# Orchestrator overwrites canonical plan with Codex's output
cp /tmp/dev-review-bounce-output-{timestamp}-{N}.md /tmp/dev-review-plan-{timestamp}.mdAfter each pass, display:
--------------------------------------------
BOUNCE {N}/{TOTAL} - {agent_name}'s pass
--------------------------------------------
[CONTESTED] markers: {count}
[CLARIFY] markers: {count}
Plan length: {word_count} words
--------------------------------------------Count markers by scanning for [CONTESTED] and [CLARIFY] in the document:
CONTESTED=$(grep -c '\[CONTESTED\]' /tmp/dev-review-plan-{timestamp}.md 2>/dev/null || echo 0)
CLARIFY=$(grep -c '\[CLARIFY\]' /tmp/dev-review-plan-{timestamp}.md 2>/dev/null || echo 0)Auto-convergence check (after each pass):
Count markers:
CONTESTED=$(grep -c '\[CONTESTED\]' /tmp/dev-review-plan-{timestamp}.md 2>/dev/null || echo 0)
CLARIFY=$(grep -c '\[CLARIFY\]' /tmp/dev-review-plan-{timestamp}.md 2>/dev/null || echo 0)
TOTAL_MARKERS=$((CONTESTED + CLARIFY))If TOTAL_MARKERS = 0: The plan has converged. Display:
Plan converged after {N} passes (no open markers).Break out of the bounce loop. Proceed to Step 5b.
If TOTAL_MARKERS > 0 and more passes remain: Continue to the next pass.
If TOTAL_MARKERS > 0 and this was the last pass ($MAX_BOUNCES reached):
If $AUTO_CONVERGE is true (default "auto" mode): the plan did NOT converge within
the budget. Stop bouncing and escalate to the user for arbitration:
============================================
BOUNCE LIMIT REACHED — ARBITRATION NEEDED
============================================
Passes used: {N} / {$MAX_BOUNCES}
Open markers: {CONTESTED} [CONTESTED], {CLARIFY} [CLARIFY]
============================================
The agents could not fully agree within {$MAX_BOUNCES} passes.
Remaining disagreements are shown below.
{display each [CONTESTED] and [CLARIFY] marker with surrounding context}
Options:
1. Resolve these yourself and continue to execution
2. Add more bounces: /dev-review --bounces {N+4} --skip-plan "Continue: $TASK"
3. Accept the plan as-is and execute with open markers
4. AbortWait for user input. If the user picks option 1, let them edit the plan (or tell Claude Code which side to take on each marker), then proceed to Step 5b. If option 3, proceed with a warning. If option 4, exit.
If $AUTO_CONVERGE is false (fixed --bounces N mode): stop after N passes regardless.
Show marker count and proceed to Step 5b.
Marker staleness rule:
If a [CONTESTED] or [CLARIFY] marker has survived 2 passes without being resolved, the agent on the current pass must make a decision and remove it. This is enforced by the bounce protocol template, not by the orchestrator.
Step 5b: Display Refined Plan
After all bounces complete (or early convergence), display the final plan:
============================================
REFINED PLAN (after {N} bounces)
============================================Read and display the plan document contents.
If any [CONTESTED] or [CLARIFY] markers remain, warn:
WARNING: {count} unresolved markers remain in the plan.If $PLAN_ONLY: stop here. Display:
Plan saved to: /tmp/dev-review-plan-{timestamp}.md
To execute later: /dev-review --skip-plan --executor {$EXECUTOR} {$TASK}Exit.
Step 6: Execute Phase
The designated executor writes the actual code based on the refined plan.
If $EXECUTOR = opus:
Claude Code reads the refined plan and implements it directly using Edit, Write, Read, Glob, Grep, and Bash tools. This is normal Claude Code development - read existing code, match patterns, implement the plan, test.
After implementing, stage changes:
git add -A # Safe on dedicated dev-review branchIf $EXECUTOR = codex:
Build an execution prompt that includes the refined plan:
cat > /tmp/dev-review-exec-prompt.md << 'EXEC_EOF'
You are implementing the following refined plan. This plan has been reviewed
and agreed upon by multiple AI agents. Implement it exactly as specified.
## Task
{$TASK}
## Refined Plan
{plan document contents}
## Instructions
- Implement the plan step by step
- Match existing code style
- Handle errors at system boundaries
- Write tests if the project has a test suite
- Stage and commit your changes
- Do NOT deviate from the plan
EXEC_EOFIf $LIVE_ACTIVE=true, launch visibly:
launch_codex_live "Codex - Execute" "exec" \
/tmp/dev-review-exec-prompt.md \
/tmp/dev-review-exec-output.md \
"" \
"execute" \
"0"If $LIVE_ACTIVE=false, keep the existing headless behavior:
codex exec --full-auto "${CODEX_ARGS[@]}" -C "$(pwd)" < /tmp/dev-review-exec-prompt.md > /tmp/dev-review-exec-output.md 2>&1After execution, verify changes:
git diff --statIf no changes: warn and ask user whether to retry or abort.
Step 7: Verify Phase (Optional)
Only runs if $VERIFY is set.
After execution, the OTHER agent (not the executor) reviews the code diff against the refined plan.
Capture the diff:
git diff --stat > /tmp/dev-review-diffstat.txt
git diff > /tmp/dev-review-diff.txt
# If committed:
if [ -z "$(git diff)" ] && [ -n "$(git diff HEAD~1)" ]; then
git diff HEAD~1 --stat > /tmp/dev-review-diffstat.txt
git diff HEAD~1 > /tmp/dev-review-diff.txt
fiIf verifier = opus (subagent):
Launch a Sonnet subagent with the review prompt from
~/.claude/skills/dev-review/templates/review-prompt-opus.md, filling:
{TASK}= $TASK{DIFF}/{DIFF_STAT}= captured diff{SESSION_LOG}= the refined plan document (serves as context)
Parse the JSON verdict.
If verifier = codex (two-pass):
Pass 1: codex review --uncommitted (if available, skip if not)
- If
$LIVE_ACTIVE=trueand you run this pass, route it throughlaunch_codex_livewith modereview, titleCodex - Verify Review, and output file/tmp/dev-review-codex-rich-review.md. - If
$LIVE_ACTIVE=false, keep the current headlesscodex reviewbehavior.
Pass 2: codex exec --output-schema with the review prompt
- Headless: splice
"${CODEX_ARGS[@]}"in too, e.g.codex exec --full-auto "${CODEX_ARGS[@]}" --output-schema <schema> -C "$(pwd)" -o /tmp/dev-review-verdict.json < /tmp/dev-review-review-prompt.md - If
$LIVE_ACTIVE=true, uselaunch_codex_livewith titleCodex - Verify, modeexec-schema, prompt/tmp/dev-review-review-prompt.md, output/tmp/dev-review-verdict.json, and schema path~/.claude/skills/dev-review/schemas/review-verdict.json. - If
$LIVE_ACTIVE=false, keep the existing headlesscodex exec --output-schemabehavior.
Parse the JSON verdict.
Judge pass:
Filter false positives (same as before - remove hallucinated file refs, pre-existing issues, LOW-only blockers).
Display result:
If APPROVED:
Code verified against plan. Ready to merge.If REVISE:
Verifier found issues with the implementation:
{issues list}
Options:
- Fix issues: /dev-review --skip-plan --executor {$EXECUTOR} "Fix: {issues summary}"
- Accept anyway and merge manually
- AbortStep 8: Completion
============================================
DEV-REVIEW COMPLETE
============================================
Task: $TASK
Composer: $COMPOSER
Executor: $EXECUTOR
Bounces: {actual passes} / {max}
Verified: {yes/no}
Confidence: {confidence}/100 (if verified)
============================================
Next steps:
- Review: git diff main..HEAD
- Merge: git checkout main && git merge $BRANCH
- PR: gh pr create
============================================Step 9: Cleanup
rm -f /tmp/dev-review-plan-*.md
rm -f /tmp/dev-review-compose-prompt.md
rm -f /tmp/dev-review-bounce-prompt.md
rm -f /tmp/dev-review-bounce-output-*.md
rm -f /tmp/dev-review-exec-prompt.md
rm -f /tmp/dev-review-exec-output.md
rm -f /tmp/dev-review-diff.txt
rm -f /tmp/dev-review-diffstat.txt
rm -f /tmp/dev-review-review-prompt.md
rm -f /tmp/dev-review-codex-rich-review.md
rm -f /tmp/dev-review-verdict.json
rm -f /tmp/dev-review-live-*.ps1
rm -f /tmp/dev-review-live-*.done
rm -f /tmp/dev-review-live-*.exitcode
rm -f /tmp/dev-review-live-*.pidLeave the git branch. If worktree, prompt to keep/remove.
Error Recovery
| Error | Detection | Response |
| Codex not found | command -v codex fails | Suggest all-opus mode |
| Codex timeout | Bash timeout 300s or live polling hits 300s | Offer retry or switch to opus for this pass |
| Codex failure | Non-zero exit | Show error, offer retry or abort |
| Live launcher unavailable | Windows path resolution fails or non-Windows platform | Warn once and fall back to headless Codex |
| Live terminal closed early | PID disappears before .done exists | Treat as interrupted, offer retry or abort |
| No code changes | Empty diff after execute | Ask user to clarify |
| Plan document empty | Empty file after bounce | Retry the pass |
| Markers stuck 2+ passes | grep count unchanged | Force resolution on current pass |
| Not git + worktree | git rev-parse fails | Drop worktree, warn, continue |
Calling dev-review from another workflow
- To execute a plan someone else wrote, call dev-review with
--skip-plan --executor codex --verify. - To gate a change before opening a PR, run the verify phase, which returns a verdict matching the review-verdict schema.
- The GSD hooks that used to call dev-review this way were retired on 2026-09-27, so invoke it directly.
Notes
- Cost: Each Codex pass costs OpenAI tokens. A 4-bounce + execute + verify loop with Codex = ~7 codex exec calls.
- Plan convergence: Most plans converge (zero markers) in 2-3 bounces. The early termination check prevents wasting passes on an already-clean plan.
- The bounce protocol uses [CONTESTED]/[CLARIFY] markers as the coordination mechanism. This is lighter than JSON verdicts and produces a cleaner artifact.
- Executor choice matters: Codex (via
codex exec --full-auto) has direct file access in its sandbox. Opus works through Claude Code's normal tool flow. Both produce working code; Codex is faster for greenfield, Opus is better when existing codebase context matters. - The plan document is the artifact: Unlike chat history, the plan reads clean after every pass - as if one person wrote it. This is intentional per the bounce protocol.
--liveis launch-mode only: It does not change the artifact contract. Prompts still come from temp files, and the final Codex message still lands in the same output file before Claude Code continues.--liveignores model/effort overrides (documented v1 limitation): the visible-window launcher (launch_codex_live) does not spliceCODEX_ARGS, so--model/ the reasoning-effort knob have no effect on live Codex passes. Those overrides apply only on the headless path. Use headless mode when a pinned Codex model or effort matters.--liveis Windows-only in the first release: On non-Windows platforms, warn once and continue headless.- Live windows auto-close after a short read delay: The wrapper waits 5 seconds
before writing
.done, which gives the user time to read the terminal and keeps the workflow serialized to one visible Codex window at a time. - Codex never sees the canonical plan file path: All plan content is embedded
inline in the prompt (via stdin or prompt file). Codex writes its output to a
separate
-ofile, and the orchestrator copies that back to the canonical plan. This prevents Codex from modifying the plan file directly via--full-autofilesystem access. Found during smoke testing: without this isolation, Codex edits the source plan on disk in addition to writing-ooutput.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

