skills/draft-shells/SKILL.md
Decompose a specification file into shells with YAML frontmatter. Each shell captures the wiring invariants (Produces, Consumes, Covers) and high-level Implementation Steps without committing to file paths. Use when the user asks to "draft shells", "create shells", "break spec into shells", "decompose spec into sessions", "draft shells from spec", "generate shells from spec", or "make shells from spec".
npx skillsauth add tobihagemann/turbo draft-shellsInstall 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.
Decompose a specification file into shells at .turbo/shells/<spec-slug>-NN-<title>.md. Each shell represents one unit of work for a separate Claude Code session.
At the start, use TaskCreate to create a task for each step:
If decomposition lands on one shell, the Single-Shell Bail-out at the end of Step 2 marks tasks 3-5 deleted via TaskUpdate and exits.
Determine which spec to decompose using these rules in order:
.turbo/specs/<slug>.md.turbo/specs/*.md. If exactly one file exists, use it.turbo/specs/ does not exist but .turbo/spec.md exists, use it/draft-spec first and stopThe slug of the resolved spec becomes the prefix for shell file names: a spec at .turbo/specs/<slug>.md produces shells at .turbo/shells/<slug>-NN-<title>.md. For the legacy fallback, use slug legacy.
State the resolved spec path and target shell directory before continuing.
Read the spec and identify:
R<N> IDs from the spec's ## Requirements section. Every R-id must be tracked in at least one shell's Covers field.If the spec has no ## Requirements section or contains no R<N>-numbered items, stop and tell the user to add a ## Requirements section with enumerated R<N> IDs (or re-run /draft-spec if starting from scratch) before decomposing. Shells depend on stable R-ids for coverage tracking.
Split the spec into shells where each shell fits a single Claude Code context session.
The default is one shell. Adding a shell costs a fresh-session handoff: lost in-memory context, a repeated pattern survey, and an extra /pick-next-shell round. Splitting is justified only when a forcing condition for splitting applies:
If none of these apply, the work is one shell. Do not invent dependencies to hit a multi-shell shape. A spec's suggested groupings are a starting point — collapse adjacent suggestions into a single shell when no forcing condition separates them. Trust larger units of work; most spec items do not earn their own shell.
Items folded into a shell go into that shell's Implementation Steps. If several folded items have no clear home, group them into a single "minor fixes" shell at the end.
Forcing condition — atomic ripple (forces combination). When a breaking change to a shared interface requires every consumer across multiple modules to update in lockstep, the change and all consumer updates must land in one shell regardless of size. Splitting leaves intermediate states that break dependents.
Order by dependency, foundational work before dependent work:
Mitigate dead code risk in bottom-up ordering by bundling tightly-coupled producer/consumer pairs into the same shell, or having foundation shells include a minimal integration point (e.g., a single working endpoint or CLI command) that proves the code is reachable.
For each shell, identify the structural contract with the rest of the decomposition:
depends_on), or marked "from existing codebase" if it predates this decomposition. Every Consumes entry must be traceable to a source.R<N> IDs from the spec's ## Requirements section this shell implements. The union of Covers across all shells must equal the full set of R-ids in the spec. Every R-id must appear in at least one shell's Covers. Write one R-id per bullet in the Step 4 template. For partial coverage of a single R-id, mark the entry R<N> (partial: <what's deferred>) and name the deferred work in that shell's Open Questions. A bare R<N> for partial coverage breaks the invariant. Do not invent variant annotations such as (finished: ...) or (closing: ...).Each shell gets a slug derived from its title using spec slug rules (lowercase, hyphenated, ≤40 chars), prefixed with the shell number: <spec-slug>-NN-<title-slug>. The shell keeps this file name when /expand-shell fills it in.
Example: spec slug photo-sorter-v2, Shell 3 titled "Build duplicate detection" → slug photo-sorter-v2-03-build-duplicate-detection, written to .turbo/shells/photo-sorter-v2-03-build-duplicate-detection.md.
If decomposition lands on exactly one shell, do not write a shell file. A one-shell decomposition is structurally equivalent to a plan: depends_on is empty, Covers lists every R-id, Produces/Consumes has no consumers, and /pick-next-shell automation has nothing to coordinate.
Present this message:
Decomposition produced one shell, so no shell file was written. The spec at
<resolved spec path>fits a single session and is plan-shaped.
Mark the remaining /draft-shells tasks ("Resolve open questions", "Write shell files", "Present summary") as deleted via TaskUpdate. Do not create .turbo/shells/. Then use the TaskList tool and proceed to any remaining task.
If no open questions emerged during decomposition or carried over from the spec, skip this step.
For each open question:
AskUserQuestion to offer 2-3 concrete resolution options with short descriptions, plus a Defer to expansion option (leaves the question on the relevant shell's Open Questions list). Mark the strongest option "(Recommended)" and place it first.If the user selects "Other" and provides a freeform answer, accept it and proceed.
Default to resolving. Defer only when the answer genuinely needs codebase or pattern-survey context that is not yet available.
If an answer would restructure the decomposition significantly (changes shell count, merges existing shells, or splits one shell into several), re-run Step 2 with the new constraint before continuing to Step 4. If the new count is 1, the Single-Shell Bail-out at the end of Step 2 applies.
Create .turbo/shells/ if it does not exist. For each shell, write a file at .turbo/shells/<shell-slug>.md using this template:
---
spec: <resolved spec path from Step 1>
depends_on: []
---
# Plan: <Shell Title>
## Context
<Why this work matters, drawn from relevant spec sections. Focus on the intended outcome. One or two paragraphs.>
## Produces
- <Conceptual artifact 1 — what it is, what it does>
- <Conceptual artifact 2>
- ...
## Consumes
- <Conceptual dependency 1 — from Shell N, or "from existing codebase">
- <Conceptual dependency 2>
- ...
## Covers Spec Requirements
- R<N>
- R<N>
- R<M> (partial: <what's deferred>)
- ...
## Implementation Steps (High-Level)
1. **<Step title>**
- <Description of what this step accomplishes at the conceptual level>
2. **<Step title>**
- <Description>
3. ...
## Open Questions
- <Question deferred from spec, to be answered at expansion time>
- <Question>
- ...
## Expansion Deferred
The following are filled in when `/expand-shell` runs:
- Pattern survey against the codebase state at implementation time
- Concrete `file_path` references with named functions or symbols for each Implementation Step
- Verification section with specific test commands and smoke checks
- Context Files section with the files to read in full before editing
.md) that must be expanded and implemented before this shell can be picked. Use [] for shells with no dependencies.Example depends_on for Shell 3 that depends on Shells 1 and 2:
depends_on: [photo-sorter-v2-01-setup, photo-sorter-v2-02-models]
If a shell has no Open Questions, include the section with "None" so the structure stays consistent.
Present a brief summary: number of shells, one-line description of each shell's scope, and any assumptions made about ambiguities. Tell the user the next step:
To start implementation, run
/pick-next-shell. It will pick the next shell, expand it with a fresh pattern survey and concrete references, refine, self-improve, then halt. Run/implement-planin a fresh session afterward.
Then use the TaskList tool and proceed to any remaining task.
depends_on (or marked "from existing codebase").## Requirements section. Every R-id must appear in at least one shell's Covers.R<N> (full, claimed exactly once) and R<N> (partial: <what's deferred>). Do not invent variants like (finished: ...).git commit, git push, and PR creation.tools
Run autonomous task execution using the codex CLI. Use when the user asks to "codex exec", "run codex exec", "execute a task with codex", or "delegate to codex".
development
Run the post-implementation quality assurance workflow including tests, code polishing, review, and commit. Use when the user asks to "finalize implementation", "finalize changes", "wrap up implementation", "finish up", "ready to commit", or "run QA workflow".
development
Run the post-implementation quality assurance workflow including tests, code polishing, review, and commit. Use when the user asks to "finalize implementation", "finalize changes", "wrap up implementation", "finish up", "ready to commit", or "run QA workflow".
tools
Teach the user to deeply understand a change through interactive tutoring: restating understanding, drilling into why/what/how, and quizzing until mastery. The active counterpart to a one-shot explanation. Use when the user asks to "understand this change", "teach me this change", "help me understand what changed", "walk me through this change", "make sure I understand this", "quiz me on this", or "teach me what we did".