CO

codex-code-review

Automates the code review process by iteratively analyzing uncommitted changes for critical bugs.

Install

mkdir -p .claude/skills/codex-code-review-tykisgod && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16044" && unzip -o skill.zip -d .claude/skills/codex-code-review-tykisgod && rm skill.zip

Installs to .claude/skills/codex-code-review-tykisgod

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Cross-model code review via Codex CLI — reviews uncommitted changes by default, loops until no critical issues remain. Use after /qq:test passes, before /qq:commit-push.
169 charsno explicit “when” trigger
Advanced

Key capabilities

  • →Review uncommitted changes or full branch diffs.
  • →Loop through automated review rounds until no critical issues remain.
  • →Send diffs to Codex for review with specific prompts.
  • →Read and summarize review results by severity.
  • →Dispatch subagents to verify each finding in depth.
  • →Clean up gate markers after the review loop.

How it works

The skill automates code review by sending code changes to Codex, summarizing findings, and dispatching subagents for in-depth verification. It loops until critical issues are resolved.

Inputs & outputs

You give it
Git diffs, uncommitted changes, or a specific file list for code review.
You get back
Summarized review results, verified findings, and recommendations for next steps.

When to use codex-code-review

  • →Reviewing uncommitted feature code
  • →Analyzing branch diffs before merging
  • →Automated code quality checks

About this skill

Run qq scripts as ${CLAUDE_PLUGIN_ROOT}/bin/<name>: they are not on PATH, so a bare code-review.sh exits 127.

Respond in the user's preferred language (detect from their recent messages, or fall back to the language setting in CLAUDE.md).

Workflow: take --workflow <name> from $ARGUMENTS if present, else run qq-config.py field workflow. On prototype-loop, run the single round of shared/prototype-loop.md §Code review instead of the loop below (it ends with recording the review and, when the work is finished, §Closeout); on heavy-review (the default), follow this file as written.

Arguments: $ARGUMENTS

  • No arguments: review uncommitted changes (default)
  • --base <branch>: full branch diff against a base
  • --commits: review only the most recent commit
  • --files "a.cs b.cs": explicit file list
  • --spec <path> (repeatable): also check the changes against these specs (design doc, plan, or any doc that records the user's decisions)

Review Scope Selection (no scope argument)

--spec, --prompt, and the other flags do not choose the scope. Unless $ARGUMENTS has --base, --commits, or --files, pick the scope below and pass it along with the other flags. --auto belongs to this skill and the script ignores it; --workflow <name> the script uses only to decide whether to open the review gate.

Default: uncommitted changes. Run { git diff --name-only HEAD -- '*.cs'; git ls-files --others --exclude-standard -- '*.cs'; } | sort -u to get the changed and new files.

Override order:

  1. User specified a scope (e.g. "review Phase 8") → follow user intent
  2. No uncommitted changes but branch has commits → git diff --name-only develop...HEAD -- '*.cs'
  3. User says "review the whole branch" → --base develop

Pass the file list to the review script as --files.

Spec Check

When the changes finish a feature or a milestone, also pass its design doc and plan with --spec (next to the scope from above). The review then also lists what the specs ask for that the code does not do, what it does differently, and protections or restrictions nobody asked for. Skip it for small fixes. Rounds 2+ use the same scope (recomputed the same way, plus every file this review's fixes created or changed) and the same flags, without --spec: the [Spec] items were listed and verified in round 1.

Execution Flow

1. Review Loop

Loop automatically, no need to ask the user each round. Stop when any is true:

  • No [Critical] issues in Codex review results, and no code was written for [Spec] items this round
  • 5 rounds completed
  • Two consecutive rounds raised no new [Critical] issues (only repeats of rejected ones or of items on the "Needs the user's decision" list)

Each round:

a. Send to Codex for Review

If qq-policy-check.sh is available, first run it on the same changed .cs files and treat its deterministic findings as established.

Run in the background (Bash tool, run_in_background: true):

${CLAUDE_PLUGIN_ROOT}/bin/code-review.sh $ARGUMENTS

The script runs codex exec on a diff it builds, with the Unity best-practice checklist in the prompt (sent on stdin; long argv is truncated on Windows), at the model's highest reasoning level by default. It always adds a test-quality section (and a spec-conformance section with --spec), even with a custom --prompt; don't repeat them in your round-2 prompt. Results go to stdout and Docs/qq/<branch-name>/codex-code-review_<timestamp>.md.

Override reasoning effort per run with --effort <level> (any level the model supports, e.g. high, xhigh, ultra; config inherits ~/.codex/config.toml) or globally via the QQ_CODEX_EFFORT env var. If Codex answers 400 "model is not supported when using Codex with a ChatGPT account", the CLI is usually older than the model: npm i -g @openai/codex@latest.

A review takes 5-15 minutes and you are notified when it finishes; meanwhile you can keep talking with the user.

From round 2 onward: If the previous round had findings deemed over-engineered, append --prompt to the round-2 arguments (see Spec Check):

${CLAUDE_PLUGIN_ROOT}/bin/code-review.sh <round-2 arguments> --prompt "Review these code changes using the same criteria as round 1 (bugs, architecture, performance, security, style). Additional context: the following suggestions from the previous round were deemed over-engineered and replaced with simpler solutions: <list items and rationale>. Do not re-suggest more complex approaches unless the simpler version introduces a real defect. Classify by severity: [Critical] [Moderate] [Suggestion]."

b. Read and Summarize Review Results

Read the output file and summarize the findings for the user by severity ([Critical], [Moderate], [Suggestion]), with any [Spec] items (only with --spec) listed apart from the severities.

c. Independent Verification

Verify every critical and moderate finding with a subagent, not with a quick look of your own. Verify Missing, Wrong, and Unrequested [Spec] items the same way, passing the spec paths. Needs-runtime-check items and the not-due-yet line are not verified: give the user at most 5 runtime checks (the likeliest to be wrong); the rest stay in the review file.

In a Unity project, work out the live Editor channel once — qq-unity-cli.py channel --project "$PWD" prints unity-cli (calls go through unity command --project-path "$PWD" --json --no-banner …), tykit or none; see shared/unity-live-state.md — and name it in each verifier's prompt (on tykit, also give it shared/tykit-reference.md). Item 7 of the verification prompt says how a verifier uses it.

Dispatch the verifiers with the Agent tool (subagent_type: "general-purpose", model: "opus"). By default hand all of this round's findings to one verifier, which gives a verdict for each; split them into a few groups verified in parallel only when there are too many for one agent to check properly. Each prompt must include the original findings (verbatim), relevant file paths, and the instructions from ../../shared/verification-prompt.md.

The review script leaves a gate: Edit/Write on .cs and Docs/*.md files stays blocked until you write the number of verifiers to it and that many have returned. Write it right after dispatching them:

source "${CLAUDE_PLUGIN_ROOT}/scripts/platform/detect.sh"
if qq_session_id && [[ -f "$QQ_TEMP_DIR/review-gate-$QQ_SESSION_ID" ]]; then
  IFS=: read -r ts count _ < "$QQ_TEMP_DIR/review-gate-$QQ_SESSION_ID"
  echo "${ts}:${count}:N" > "$QQ_TEMP_DIR/review-gate-$QQ_SESSION_ID"
fi

(N = the number of verification subagents dispatched. The gate file is per session; if this session has none, there is nothing to write.)

Aggregation: After all subagents return, present each finding's verdict and evidence to the user.

d. Fix the Code

  • For each confirmed critical issue, locate and fix the code
  • For findings marked confirmed but over-engineered, fix using the simpler alternative, not Codex's original suggestion
  • For confirmed moderate issues, fix at discretion
  • Fix a bug by correcting the logic or the numbers. Protections, added restrictions, and scope cuts are the user's call (shared/user-decisions.md): if the only fix you see is one of them, or a confirmed Unrequested [Spec] item is one without the user's words, put it on the "Needs the user's decision" list and keep the normal rule in the code
  • Confirmed Missing or Wrong [Spec] items: finish or fix them (not-due-yet items wait for their milestone); if one is too big for this pass, list it in the handoff, never drop it silently
  • After this round's fixes, compile and run the tests covering the changed code (/qq:test with the narrowest scope)
  • Present a summary of changes to the user

Test failures unrelated to this change (e.g. existing bugs in other modules): ask the user whether to investigate and fix them, or note them and continue the review. Don't decide on your own that they can be skipped.

e. Determine Whether to Continue

  • If this round had [Critical] issues confirmed and fixed → automatically start the next round (back to a)
  • If every [Critical] this round was rejected and nothing was fixed → end the loop and report the rejections with their reasons
  • If you wrote code for [Spec] items this round → run one more round (see Spec Check) so that code gets reviewed, even with no [Critical] issues
  • If this round and the previous one raised no new [Critical] issues (only repeats of rejected ones or of items on the "Needs the user's decision" list) → output final status and end the loop
  • Otherwise, if this round had no [Critical] issues → output "Review passed" and end the loop
  • If 5 rounds are complete → output final status and end the loop

Output === Round N/5 === at the start of each round.

2. Clean Up Gate

After the review loop ends, close the review gate.

If the review passed, meaning the loop ended with no confirmed [Critical] left unfixed (rejected ones don't count), first record that for this session so /qq:go stops recommending the review. Do it even when a round had nothing to verify: no verifier was dispatched then, so nothing else writes this record. Skip it when 5 rounds ran out with a confirmed [Critical] still open, or when one is waiting on the user's decision:

"${CLAUDE_PLUGIN_ROOT}/bin/qq-run-record.py" record --project . --stage review_gate --command "/qq:codex-code-review" --status verified --state-only

Then, however the loop ended, remove the gate:

source "${CLAUDE_PLUGIN_ROOT}/scripts/platform/detect.sh"
if qq_session_id; then rm -f "$QQ_TEMP_DIR/review-gate-$QQ_SESSION_ID"; fi

Handoff

After the review loop ends,


Content truncated.

When not to use it

  • →When the user wants to blindly trust Codex review results without verification.
  • →When the user wants to skip verification steps for critical or moderate issues.
  • →When the user wants to merge code without addressing review findings.

Prerequisites

Codex CLI

Limitations

  • →It requires Codex CLI to be configured.
  • →It does not allow editing code until findings are verified.
  • →It does not blindly trust Codex review results; verification is mandatory.

How it compares

This skill provides an automated, iterative, and verified code review process using an AI model, which is more thorough and consistent than manual code reviews alone.

Compared to similar skills

codex-code-review side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
codex-code-review (this skill)07moReviewAdvanced
resolve-conflicts8112moReviewIntermediate
dependency-upgrade268moReviewIntermediate
git-commits217moNo flagsBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry