Turbo refine-plan
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\".
git clone https://github.com/tobihagemann/turbo
T=$(mktemp -d) && git clone --depth=1 https://github.com/tobihagemann/turbo "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/refine-plan" ~/.claude/skills/tobihagemann-turbo-refine-plan && rm -rf "$T"
skills/refine-plan/SKILL.mdRefine Plan
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.
Task Tracking
At the start of every invocation (including re-runs from Step 5), use
TaskCreate to create a task for each step:
- Resolve the artifact
- Run
skill/review-plan - Run
skill/evaluate-findings - Run
skill/apply-findings - Re-run
skill if changed/refine-plan
Step 1: Resolve the Artifact
Determine Artifact Type
- Explicit argument — If the user specified a type (e.g., "refine plan", "refine shells", "refine spec"), use it
- Conversation context — Infer from conversation (e.g., if
just ran, type is plan)/draft-plan - Auto-detect — Check
for existing artifacts. If multiple types exist, use.turbo/AskUserQuestion
Resolve the Artifact File(s)
Plan
- Explicit path — use it
- Explicit slug — resolve to
.turbo/plans/<slug>.md - Single file — Glob
. If exactly one file exists, use it.turbo/plans/*.md - Most recent — most recently modified file
- Legacy fallback —
if.turbo/plan.md
does not exist.turbo/plans/ - Nothing found — tell the user to run
(for a new task) or/turboplan
(for existing shells) and stop/pick-next-shell
Shells
- Explicit spec slug — Glob
.turbo/shells/<slug>-*.md - Explicit spec path — derive slug from filename, glob as above
- Single spec — Glob
. If exactly one, derive slug and glob for shells.turbo/specs/*.md - Most recent spec — most recently modified spec, derive slug and glob
- Nothing found — tell the user to run
first and stop/draft-shells
For 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.
Spec
- Explicit path — use it
- Explicit slug — resolve to
.turbo/specs/<slug>.md - Single file — Glob
. If exactly one, use it.turbo/specs/*.md - Most recent — most recently modified
- Legacy fallback —
if.turbo/spec.md
does not exist.turbo/specs/ - Nothing found — tell the user to run
first and stop/draft-spec
If multiple candidates exist and the choice is non-obvious, use
AskUserQuestion.
State the resolved path(s) before continuing.
Step 2: Run /review-plan
Skill
/review-planRun the
/review-plan skill on the resolved artifact.
Always run this step even if the artifact looks polished.
Step 3: Run /evaluate-findings
Skill
/evaluate-findingsRun the
/evaluate-findings skill on the review findings from Step 2.
Step 4: Run /apply-findings
Skill
/apply-findingsRun the
/apply-findings skill on the evaluated results.
Step 5: Re-run /refine-plan
Skill if Changed
/refine-planCheck whether the artifact file(s) were edited during Step 4. Any edit counts.
The iteration number below refers to the
/refine-plan run currently executing Step 5. It is not the iteration number of a prospective re-run. Iteration 1 is the initial run; iteration 2 is the first auto-re-run; iteration 3 is the second auto-re-run; iteration 4 and beyond exist only when the user opts in at the hard-cap ask. Iterations 1 and 2 always follow the classification gate (they never trigger the hard cap at their own Step 5, even when the auto-re-run they spawn would be iteration 3). The hard cap fires at the end of iteration 3 and every iteration thereafter.
Iterations 1 and 2, if changes were made, classify what Step 4 edited:
- Structural edits — run
again via the Skill tool, 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./refine-plan - Prose-only edits only (reworded sentences in place, fixed stale examples, clarified existing text without changing meaning) — output a summary of what changed, then use
to ask whether to run one more round or stop here. Do not silently continue or silently stop.AskUserQuestion
Iterations 1 and 2, if changes were made but you believe re-running is unnecessary, use
AskUserQuestion to ask for skip permission. Do not skip silently.
Iteration 3 or later, if Step 4 of this run made changes, the hard cap is reached. This replaces the classification gate above for iteration 3 and every iteration after it. Output a summary of what is still changing and whether it is structural or prose-only. Then use
AskUserQuestion to offer three options: continue for another iteration, stop here and accept the artifact as-is, or escalate to /consult-oracle for a different perspective on the remaining issues.
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 use the TaskList tool and proceed to any remaining task.
Structural Edit Examples by Type
- Plan — added or removed steps, new or removed design decisions, rewired dependencies between steps, changed testing strategy
- Shells — added or removed shells, changed Produces/Consumes/Covers Spec Requirements wiring, changed frontmatter
, added or removed spec requirement coveragedepends_on - Spec — added or removed sections, new or removed requirements, rewired cross-references, changed acceptance criteria
Rules
- Every step must run in every iteration.
is a judgment gate that must run before/evaluate-findings
touches the artifact. Each step must invoke its designated skill via the Skill tool./apply-findings - Re-invocations from Step 5 are full runs with fresh task tracking and complete skill invocations.
- The artifact file(s) are the only files that should change. For shells, do not modify the source spec.