sd0xdev/sd0x-dev-flow/codex-code-review

Claude Code and agent skill by sd0xdev/sd0x-dev-flow

Trust tier 2
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Code review using Codex exec. Use when: PR review, code audit, second opinion on changes. Not for: doc review (use doc-review), security audit (use security-review). Output: severity-grouped findings + merge gate.

Install

npx vskill@latest install sd0xdev/sd0x-dev-flow/codex-code-review

SKILL.md

The same SKILL.md was published earlier as sd0xdev/sd0x-dev-flow/codex-code-review.

Codex Code Review

<!-- Security note: Bash(bash:) is broader than ideal; cannot scope to specific script paths until Claude Code #9354 resolves ${CLAUDE_PLUGIN_ROOT} in command frontmatter. Only invoke bash for project scripts (scripts/). -->

Trigger

  • Keywords: review, PR, code review, second opinion, audit, check

When NOT to Use

  • Document review (use doc-review)
  • Security-specific review (use security-review)
  • Test coverage review (use test-review)
  • Just want to understand code (use code-explore)

Variants

VariantCommandScopePre-checks
Fast/codex-review-fastDiff onlyNone
Full/codex-reviewDiff + local checkslint:fix + build
Branch/codex-review-branchFull branchNone

Shared Workflow

Resolve adapter → [Pre-checks if Full] → Collect changes & freeze baseline → Codex Review → Gate: derive sentinel × gate_reason (Step 4.5)
→ Ready × NONE → next gate | Blocked × IN_SCOPE_BLOCKING × untriggered → fix loop | other Blocked outcomes → E1/E2

Dual dispatch adds a second reviewer, and is opt-in:

--dual: … → Codex + Task in parallel → Merge findings in conversation (field-level)
→ Gate: derive sentinel × gate_reason (Step 4.5)
→ Ready × NONE → next gate | Blocked × IN_SCOPE_BLOCKING × untriggered → fix loop | other Blocked outcomes → E1/E2
Step 0: Reviewer Mode

Default: Codex alone. Do not launch a secondary reviewer. One reviewer, one verdict, noted in Step 4.5 — there is no mode field, no aggregate plane and no state machine behind this choice: which reviewers ran is a fact of the conversation, not of a store (hook-lightweighting § 3.3).

`--dual` (Branch variant only): adds a second reviewer in parallel; on the Codex-healthy path the merge is yours to perform in conversation (Step 4). A second opinion for releases, security-sensitive changes and public API surfaces — nothing persists it, nothing blocks on it, and the next invocation starts single again unless the flag is passed again. When Codex is out, there is no merge: the validated fallback report carries the gate alone (Step 3.5 Codex-failure path).

Variant--dual accepted?
Fast (/codex-review-fast)No — single only
Full (/codex-review)No — single only
Branch (/codex-review-branch)Yes, off unless passed

See @rules/auto-loop.md § Review Dispatch for why single is the default.

Step 0.5: Resolve the adapter locator (before any snapshot)

Resolve the adapter through references/codex-transport.md § Locator now, and let any auto-install that section prescribes happen here — before Step 1 freezes anything.

The ordering is the transport contract's, not a preference: in a consuming repository whose first review predates the installed adapter, § Locator's second step writes it into the tree. Resolve it at dispatch time instead and that write lands after Step 1 froze the changed-file set and the scope baseline, so the new untracked file is a tree change no baseline contains and no reviewer prompt lists — a review whose own snapshot went stale while it ran.

A setup-required locator outcome (no adapter at any step) stops here and is surfaced to the operator. It is not codex_fail: nothing was dispatched, so no fallback reviewer runs and no verdict is noted.

Step 0.7: Pre-checks (Full variant only)
bash
{LINT_FIX_COMMAND}
{BUILD_COMMAND}

These placeholders are resolved from the host project's CLAUDE.md or package.json scripts. Record results as LOCAL_CHECKS.

It is numbered before Step 1 for the same reason Step 0.5 is. {LINT_FIX_COMMAND} writes — a project-wide lint fix edits files, and a build can regenerate them. Run it after Step 1 and those edits land outside the frozen changed-file set and scope baseline: delivered changes every reviewer dispatch then misses or misclassifies as out-of-scope. Settle the tree first — adapter, then pre-checks — and freeze once, over the tree that will actually be reviewed. It was numbered Step 2 until 2026-09-04, which put it after the freeze.

If anything writes to the tree after Step 1 has run, Step 1 is redone in full. The baseline is frozen once per review session, and a baseline computed over a tree that has since changed is not the one this review is judging.

Step 1: Collect Change Metadata

Collect metadata only — Codex reads the actual diffs and file contents itself via sandbox access.

TASK_DESCRIPTION is the original task in one or two sentences, captured here and frozen for the whole review session — every first, fallback, and rotated dispatch carries the same value, and it is never rewritten from review findings (rules/codex-invocation.md, full contract in skills/codex-code-review/references/codex-invocation-contract.md — read it before the first dispatch; the three-part dispatch shape).

CHANGED_FILES is the frozen baseline set itself, not a narrower query — the two are computed from the same expression below, because a manifest that is a subset of the baseline hands the reviewer a shorter change than the one it is told to judge. The change that added this paragraph proves it: the transport adapter, its reference and their tests were all untracked, so git diff --name-only HEAD alone omitted every one of them.

VariantCollection Method
FastCHANGED_FILES: git diff --name-only HEAD ∪ git ls-files --others --exclude-standard + DIFF_STAT: git diff --stat HEAD, plus a line count for each untracked file (wc -l), which no diff stat covers
FullSame as Fast
BranchResolve MERGE_BASE once, per § Resolving the Branch base below, then use only that object id: CHANGED_FILES: git diff --name-only $MERGE_BASE ∪ the same uncommitted and untracked sets + DIFF_STAT: git diff --stat $MERGE_BASE + CURRENT_BRANCH + BASE_BRANCH + COMMIT_COUNT

Codex reads the diffs and file contents itself, and which command shows them depends on the variant and on whether the file is tracked — one blanket git diff HEAD -- <file> is wrong for two of the three cases:

WhatHow Codex reads it
Fast / Full, tracked filegit diff HEAD -- <file>
Branch, tracked filegit diff $MERGE_BASE -- <file> for the committed part, plus git diff HEAD -- <file> for what is uncommitted on top — the id resolved once below, never a fresh git merge-base here
Untracked file, any variantcat <file> — git has no diff for a file it does not track, so the whole file is the change

The variant's prompt template carries the same instruction; this row exists so the metadata step and the prompt cannot drift apart.

Scope baseline (frozen here). Compute the baseline file set once, now, and freeze it for the whole review session (skills/codex-code-review/references/scope-contract.md § Scope Baseline):

VariantBaseline set
Fast / Fullgit diff --name-only HEAD ∪ untracked (git ls-files --others --exclude-standard)
Branch (incl. --dual)git diff --name-only $MERGE_BASE ∪ the same uncommitted + untracked set — the same single id, not a second computation
Resolving the Branch base

`${BASE_BRANCH}` is resolved to an object id here, once, and only that id travels onward. A ref name is not safe to render into shell source: git accepts ;, backticks and parentheses in a valid ref, rev-parse --verify accepts such a ref, and placeholders are bound textually before the command runs — so double quotes around a rendered ref do not help, since the metacharacters are already in the source when the shell parses it. Only never rendering the ref does.

  1. Run the resolution with the ref as a shell-single-quoted literal, which suppresses expansion:

git merge-base -- 'the/resolved/ref' HEAD (an embedded apostrophe is written '\'').

  1. Verify the result is 40 hex characters before using it. Anything else is a parameter error:

abort and ask for an explicit base.

  1. Bind that id as MERGE_BASE and use it everywhere above and in every prompt. No later step

recomputes it — one baseline, one id, which is also what the frozen-baseline contract requires.

${BASE_BRANCH} itself still travels to the reviewer as metadata (a name in the prompt's Task and Scope sections); what it must never do is appear inside a command the reviewer will run.

${BASE_BRANCH} resolution (Branch variant): explicit argument first (e.g. /codex-review-branch origin/develop); else git symbolic-ref --short refs/remotes/origin/HEAD; else origin/main — verify each candidate with git rev-parse --verify before use. All candidates failing → abort as a parameter error and ask for an explicit base; never continue on an empty baseline (an empty baseline would misread every unmodified file as out-of-scope), and the abort is not a human exit. Record the resolved base and the frozen file list in the review report metadata, and inject the list into every reviewer prompt as SCOPE_BASELINE.

The frozen baseline is task-scoped and immutable: the initial reviewer, the inline secondary, --continue, and every same-task re-dispatch reuse the same list — no path recomputes it. The only growth is the user-named monotonic union of skills/codex-code-review/references/scope-contract.md § Scope Baseline; ordinary fix edits during a round never write back into it.

Step 1.1: Resolve the tier (required before dispatch)

The gate is tier-derived, and the reviewer has to be told which severities block — otherwise it emits ✅ Ready / ⛔ Blocked against its own assumption, and that is the verdict you note in Step 4.5. Resolve the tier first, then bind TIER and BLOCKING into the prompt:

TierBLOCKINGSource
fastP0@rules/auto-loop-project.md ## Tier
standard (default)P0/P1unset, unrecognized, or explicit
thoroughP0/P1/P2explicit, or the Branch variant, or a security / data-integrity change

The Branch variant is thorough by definition, so BLOCKING = P0/P1/P2 there regardless of project config — a P2 blocks a branch review. Escalation for a security or data-integrity change applies to every variant, and you say that you escalated.

Step 1.5: Feature Context & AC Detection (Spec-Driven Review)

Execute: bash scripts/resolve-feature.sh → parse JSON output.

FieldUse
has_requestsGate: only proceed if true
docs_pathGlob for request docs
confidenceRequire >= medium

If has_requests=true AND confidence in (high, medium):

  1. Glob ${docs_path}/requests/*.md, sort descending, take latest
  2. Read latest request doc
  3. Extract ## Acceptance Criteria section (parse - [ ] / - [x] items)
  4. Filter out quality-gate ACs matching: /codex-review-fast, /codex-review-doc, /codex-review, /precommit, /precommit-fast, /pr-review
  5. Cap: max 20 ACs (truncate with "... and N more" note)
  6. Build SPEC_CHECKLIST variable, set REQUEST_DOC_PATH

Graceful degradation: resolve-feature fails / no requests / no AC section / parse error → SPEC_CHECKLIST = null (skip silently).

Step 3: Dispatch

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
188
Repository forks
24
7-day trend score
26

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 25 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/sd0xdev/sd0x-dev-flow/codex-code-review/badge)](https://verified-skill.com/skills/sd0xdev/sd0x-dev-flow/codex-code-review)

Something wrong with this skill or its page? Tell us.