slice
Bridge the spec's user-language description to the codebase's module structure. The napkin sketch says "something renders the editor" — your job is to say "the <WriteScreen> component at apps/web/src/features/write/WriteScreen.tsx renders it."
A vertical slice is the full stack a feature touches — UI, API, domain, data, external. TDD without a slice plan drifts to the easiest starting point (usually a backend unit) and quietly drops the UI.
Read the spec
Load the spec and any Technology Decisions from /spike. Summarise back: the headline interaction, the supporting jobs, and the tech choices.
Explore the codebase
Build a mental model of what already exists — real exploration, not guessing. For each supporting job, look for:
- Existing modules that match the responsibility
- Codebase conventions — monorepo layout, feature folders, layering patterns, how new features are typically added
- Frontend layer — framework, feature folder pattern, how screens handle state and API calls
- Data layer — where entities live, persistence approach
Use the Explore subagent or Grep/Glob directly. Be specific about files you looked at and patterns you found. The user knows things about the codebase you can't read from files — present findings and invite correction.
Plan the slice
Walk through each supporting job one at a time. For each, answer:
- Which layers does it touch? UI, API, domain, data, external. If a job only touches backend, say so — don't manufacture a UI concern.
- Existing modules to modify — concrete file paths and what changes
- New modules to create — concrete file paths and what responsibility they own
- Dependencies — other jobs that must exist first
If the headline interaction involves a UI, the slice has a UI layer. Don't let TDD quietly drop the UI by omitting it here.
Identify the entry point
Name the outermost component, endpoint, or function the user (or caller) hits first when exercising the headline interaction. This is where TDD's tracer bullet — a lean-but-complete end-to-end slice of production code — will begin. See ../principles/tracer-bullets.md.
- UI feature — the top-level screen or component (e.g.
<WriteScreen>atapps/web/src/features/write/) - API-only feature — the handler or endpoint
- Domain library — the public entry function
The slice commits to where the tracer bullet begins. TDD decides what the first test looks like when it gets there.
Supporting jobs to cover
List each supporting job with a one-line note on roughly where it lives in the module map (layer + file if known). This is scope, not sequence — TDD decides the order based on what each red-green cycle teaches it, and jobs are not 1:1 with tests. One behavioural test may cover several jobs; some jobs may only be exercised through outer tests and never earn their own.
Write the Vertical Slice section
Append this to the spec:
Layers touched:
- UI: <components, or "none">
- API: <endpoints/handlers, or "none">
- Domain: <entities/aggregates/services>
- Data: <storage/persistence>
- External: <APIs/services>
Existing modules to modify:
<path>:
New modules to create:
<path>:
Conventions followed:
- <e.g. feature folder at
apps/web/src/features/write/, minimal API endpoint pattern>
Entry point:
<outermost component/endpoint/function the user or caller hits first — e.g. <WriteScreen> at apps/web/src/features/write/>
Supporting jobs to cover (scope, not sequence):
- :
- : ...
Update spec status to Spec ready, slice planned, awaiting /tdd.
What a slice plan is NOT
- Not an architecture document. One theory, not the whole system.
- Not detailed design. Interface signatures, internal data structures, and test cases belong in
/tdd. - Not scope expansion. If a supporting job is small, its slice entry should be small.
- Not exhaustive codebase mapping. Only modules relevant to this theory.
Loop-backs
Go back to /spec if supporting jobs are too vague to map onto modules, or the napkin sketch assumes a data flow the codebase can't support.
Go back to /spike if planned modules depend on a technology choice that wasn't validated or turns out wrong.
Go back to /theories if the slice is too large to implement as one thin feature, or the cost is disproportionate to the theory's value.
More from jonhilt/practical-engineer
tdd
Implement one theory through strict outside-in TDD, deriving tests from the spec brief. Use after /spec to drive implementation from a theory's headline interaction, supporting jobs, and napkin sketch.
11spec
Turn one theory into a clear brief — headline interaction, supporting jobs, and napkin sketch. The bridge between a theory and TDD. Use after /theories to specify one theory at a time.
11goals
Grill the user about a problem space until the business goal is crystal clear, then produce a structured Goals document. Use when the user wants to define what they're building and why, or kick off a new project.
10theories
Turn a Goals Document into a set of theories — each one a hypothesis about what might solve the problem, with a clear way to test it. Use after /goals to decide what to build and why.
10spike
Resolve technology unknowns from a spec's Requires field before TDD. Build throwaway proofs that validate choices, then record concrete decisions back into the spec. Use after /spec, before /tdd.
7refactoring-coach
Guided Socratic refactoring exercise — walks the user through refactoring a messy component one concern at a time, asking questions before revealing answers, naming principles, and showing only the relevant extraction. Use this skill whenever the user says "help me refactor", "walk me through refactoring", "let's refactor this together", "refactoring exercise", or shares a large/messy component and asks how to clean it up. Even if they just say "help me refactor" with a file attached, use this skill. Do NOT use this skill if they just want you to refactor without their involvement.
3