vertical-slicelisted
Install: claude install-skill zdanovichnick/dotnet-pilot
# Vertical Slice Architecture
Reference material for structuring .NET APIs by feature rather than by layer.
## Core Concept
Organize code by **feature (vertical slice)**, not by technical layer (horizontal). Each slice owns everything needed for one feature: endpoint, handler, DTOs, validation. Two features never share request/response types — coupling through shared DTOs is how VSA projects collapse back into layered code.
**Use when**: ≤10 aggregates, CRUD-heavy API, team prefers feature-branch isolation, or Clean Architecture feels like over-engineering.
**Avoid when**: rich domain model with 10+ aggregates, complex cross-aggregate business rules, or event sourcing is on the roadmap — prefer Clean Architecture or DDD instead. See `knowledge/decisions/adr-005-multi-architecture.md`.
## Folder Structure
```
src/MyApp/
Features/
Orders/
CreateOrder/
CreateOrderEndpoint.cs # IEndpointGroup implementation
CreateOrderHandler.cs # Command handler (or inline in endpoint)
CreateOrderRequest.cs # Input DTO record
CreateOrderResponse.cs # Output DTO record
CreateOrderValidator.cs # FluentValidation validator
GetOrder/
GetOrderEndpoint.cs
GetOrderQuery.cs
GetOrderResponse.cs
CancelOrder/
CancelOrderEndpoint.cs
CancelOrderCommand.cs
Domain/ # Shared only if 2+ features use it
Orders/
Order.cs
OrderStatus.cs
Infr