codex-plan-review.skill.md---
name: codex-plan-review
description: >
Cross-AI plan review using OpenAI Codex CLI. Sends implementation plans to Codex
for blind spot detection, then filters noise to surface only critical findings.
Triggers on "review my plan", "second opinion", "blind spot check", "check with codex",
or /codex-plan-review. Use before executing any multi-step plan.
---
# Codex Plan Review — Blind Spot Detection
You have a plan (or are about to finalize one). Before executing it, you're going to get a second opinion from OpenAI's Codex CLI to catch blind spots. Codex thinks differently than you do — it'll spot things you miss. But it also tends to over-engineer security and add unnecessary complexity. Your job is to be a smart filter: extract the critical insights, discard the noise.
**Requirements:** Codex CLI >= 0.100.0 (`codex -V` to check). Install with `npm install -g @openai/codex` if missing.
**Privacy note:** This skill gives Codex read access to project files in the working directory via `-C`. For sensitive or proprietary repos, confirm with the user before proceeding.
## When This Triggers
- You've just written or finalized an implementation plan
- The user asks for a "plan review", "second opinion", or "blind spot check"
- Before executing a multi-step plan that touches 3+ files
- The user explicitly invokes `/codex-plan-review`
## The Workflow
### Step 0: Preflight Check
Verify Codex is installed and meets the minimum version:
```bash
CODEX_RAW=$(codex -V 2>/dev/null) || { echo "ERROR: Codex CLI not installed. Install with: npm install -g @openai/codex"; exit 1; }
CODEX_VERSION=$(echo "$CODEX_RAW" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
if [ -z "$CODEX_VERSION" ]; then echo "ERROR: Could not parse Codex version from: $CODEX_RAW"; exit 1; fi
echo "Found: codex-cli $CODEX_VERSION"
```
### Step 1: Assess Complexity & Select Model
| Complexity | Files | Model | Reasoning |
|------------|-------|-------|-----------|
| LOW | 1-3 | spark (fast) | low |
| MEDIUM | 4-8 | config default | config default |
| HIGH | 9+ | non-spark (deeper) | high |
### Step 2: Prepare the Plan Document
Assemble a clear plan with: Objective, Key Files to Examine, Files to Modify/Create, Architecture Decisions, Constraints/Non-Goals, and Sequence.
### Steps 3-5: Build Request, Call Codex, Read Output
Run as a single bash command (variables are lost between separate calls):
```bash
PLAN_FILE=$(mktemp /tmp/codex-plan-XXXXXX) && mv "$PLAN_FILE" "${PLAN_FILE}.md" && PLAN_FILE="${PLAN_FILE}.md"
REQUEST_FILE=$(mktemp /tmp/codex-request-XXXXXX) && mv "$REQUEST_FILE" "${REQUEST_FILE}.md" && REQUEST_FILE="${REQUEST_FILE}.md"
OUTPUT_FILE=$(mktemp /tmp/codex-output-XXXXXX) && mv "$OUTPUT_FILE" "${OUTPUT_FILE}.md" && OUTPUT_FILE="${OUTPUT_FILE}.md"
cat > "$PLAN_FILE" << 'PLAN_EOF'
[Your assembled plan goes here]
PLAN_EOF
cat > "$REQUEST_FILE" << 'INSTRUCTIONS_EOF'
You are reviewing an implementation plan created by another AI assistant. Find CRITICAL blind spots only.
DO NOT suggest: style improvements, extra logging, unnecessary validation, security hardening beyond context, premature abstractions.
ONLY flag: runtime errors, broken functionality, data loss risks, missing integrations, wrong API assumptions, race conditions.
Limit to TOP 5 findings with file:line evidence.
INSTRUCTIONS_EOF
cat "$PLAN_FILE" >> "$REQUEST_FILE"
cat "$REQUEST_FILE" | codex exec --full-auto --ephemeral -C "$(pwd)" -o "$OUTPUT_FILE" -
echo "=== CODEX REVIEW OUTPUT ==="
cat "$OUTPUT_FILE"
echo "=== END OUTPUT ==="
rm -f "$PLAN_FILE" "$REQUEST_FILE" "$OUTPUT_FILE"
```
### Step 6: Filter — The Safety Net
| Keep | Discard |
|------|---------|
| Will cause a runtime error | "Consider adding" suggestions |
| Breaks existing functionality | Extra error handling |
| Data loss or corruption risk | Security hardening beyond threat model |
| Missing required step | Architectural preferences |
| Wrong API/schema assumption | Performance suggestions without evidence |
### Step 7: Present Findings
Format: Complexity assessed, model used, critical findings with file:line evidence, verdict (solid / needs adjustments).
If clean: "No critical blind spots detected. Plan is good to execute."
Source: github.com/Pricing-Logic/Claude-et-Codex