원클릭으로
codex-review-loop
// Adversarial PR code review using Codex CLI. Codex review (~20-50 min) -> structured findings -> HITL approval -> fix loop.
// Adversarial PR code review using Codex CLI. Codex review (~20-50 min) -> structured findings -> HITL approval -> fix loop.
Project code conventions reference. Covers typing, structure, DI, testing, and anti-pattern rules for module implementation.
OpenSpec context documentation policy: keep requirements in spec.md and capture narrative context in context/overview/rationale docs under openspec/specs. Use when creating or updating OpenSpec docs, spec context, or onboarding/guide documentation.
| name | codex-review-loop |
| description | Adversarial PR code review using Codex CLI. Codex review (~20-50 min) -> structured findings -> HITL approval -> fix loop. |
| metadata | {"author":"codex-lb","version":"2.0.0","argument-hint":"[--pr <N>] [--base <branch>] [--uncommitted]"} |
Adversarial code review via Codex CLI, structured finding analysis, HITL-gated fix loop, optional re-verification.
--pr <N> — review PR number N (default: auto-detect most recent open PR)--base <branch> — review changes against base branch--uncommitted — review uncommitted local changesDetermine the review target and extract the base branch.
gh pr view / gh pr list to resolve base branch
and display PR metadata (title, file count, additions/deletions).--base): Use specified base branch directly.--uncommitted): Review working tree changes.If no argument is given, auto-detect the user's most recent open PR and confirm.
Launch the adversarial review as a background process.
run_in_background=true:
bash <skill-dir>/scripts/codex-subagent.sh --base <branch>
Note: Codex CLI v0.105.0+ does not support combining --base/--commit
with a custom prompt. The built-in review logic is used automatically.
For --uncommitted mode (no diff target), pipe stdin for custom instructions:
cat <prompt-file> | bash <skill-dir>/scripts/codex-subagent.sh --uncommitted
| Exit code | Meaning | Action |
|---|---|---|
| 0 | Success | Proceed to Phase 3 |
| 1 | Codex error | Show error, offer retry or abort |
| 127 | codex not found | Guide: npm i -g @openai/codex |
| Variable | Purpose |
|---|---|
CODEX_REVIEW_MODEL | Override Codex model |
CODEX_REVIEW_REASONING | Override reasoning effort |
Parse the raw Codex output into structured findings.
references/schemas/review-findings.md — field definitions,
severity/category/effort enums, status lifecycle.agents/skills/project-conventions/conventions.md —
project coding conventions to cross-referencetypingconventionarchitecturetestingPresent all findings to the user as a summary table (ID, severity, category, file:line, title, effort).
Ask the user to choose a fix scope:
For each approved finding, execute an atomic fix-verify-commit cycle.
uvx ruff check .uvx ruff format --check . (auto-fix and re-check if needed)uv run ty checkuv run pytest (mapped test files, or full suite if no mapping found)fix(review): P{i} - {title}skipped, continue to next.After all fixes are committed, automatically re-run the Codex review to check for regressions or new issues introduced by the fixes.
--base <branch>) against the same base.wont_fix and skip in subsequent iterations.At each re-review result, the user may choose:
Output a summary including: