Vertical Slices
Translates each use case and user story into a self-contained vertical slice — a complete feature implementation spanning entity, model, domain handler, API endpoint, and test.
What Is a Vertical Slice?
A vertical slice is one feature, fully implemented across all layers. Each slice maps to exactly one Command or Query, delivers shippable value, and has no shared mutable state with other slices.
Input
| Input | Source |
|-------|--------|
| Use Cases | docs/bounded-contexts/{Domain}/use-cases.md |
| User Stories | docs/bounded-contexts/{Domain}/user-stories.md |
| Ubiquitous Language | UBIQUITOUS_LANGUAGE.md |
| Architecture Document | docs/architecture/{SolutionName}-architecture.md |
Output
For each feature:
docs/slices/{Domain}/{Entity}.{Operation}/blueprint.json— implementation blueprintdocs/slices/{Domain}/{Entity}.{Operation}/{Entity}.{Operation}.feature— Gherkin feature file
Blueprint JSON Format
{
"slice": "{Entity}.{Operation}",
"bounded_context": "{Domain}",
"operation_type": "Command | Query",
"entity": "{Entity}",
"handler_class": "{Operation}{Entity}CommandHandler",
"inputs": [
{ "name": "{PropertyName}", "type": "{CSharpType}", "required": true }
],
"outputs": [
{ "name": "{PropertyName}", "type": "{CSharpType}" }
],
"files_to_create": [
"{Solution}.Domain.{Domain}/Features/{Entity}/Commands/{Operation}{Entity}/{Operation}{Entity}Command.cs",
"{Solution}.Domain.{Domain}/Features/{Entity}/Commands/{Operation}{Entity}/{Operation}{Entity}CommandHandler.cs",
"{Solution}.Domain.{Domain}/Features/{Entity}/Commands/{Operation}{Entity}/{Operation}{Entity}Response.cs",
"{Solution}.Services.{Domain}/Endpoints/{Entity}/{Operation}{Entity}Endpoint.cs",
"{Solution}.{Domain}.Tests/{Entity}/{Operation}{Entity}CommandHandlerTests.cs"
],
"source": {
"use_cases": ["UC-{Domain}-{NNN}"],
"user_stories": ["US-{Domain}-{NNN}"],
"acceptance_criteria": ["AC-{Domain}-{NNN}.{n}"]
}
}
`source` — the trace
source records what the slice implements. Identifier formats and allocation rules are defined in
.ai/reference/traceability.md.
- Every value is an array, even when it holds a single element — a slice may serve several
stories or use cases, and a uniform shape keeps the validator simple.
acceptance_criteriaholds identifiers only. The criterion's Gherkin text lives exactly
once, tagged @AC-…, in the .feature file; it is never duplicated into the blueprint.
- Omit a key that does not apply. At least one of
use_casesoruser_storiesmust be non-empty;
a slice that names neither is untraceable by construction.
- Write identifiers only after the owning document is labelled — documents first, then blueprints,
then tests. A reference to an unlabelled criterion is a dangling reference.
- Legacy blueprints written before this convention may carry singular
use_case/
user_story string keys and a top-level free-text acceptance_criteria array of
"Given ... When ... Then ..." strings. Read those as one-element arrays and convert them to
the source form the next time the blueprint is touched; existing blueprints keep parsing and
are not rewritten in bulk.
Steps
- Read all use cases and user stories for each bounded context
- Map each use case main flow to one Command or Query
- For each alternate flow that introduces a distinct outcome, create a separate slice
- For each user story, verify it maps to at least one slice — create a slice if missing
- Write the blueprint JSON for each slice to
docs/slices/{Domain}/{Entity}.{Operation}/, including
its source trace arrays
- Extract the Gherkin from the use case/story, including each scenario's
@AC-…/@AF-…tag,
and write the .feature file — tags travel with their scenario and are never stripped
- Announce: "N vertical slice blueprints written across M bounded contexts."
Slice Naming Convention
| Operation | Handler Suffix | Example |
|-----------|---------------|---------|
| Create | CommandHandler | Create{Entity}CommandHandler |
| Update | CommandHandler | Update{Entity}CommandHandler |
| Delete | CommandHandler | Delete{Entity}CommandHandler |
| Get by ID | QueryHandler | Get{Entity}ByIdQueryHandler |
| Get list | QueryHandler | Get{Entities}ListQueryHandler |
Integration with Solution Generator
Blueprints produced by this skill are consumed by implementation agents. Each blueprint is a standalone work item — an agent can pick up a single blueprint and implement the full slice without reading any other blueprint.