vertical-slice

Reorganize .NET codebases into feature folders with isolated handlers and endpoints.

1|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/Trossitec/dotnet-claude-kit --skill vertical-slice-trossitec
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vertical-slice
Source: https://github.com/Trossitec/dotnet-claude-kit/tree/main/skills/vertical-slice
Command: npx skills add https://github.com/Trossitec/dotnet-claude-kit --skill vertical-slice-trossitec

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Vertical Slice Architecture (VSA) prevents your .NET codebase from becoming a tangled web of Controllers, Services, and Repositories by organizing everything around a single feature’s workflow.

Core Features & Use Cases

  • Feature-first structure: Keeps request/response, endpoint, and handler colocated under a single feature folder for clean ownership and fast navigation.
  • Low coupling between features: Encourages shared logic to live in Common/ or Shared/ rather than direct cross-feature calls.
  • Handler as the unit of work: Improves clarity and testability by ensuring each handler does one focused job.
  • Multiple implementation patterns: Supports source-generated mediator handlers, Wolverine convention-based handlers, or raw handler classes without extra dependencies.
  • Endpoint grouping: Works with IEndpointGroup to consistently wire feature endpoints, tags, and response metadata.

Quick Start

Load the vertical-slice skill when starting a new .NET API and you want each feature folder to contain the endpoint, handler, request, response, and validation as a single vertical slice.

Frequently Asked Questions about vertical-slice

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is vertical slice architecture in .NET and how does it organize code?

Vertical slice architecture (VSA) organizes a .NET codebase by feature workflows instead of technical layers. Each feature folder colocates its endpoint, handler, request, and response objects to ensure clean ownership and low coupling between features.

How do I structure a .NET API using feature folders and handlers?

To structure a .NET API with feature folders, group each feature's endpoint, handler, request, and response into a single directory. Use `IEndpointGroup` to wire endpoints consistently and place shared cross-feature logic in a dedicated `Common/` folder.

Can I use Wolverine or a mediator pattern with vertical slice architecture?

Vertical slice architecture supports multiple handler patterns including Wolverine convention-based handlers, source-generated mediator handlers, or raw handler classes. This allows you to implement the handler-as-unit-of-work design without forcing extra dependencies.

When should I migrate my existing .NET codebase to vertical slice architecture?

Migrate to vertical slice architecture when your layered .NET codebase becomes a tangled web of controllers and repositories. Reorganizing around isolated feature workflows improves navigation, clarity, and testability by ensuring each handler does one focused job.

Does vertical slice architecture work with minimal APIs and endpoint grouping?

Vertical slice architecture integrates directly with .NET minimal APIs by utilizing `IEndpointGroup` to consistently wire feature endpoints, tags, and response metadata. This ensures each slice remains independently scoped while registering routes cleanly.

How do I handle shared logic and cross-feature dependencies in vertical slice architecture?

In vertical slice architecture, shared logic and cross-feature dependencies should live in a designated `Common/` or `Shared/` folder. This prevents direct cross-feature calls and maintains low coupling, keeping each feature slice isolated and independently testable.