skills/codex-review/SKILL.md
Review implementation plans or local code changes with OpenAI Codex CLI. Use when the user wants a second opinion on a plan before implementation, or to validate local un-pushed code changes after implementation.
npx skillsauth add agmangas/agent-skills codex-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Send the current implementation plan or local code changes to OpenAI Codex for review.
Default behavior is review-only: Claude gathers Codex feedback and shows it to the user without changing the plan or code.
If the user explicitly asks for iterative refinement, or invokes /codex-review --iterate, Claude may revise the plan (or code) and re-submit it until Codex returns VERDICT: APPROVED or 5 rounds are reached.
/codex-review during or after plan mode/codex-review code or asks to review local changes/codex-review plan or /codex-review code/codex-review o4-mini/codex-review --iterate/codex-review code --iterate o4-miniIf --iterate is not present and the user did not explicitly ask for automatic refinement, use review-only mode.
When invoked, perform the following workflow:
MODE=review-only by default.MODE=iterate only if the user explicitly asked for automatic revision/re-review, or provided --iterate.gpt-5.4 by default.TARGET: plan or code. Default to plan unless the user explicitly asks to review code/changes, or provides the code argument.Example initialization:
MODE=review-only
MODEL=gpt-5.4
TARGET=plan
ROUND=1
Generate a unique ID to avoid conflicts with other concurrent Claude Code sessions:
REVIEW_ID=$(uuidgen | tr '[:upper:]' '[:lower:]' | head -c 8)
Use this for all temporary paths:
/tmp/claude-plan-${REVIEW_ID}.md/tmp/claude-diff-${REVIEW_ID}.diff/tmp/codex-review-${REVIEW_ID}-round-1.md/tmp/codex-review-${REVIEW_ID}-round-N.md/tmp/codex-launch-${REVIEW_ID}.log/tmp/codex-session-${REVIEW_ID}.txtRegister cleanup before any Codex command so temporary files are removed on success, failure, or cancellation:
cleanup() {
rm -f /tmp/claude-plan-${REVIEW_ID}.md \
/tmp/claude-diff-${REVIEW_ID}.diff \
/tmp/codex-review-${REVIEW_ID}-round-*.md \
/tmp/codex-launch-${REVIEW_ID}.log \
/tmp/codex-session-${REVIEW_ID}.txt
}
trap cleanup EXIT
If TARGET is plan:
/tmp/claude-plan-${REVIEW_ID}.md.If TARGET is code:
git diff HEAD to capture all uncommitted changes. If the user explicitly wants to review un-pushed commits, run git diff @{u}..HEAD./tmp/claude-diff-${REVIEW_ID}.diff.Run Codex CLI in non-interactive mode and capture both the review body and the launch metadata.
If TARGET is plan:
codex exec \
-m ${MODEL} \
-s read-only \
-o /tmp/codex-review-${REVIEW_ID}-round-1.md \
"Review the implementation plan in /tmp/claude-plan-${REVIEW_ID}.md. Focus on:
1. Correctness - Will this plan achieve the stated goals?
2. Risks - What could go wrong? Edge cases? Data loss?
3. Missing steps - Is anything forgotten?
4. Alternatives - Is there a simpler or better approach?
5. Security - Any security concerns?
Be specific and actionable. If the plan is solid and ready to implement, end your review with exactly: VERDICT: APPROVED
If changes are needed, end with exactly: VERDICT: REVISE" \
2>&1 | tee /tmp/codex-launch-${REVIEW_ID}.log
If TARGET is code:
codex exec \
-m ${MODEL} \
-s read-only \
-o /tmp/codex-review-${REVIEW_ID}-round-1.md \
"Review the code changes in /tmp/claude-diff-${REVIEW_ID}.diff. Act as a Senior Software Engineer reviewing a Pull Request. Focus on:
1. Bugs and Logic flaws
2. Security vulnerabilities
3. Performance issues
4. Unhandled edge cases
5. Adherence to best practices
Be specific and actionable. If the code is solid and ready to commit, end your review with exactly: VERDICT: APPROVED
If changes are needed, end with exactly: VERDICT: REVISE" \
2>&1 | tee /tmp/codex-launch-${REVIEW_ID}.log
Immediately parse the launch log, extract the exact session id: <uuid> value, and persist it to /tmp/codex-session-${REVIEW_ID}.txt.
Example:
REVIEW_ID="${REVIEW_ID}" python - <<'PY'
import os
from pathlib import Path
import re
review_id = os.environ["REVIEW_ID"]
launch_log = Path(f"/tmp/codex-launch-{review_id}.log")
session_file = Path(f"/tmp/codex-session-{review_id}.txt")
match = re.search(r"session id:\s*([0-9a-fA-F-]+)", launch_log.read_text())
if not match:
raise SystemExit("Could not determine Codex session ID")
session_file.write_text(match.group(1) + "\n")
PY
Do not use --last, which may resume the wrong session if multiple reviews are running concurrently.
Notes:
gpt-5.4 as the default model unless the user overrides it.-s read-only so Codex can inspect context but cannot modify anything./tmp/codex-review-${REVIEW_ID}-round-1.md.## Codex Review - Round N (model: [selected model], target: [plan/code])
[Codex's feedback here]
MODE=review-only → go to Step 7MODE=iterate → go to Step 10MODE=iterate → go to Step 8 (Revise and Re-submit)MODE=review-only → stop after presenting the feedbackMODE=iterate and max rounds (5) are reached → go to Step 10 with a note that max rounds were reachedApproval must be explicit. Never infer approval from a generally positive tone.
If MODE=review-only, end after round 1 with a concise summary:
## Codex Review - Final (model: [selected model])
**Status:** Review completed. No automatic changes were made.
[Short summary of Codex's main concerns or approval]
If Codex returned VERDICT: APPROVED, say so explicitly.
If Codex returned VERDICT: REVISE, say the plan/code was reviewed but not approved.
If the result was unresolved, say the verdict was unclear and manual follow-up is needed.
If MODE=iterate and Codex returned VERDICT: REVISE, revise the target based on the feedback:
plan: Rewrite /tmp/claude-plan-${REVIEW_ID}.md with the revised plan.code: Apply the fixes to the actual codebase files, then re-run git diff HEAD > /tmp/claude-diff-${REVIEW_ID}.diff to capture the updated state.### Revisions (Round N)
- [What was changed and why, one bullet per Codex issue addressed]
Resume the existing Codex session so it has full context of the prior review:
CODEX_SESSION_ID=$(REVIEW_ID="${REVIEW_ID}" python - <<'PY'
import os
from pathlib import Path
review_id = os.environ["REVIEW_ID"]
print(Path(f"/tmp/codex-session-{review_id}.txt").read_text().strip())
PY
)
If TARGET is plan:
codex exec resume ${CODEX_SESSION_ID} \
"I've revised the plan based on your feedback. The updated plan is in /tmp/claude-plan-${REVIEW_ID}.md.
Here's what I changed:
[List the specific changes made]
Please re-review. If the plan is now solid and ready to implement, end with: VERDICT: APPROVED
If more changes are needed, end with: VERDICT: REVISE" \
> /tmp/codex-review-${REVIEW_ID}-round-${ROUND}.md 2>&1
If TARGET is code:
codex exec resume ${CODEX_SESSION_ID} \
"I've revised the code based on your feedback. The updated diff is in /tmp/claude-diff-${REVIEW_ID}.diff.
Here's what I changed:
[List the specific changes made]
Please re-review. If the code is now solid and ready to commit, end with: VERDICT: APPROVED
If more changes are needed, end with: VERDICT: REVISE" \
> /tmp/codex-review-${REVIEW_ID}-round-${ROUND}.md 2>&1
Read the full round file /tmp/codex-review-${REVIEW_ID}-round-${ROUND}.md and then return to Step 6.
Do not pipe through tail or otherwise truncate the response. The verdict line must remain visible in the captured file.
If resume ${CODEX_SESSION_ID} fails, tell the user and either:
codex exec that includes the latest revised plan/diff plus a concise summary of prior concernsDo not silently continue without telling the user that session continuity was lost.
Once approved (or max rounds reached):
## Codex Review - Final (model: [selected model], target: [plan/code])
**Status:** ✅ Approved after N round(s)
[Final Codex feedback / approval message]
---
**The [plan/code] has been reviewed and approved by Codex. Ready for your approval to [implement/commit].**
If max rounds were reached without approval:
## Codex Review - Final (model: [selected model], target: [plan/code])
**Status:** ⚠️ Max rounds (5) reached — not fully approved
**Remaining concerns:**
[List unresolved issues from last review]
---
**Codex still has concerns. Review the remaining items and decide whether to proceed or continue refining.**
Review-only:
Round 1: Claude sends plan/code -> Codex reviews -> Claude reports verdict and feedback
Iterative:
Round 1: Claude sends plan/code -> Codex reviews -> REVISE?
Round 2: Claude revises -> Codex re-reviews (resume session) -> REVISE?
Round 3: Claude revises -> Codex re-reviews (resume session) -> APPROVED
Max 5 rounds in iterative mode. Each round preserves Codex's conversation context via the stored session ID when resume succeeds.
plan unless the user specifies code or asks to review changesVERDICT: APPROVEDVERDICT: REVISE means the plan/code is not approved yetgpt-5.4. Accept model override from the user's arguments (e.g., /codex-review o4-mini)npm install -g @openai/codexdevelopment
Use when the user wants an AI coding agent to offload suitable low-risk, bounded codebase browsing, inventory, extraction, log triage, or simple single-file reasoning tasks to a local LM Studio model while keeping high-level reasoning and final decisions in the main model.
development
Use when the user explicitly asks for plain language, less jargon, a concise explanation, mentor-style codebase guidance, or an explanation for a developer who knows software engineering but is new to the project or domain.
development
Use when preparing files for NotebookLM, organizing documents into a knowledge base, converting formats for NotebookLM compatibility, or reducing a large document collection to fit NotebookLM's 50-source limit. Scores and prioritizes sources, performs strategic merging (time-series, topic-based, format consolidation), converts unsupported formats (PPTX to PDF, XLSX to CSV), applies flat structure with descriptive snake_case names, and optimizes for RAG retrieval performance.
tools
Analyze git history for commit style, stage changes logically, and commit without pushing. Use when the user wants to commit changes matching their repository's existing style.