cmd-codex-review-plan
Get a second opinion on the current plan from Codex (codex exec headless mode) before leaving plan mode. Pipes the plan to codex, captures critique and gap analysis, then proposes a revised plan with an explicit changelog of what changed and what was rejected. Triggers on "/cmd-codex-review-plan", "review plan with codex", "ask codex about this plan", or before approving auto mode on an exit-plan prompt.
What this skill does
# Codex Review Plan <!-- omit in toc --> Use `codex exec` as an independent reviewer on the plan currently in scope. Codex sees only the plan (no conversation history), so its critique is a genuine outside perspective — useful right before exiting plan mode and switching to auto execution. - [When to use](#when-to-use) - [Instructions](#instructions) - [Codex prompt](#codex-prompt) - [Output format](#output-format) - [Notes](#notes) ## When to use - Right before approving "Yes, and use auto mode" on an `ExitPlanMode` prompt - Any time the user says "review plan with codex", "second opinion from codex", or `/cmd-codex-review-plan` - After a non-trivial plan has been drafted and the user wants an outside critique before execution ## Instructions ### 1. Locate the plan Use the most recent plan in conversation context — typically the body of the last `ExitPlanMode` call, or the latest plan markdown the user is reviewing. If multiple candidates exist, ask the user which one. **Do not invent or summarize** — pass the plan verbatim. ### 2. Write the plan to a tempfile Codex reads from stdin reliably only if the input is a file or a piped heredoc. Use a tempfile to avoid quoting issues: ```bash PLAN_FILE=$(mktemp -t codex-plan.XXXXXX.md) OUT_FILE=$(mktemp -t codex-review.XXXXXX.md) ``` Write the plan verbatim into `$PLAN_FILE` using the Write tool. ### 3. Run codex in headless review mode ```bash codex exec \ --sandbox read-only \ --skip-git-repo-check \ --color never \ --output-last-message "$OUT_FILE" \ - < "$PLAN_FILE" ``` Pass the prompt from [Codex prompt](#codex-prompt) as the initial argument, and the plan via stdin. Concretely: ```bash codex exec \ --sandbox read-only \ --skip-git-repo-check \ --color never \ --output-last-message "$OUT_FILE" \ "$(cat <<'PROMPT' You are reviewing an implementation plan written by another coding agent (Claude). The plan follows in the <stdin> block. Your job: 1. Identify GAPS — requirements, edge cases, failure modes, or dependencies the plan misses. 2. Identify RISKS — fragile assumptions, ordering hazards, breaking-change risks, test coverage holes. 3. Identify SIMPLIFICATIONS — anything over-engineered, premature abstraction, or scope that should be deferred. 4. Identify CONCRETE FIXES — for each issue, suggest the smallest change that addresses it. Constraints: - Do NOT rewrite the whole plan. Critique it. - Do NOT execute commands or modify files. This is a read-only review. - Be specific: cite file paths, phase numbers, or step numbers from the plan. - If the plan is solid, say so. Do not invent issues. Output format (markdown): ## Verdict One sentence: ship-as-is | minor-tweaks | needs-rework ## Gaps - [bullet per gap, with phase/file reference] ## Risks - [bullet per risk, with phase/file reference and severity: high/medium/low] ## Simplifications - [bullet per simplification opportunity] ## Concrete Suggestions - [numbered list of specific actionable changes to apply to the plan] ## What's Good - [1-3 bullets on what the plan gets right — keep this honest, not flattery] PROMPT )" < "$PLAN_FILE" ``` Stream codex's progress to the user as it runs (don't background it — the user wants to watch). Capture the final message from `$OUT_FILE`. ### 4. Present codex's raw feedback Show the contents of `$OUT_FILE` to the user verbatim under a heading: ```markdown ## Codex review > Independent review from `codex exec` — no conversation context, plan only. <contents of $OUT_FILE> ``` ### 5. Synthesize a revised plan Read codex's suggestions and decide, item by item, what to apply. Then produce: 1. **Revised plan** — the original plan with codex's accepted suggestions integrated. 2. **Changelog** — a table showing each codex suggestion and what you did with it. Don't blindly accept everything codex says. If a suggestion is wrong, irrelevant, or misunderstands context Claude has and codex doesn't, mark it rejected and explain why. ### 6. Cleanup ```bash rm -f "$PLAN_FILE" "$OUT_FILE" ``` ## Codex prompt The exact prompt is embedded in [step 3](#3-run-codex-in-headless-review-mode). Key requirements when adapting it: - Tell codex it's reviewing another agent's plan (sets expectations for tone) - Demand specific references (phase numbers, file paths) — vague critique is useless - Explicitly forbid command execution (read-only review) - Require a verdict line so the user can triage at a glance - Allow codex to say "looks good" — don't force it to manufacture issues ## Output format After codex returns, present the result as three sections in order: ### 1. Codex's raw review Quoted verbatim under a `## Codex review` heading. Don't paraphrase — the user wants codex's voice, not Claude's summary of codex. ### 2. Revised plan Same shape as the original plan (phases, action items, risks, etc.) with accepted changes integrated. Mark new or modified items with a leading marker so they're easy to spot: | Marker | Meaning | |--------|---------| | 🆕 | New item added based on codex feedback | | ✏️ | Existing item modified based on codex feedback | | ➖ | Item removed based on codex feedback | ### 3. Changelog Table with one row per codex suggestion: | S | Codex Suggestion | Decision | Reason | |---|------------------|----------|--------| | 🟢 | Add rollback step to phase 2 | Applied | Valid — the migration can fail mid-write | | 🟡 | Split phase 1 into two phases | Partial | Kept as one phase, but added explicit checkpoints | | 🔴 | Use a feature flag for the rename | Rejected | Overkill — the function is internal and has 2 callers | > 🟢 Applied · 🟡 Partial / modified · 🔴 Rejected · ⚪ Deferred to follow-up End with a one-line tl;dr of net changes (e.g., "_Added 1 phase, modified 2 steps, rejected 1 suggestion._"). ## Notes - **Codex needs auth** — if `codex exec` errors with auth issues, tell the user to run `codex login` and stop. - **Read-only sandbox** — codex cannot modify files even if it tries. This is intentional. - **`--skip-git-repo-check`** — lets the skill work outside git repos (e.g., scratch dirs). - **`--output-last-message`** — gives a clean final message without progress event noise. - **Don't loop** — one codex review per invocation. If the user wants another pass after revisions, they re-run the skill. - **Plan mode caveat** — if invoked from plan mode, the only file edits available are via Write/Edit on the tempfiles, which is fine. The Bash call to `codex exec` is allowed; it's just running an external tool, not modifying repo files.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.