codex/skills/refine-plan/SKILL.md
Iteratively review and revise a planning artifact until no new findings survive evaluation. Supports plans, shells, and specs. Use when the user asks to "refine the plan", "refine the shells", "refine this spec", "iterate on the plan", "iterate on the shells", "tighten the plan", "tighten the shells", "tighten the spec", "improve the plan", "improve the shells", or "improve the spec".
npx skillsauth add tobihagemann/turbo refine-planInstall 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.
Loop the review pipeline over a planning artifact until no new findings are accepted. Writes back to the artifact file(s) in place. Supports plans, shells, and specs.
At the start of every invocation (including re-runs from Step 5), use update_plan to track each step, restating any remaining steps of a parent workflow alongside them:
$review-plan skill$evaluate-findings skill$apply-findings skill$refine-plan skill if changed$draft-plan just ran, type is plan).turbo/ for existing artifacts. If multiple types exist, use request_user_input.turbo/plans/<slug>.md.turbo/plans/*.md. If exactly one file exists, use it.turbo/plan.md if .turbo/plans/ does not exist$turboplan (for a new task) or $pick-next-shell (for existing shells) and stop.turbo/shells/<slug>-*.md.turbo/specs/*.md. If exactly one, derive slug and glob for shells$draft-shells first and stopFor shells, read each shell file and extract from its YAML frontmatter: spec (source spec path) and depends_on. Verify the source spec exists. State the spec path, number of shells, and each shell's filename.
.turbo/specs/<slug>.md.turbo/specs/*.md. If exactly one, use it.turbo/spec.md if .turbo/specs/ does not exist$draft-spec first and stopIf multiple candidates exist and the choice is non-obvious, use request_user_input.
State the resolved path(s) before continuing.
Loop state lives at .turbo/loops/<slug>.md — slug from the resolved artifact; for shells, use the source spec's slug so structural rounds cannot rename the ledger; for a legacy single-file fallback, use the file's basename. At the start of every invocation, read the ledger if it exists.
Status: line is closed): write a fresh ledger with Status: active, then attempt create_goal with the objective: "Run the $refine-plan loop on <artifact path(s)> until converged: a run with no changes, a prose-only round, or remaining findings that do not justify another re-run. Loop state: .turbo/loops/<slug>.md; re-read it after any context compaction and do not re-adjudicate findings it records as rejected. Mark this goal complete when the loop converges." If an unfinished goal already exists, an outer workflow owns it; continue without creating one.Status: active): this invocation is the iteration after the last one the ledger records, whether a Step 5 re-run or a resumption after an interruption. Continue from the recorded state. If no unfinished goal exists, attempt create_goal with the same objective as a fresh loop.Status: closed; if this loop created the goal, mark it complete with update_goal. An inherited goal stays active for the outer workflow. A halt on an unresolved failure leaves Status: active and the goal untouched, so the next invocation resumes the recorded state.$review-plan SkillRun the $review-plan skill on the resolved artifact.
Always run this step even if the artifact looks polished.
$evaluate-findings SkillRun the $evaluate-findings skill on the review findings from Step 2.
$apply-findings SkillRun the $apply-findings skill on the evaluated results.
$refine-plan Skill if ChangedCheck whether the artifact file(s) were edited during Step 4. Any edit counts.
Iteration 1 is the initial run; iteration 2 is the first auto-re-run; and so on. The loop is not capped; it terminates on its own: when a run makes no changes, when a round makes only prose-only edits, or when you judge a further re-run pointless.
If changes were made, classify what Step 4 edited:
$refine-plan again by reading and following the installed skill instructions, passing the artifact type and resolved path. If the round contains both structural and prose-only edits, treat it as structural and re-run automatically.If changes were made but you judge a re-run unnecessary, output a summary of what changed and your reasoning for stopping, then stop instead of re-running.
Judge convergence by the trend across iterations: when rounds have stopped surfacing defects (contradictions, infeasible steps, missing requirements) and keep surfacing improvements of kinds earlier rounds already applied, a further re-run is pointless even though the edits were structural. A round that surfaces no defects is the termination signal; never add a confirmation round, an extra reviewer, or review steps beyond this skill's own.
Judge the kind of surviving defect as well as the trend. Once earlier rounds have drained the design- and requirement-level defects and a round's findings are dominated by claims that a named identifier does not exist or does not match its declaration, the artifact has passed the point where reviewing it as text pays, even when the count is rising and every finding is genuine. Implementation surfaces that class immediately; a further re-run is pointless. Expect any round that adds mechanism to seed defects at the seams it creates.
When the same class of defect recurs across iterations, stop patching the individual instance and instead write the root-cause invariant into the artifact itself, enumerating the worked failures it must prevent. In the same pass, re-read the whole artifact against the new invariant and fix every instance it catches, including text written before the invariant existed. Treat recurrence on a new axis of the same invariant as a signal that the invariant is incomplete: widen it to cover the new axis rather than assuming the latest fix failed.
The re-invocation is a full, fresh run of this skill. Every step (1-5) executes with its own task tracking and skill invocations.
Then call update_plan to mark this step completed and continue with the next step of the active workflow.
depends_on, added or removed spec requirement coverage$evaluate-findings is a judgment gate that must run before $apply-findings touches the artifact. Each step must invoke its designated skill by reading and following the installed skill instructions..turbo/, the artifact file(s) are the only files that should change. For shells, do not modify the source spec.development
Apply a UX lens to a user-facing change: whether it serves the user's real goal and whether the path through it holds together, using the Understanding, Bridging, and Flowing contexts. Use when scoping, planning, or assessing any change that affects what a user sees or does. Loaded as a lens during planning and assessment.
development
Apply a UX lens to a user-facing change: whether it serves the user's real goal and whether the path through it holds together, using the Understanding, Bridging, and Flowing contexts. Use when scoping, planning, or assessing any change that affects what a user sees or does. Loaded as a lens during planning and assessment.
development
Assess project-wide structural technical debt: complexity hotspots, deprecated API usage, duplication clusters, and architecture rot. Ranks findings by impact and refactor effort into a report at .turbo/technical-debt.md. Use when the user asks to "assess technical debt", "find technical debt", "review technical debt", "what should we refactor", "find refactoring candidates", "where is the code rot", or "what's our worst code". Analysis-only — does not modify code.
development
Run a multi-agent review of code comments and markdown documentation for unnecessary content, then fix the issues. Covers what-restating comments, name-mirroring doc comments, status-update prose, and other documentation noise. Use when the user asks to "simplify docs", "simplify documentation", "clean up comments", "clean up docs", "review documentation", "strip unnecessary comments", "reduce doc noise", or "run simplify-docs".