원클릭으로
plan-refine
Iteratively refine the current Plan by applying Codex review feedback until Codex has no more issues to raise.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Iteratively refine the current Plan by applying Codex review feedback until Codex has no more issues to raise.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Publish agent research as a durable Markdown vault entry, optionally with a GitHub Gist share artifact.
Iteratively ask clarifying questions to enrich the current Plan before review.
Create, switch, list, and delete git worktrees with `git wt` (the git-wt CLI). Use when working on multiple branches in parallel, isolating an experiment in its own checkout, or whenever the user mentions worktrees or `git wt`.
Extract technical learnings from the session and save them to the learn repository.
Review the current plan by auto-selecting appropriate reviewer agents based on project characteristics.
Analyze session context and generate a targeted prompt for /compact to preserve important information.
| name | plan-refine |
| description | Iteratively refine the current Plan by applying Codex review feedback until Codex has no more issues to raise. |
| allowed-tools | Bash(codex exec *), Bash(ls *), Read, Edit |
Improve the latest plan file by running Codex review in a loop: each round, apply Codex's feedback to the plan and re-review. Stop when Codex signals no further issues, or when the iteration cap is reached.
./plans/ (created via Plan mode)codex CLI must be installed and authenticated (which codex succeeds)| Argument | Required | Default | Description |
|---|---|---|---|
| plan-name | No | — | Plan filename to refine (with or without .md). If omitted, ask the user to pick one interactively. |
| max-iterations | No | 8 | Hard cap on review rounds to prevent runaway loops |
Resolve <plan_path> using one of the two paths below.
If the user passed a plan-name argument:
./plans/, then append .md if the argument has no extension../plans/<normalized> exists. If it does not, list the available plans under ./plans/ and stop with a clear error — do NOT silently fall back to auto-selection.<plan_path> to the resolved path.List candidates:
ls -t ./plans/*.md 2>/dev/null
If the list is empty, report that ./plans/ has no markdown files and stop.
If exactly one candidate exists, use it directly and tell the user which file was picked.
If two or more candidates exist, use AskUserQuestion to let the user choose. Present the filenames (most recently modified first) as options, with a short preview (e.g. the plan's H1 title) as the option description when easily available. Wait for the user's answer; do NOT guess.
Once <plan_path> is set, use the Read tool to load it before entering the refinement loop.
Run the following cycle up to max-iterations times:
+-> Run Codex review on <plan_path>
| |
| v
| Parse review output
| |
| +--> Contains "NO_FURTHER_ISSUES" marker? --> exit loop
| |
| v
| Edit the plan to incorporate feedback
| |
| v
| Re-read the updated plan
| |
+-- Next iteration
Invoke Codex directly with a prompt that forces a deterministic termination signal. Use --sandbox read-only so Codex cannot modify the plan itself — only Claude edits the plan based on the feedback.
codex exec --sandbox read-only "$(cat <<'EOF'
You are reviewing a software implementation plan. Read the file at <plan_path> and critique it from these angles:
1. Technical correctness and feasibility
2. Missing steps, edge cases, or error handling
3. Inconsistencies or ambiguities
4. Risks, unclear ownership, or untested assumptions
5. Concrete improvements (name specific sections / lines)
Output format:
- If substantive issues remain, list them as a numbered list. Each item: (a) what is wrong, (b) why it matters, (c) a concrete suggested fix. Do not include the marker below.
- If the plan is solid and you have no remaining substantive issues, output exactly one line: NO_FURTHER_ISSUES
- Do not nitpick wording. Only raise issues that would materially affect implementation quality.
EOF
)" < /dev/null
Critical: the < /dev/null redirect is mandatory. When stdin is not a TTY (which is always the case inside Claude Code's Bash tool), codex exec treats stdin as piped input to be appended to the prompt and will block forever waiting for EOF. Redirecting from /dev/null closes stdin immediately so Codex stops waiting and proceeds. Never omit this, even when using run_in_background.
Substitute <plan_path> with the actual path. Do NOT use -m — let Codex pick its default model.
Run the command as a background Bash job (run_in_background: true) to avoid the 10-minute foreground timeout — long reviews can exceed that cap. After starting the job:
NO_FURTHER_ISSUES, exit the loop successfully.For each substantive issue in the review:
<plan_path> — clarify ambiguities, add missing steps, tighten error handling, resolve inconsistencies.max-iterations rounds (default 8). If hit, exit the loop and report that Codex still had open issues.codex exec returns a non-zero exit code, stop the loop and report the exit code plus stderr. Do not silently retry.Report to the user in this format:
=== Plan Refine Complete ===
Plan file: <plan_path>
Rounds completed: <N>
Termination reason: <no-further-issues | max-iterations-reached | no-progress | codex-error>
Key changes applied:
- <bullet point per substantive edit>
Final Codex verdict:
<last review output, or "NO_FURTHER_ISSUES">
| Situation | Response |
|---|---|
| No plan file found | Notify that ./plans/ has no markdown files and stop |
codex CLI not on PATH | Instruct the user to install and authenticate codex |
codex exec runs very long | Expected — it's backgrounded. Keep waiting for the completion notification, don't kill it |
codex exec hangs with 0 bytes output | Almost always a missing < /dev/null. Kill it, add the stdin redirect, retry |
| Authentication error | Guide the user to check codex login status |
| Plan edit fails | Report the error and stop — do not continue reviewing stale content |
./plans/ (relative to project root)--sandbox read-only: it cannot modify the plan — only Claude does, based on Codex feedbackNO_FURTHER_ISSUES sentinel is the sole termination signal; never infer "good enough" from vibes/dig (which fills gaps via user Q&A) and before /plan-review (which produces a final report)