run-codex-review-loop
Use if running Codex review loops across branches, lenses, comparisons, or convergence rounds.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use if running Codex review loops across branches, lenses, comparisons, or convergence rounds.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | run-codex-review-loop |
| description | Use skill if you are running repeatable Codex reviews across lenses or branches, optionally verifying and fixing confirmed findings in isolated worktrees. |
Run repeatable Codex review passes without relying on a retired dispatcher. This skill owns multi-round native Codex review execution; run-review owns one-off review routing, PR handoff, and feedback triage.
Three modes:
git branch --show-current reports — often main) through many independent review lenses, in rounds, until findings converge.Route by requested outcome:
Do not use this for:
run-review Mode D.run-review Mode B.run-review Mode C.Run these before any mode:
codex --version
git rev-parse --is-inside-work-tree
git branch --show-current
git rev-parse --verify HEAD
git status --short
Require codex-cli 0.130.0 or newer.
tree: clean|dirty in the manifest.For every branch named in Mode B:
git rev-parse --verify <branch>
If a branch does not resolve locally, fetch it explicitly or report that it is missing. Do not silently drop it.
Do not start with Codex prompts. First understand the project enough to choose the right review lenses.
Spawn 1–3 Sonnet-class explore agents — Claude Sonnet or an equivalent mid-tier model. The point is fast, broad project mapping, not top-tier deep reasoning. Use equivalent local/default agents if Sonnet is unavailable. Give each agent a bounded mission such as:
The explore outputs are steering inputs. They decide what Codex reviews to run. Do not use a generic checklist when the project tells you what matters. A fragile ERP integration needs concurrency/token/governor lenses; a public web API needs authz/rate-limit lenses; a data pipeline needs idempotency/freshness/data-loss lenses.
Highest priority targets are the project's own explicit invariants — especially AGENTS.md, CLAUDE.md, operational-safety docs, architecture docs, and schemas. A contradiction between a stated invariant and runtime code is usually a real finding.
From exploration, write a lens list for round 1.
Rules:
Good lens shapes:
Every lens prompt must demand:
clean explicitly.Create one run directory and one subdirectory per round:
mkdir -p "/tmp/codex-review-loop/$(date +%Y%m%dT%H%M%SZ)/round-1"
Record a manifest at the run root:
mode: multi-lens
branch: <current-branch>
head: <sha>
tree: clean|dirty
rounds-max: 10
round: 1
lenses:
- <lens-slug>: <one-line focus>
Launch all lenses for the round in parallel, preferably in background tasks, one Codex run per lens. Use whichever execution surface is available:
node "<codex-plugin>/scripts/codex-companion.mjs" task "<lens prompt>"
codex exec review --json -o "/tmp/codex-review-loop/<run-id>/round-N/<lens-slug>.md" "<lens prompt>"
After each run completes:
<run-dir>/round-N/<lens-slug>.md so the run is resumable.blocked with the exact command and stderr summary. Do not silently drop it.Read every lens output and produce a deduplicated table:
| # | Severity | Finding | Evidence | Lenses | Status |
|---|
Rules:
new, still-open, fixed-verified, or regressed.clean for that lens.confirmed, refuted, or partial with file:line evidence. A clean verdict remains clean; never require a reviewer to invent a finding.Run up to 10 rounds. In Mode A, fixes may be applied outside this skill by the main agent or user; Mode A itself remains review-only. Mode C owns its explicitly authorized fix loop.
For each next round:
Stop early when the loop converges. Convergence means one of:
When stopping, state exactly which condition fired. Do not keep grinding after convergence; extra rounds at that point manufacture noise.
mode: branch-comparison
base: <base-ref>
branches:
- <branch-a>
- <branch-b>
codex exec review \
--base <base-ref> \
--json \
-o "/tmp/codex-review-loop/<run-id>/<branch-slug>-last.md" \
"Review only major correctness, security, data-loss, API-contract, and stability risks. Ignore style."
| Branch | Verdict | Major findings | Evidence | Next action |
|---|
Deduplicate shared findings across branches. Mark findings as branch-specific or shared. Mark clean branches as clean. Mark failures as blocked with exact command and stderr summary.
Mode C reuses Mode A Phases 0–3, then continues through verification, repair, and a fresh review round. Read these before execution:
references/lens-design.md for deriving the smallest covering lens set;references/prompt-templates.md for explorer, reviewer, verifier, and fixer briefs; andreferences/codex-and-loop-mechanics.md for Codex invocation, resumable artifacts, worktrees, exact-SHA CI, merge order, and convergence.For each candidate finding or tight related cluster, dispatch an independent read-only verifier that is blind to the source. Ask whether the claim is CONFIRMED, REFUTED, or PARTIAL, require cited evidence and a concrete failure scenario, and invite nearby related findings.
The orchestrator makes the final decision. Keep confirmed findings, narrow partial findings to their proved core, and record refuted findings so later rounds do not repeat them. No fixer may receive an unverified finding.
Group surviving findings by shared files and subsystem. Same-file findings belong to one group. Every group receives an explicit owned-file set and the sibling-owned files it must not touch.
Before dispatching, create one isolated worktree and branch per group from the verified integration SHA. Never let parallel fixers edit the main checkout or overlapping files.
Each fixer must reconfirm its findings, implement only confirmed fixes, add or adjust focused tests, and run the permitted local gate. A refuted claim is reported with evidence rather than "fixed."
When remote publication is authorized, push each branch once, open its PR, and drive required CI to a terminal conclusion. Treat a green run as proof only when its head_sha equals the exact pushed SHA and all required gates passed.
Review and merge exact-SHA-green groups one at a time. Rebase remaining groups when the integration tree moves, then re-establish their proof. After the batch lands, run the integration branch's build/test gate. Repair only trivial fallout inline; route non-trivial regressions through a focused worktree.
Start a fresh Mode A exploration and lens derivation against the new integration SHA. Do not tell reviewers which round this is. Carry only the project laws plus the confirmed fixed/refuted ledger.
Stop when one condition is proved:
Report per wave: raw candidates, confirmed, partial, refuted, fixed, merged, and residual.
Locate the latest run directory under /tmp/codex-review-loop/ or use the user-provided path. Read the manifest and list completed outputs.
codex exec is the execution surface.Return:
Verification rungs:
Use if driving agent-browser for webpage interaction, screenshots, @ref snapshots, tabs, UI verification, CDP attach, Steel Browser, or cloud providers (Browser Use, Browserbase, Browserless, Kernel).
Use if verifying claimed-done work or auditing session/plan/branch completion with evidence.
Use if creating, redesigning, or merging a Claude skill, with research before writing SKILL.md.
Use if running deep multi-file research over 5+ entities or a market — wave-dispatched corpus.
Use if finishing a project — review and merge every branch/worktree into main, retire dead branches.
Use if reviewing a PR/diff, requesting review on your branch, triaging feedback, or delegating.