vertical-slice

Structure .NET APIs into self-contained vertical slices with endpoints and handlers.

224|87|Updated Dec 15, 2018
One-click install
npx skills add https://github.com/Resgrid/Core --skill vertical-slice-resgrid
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vertical-slice
Source: https://github.com/Resgrid/Core/tree/main/.opencode/skills/vertical-slice
Command: npx skills add https://github.com/Resgrid/Core --skill vertical-slice-resgrid

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Vertical Slice Architecture (VSA) eliminates the friction of scattering a single feature across controllers, services, and repositories by keeping each feature self-contained around its endpoint and handler.

Core Features & Use Cases

  • Feature-first folder structure: Co-locates endpoint wiring, request/response types, validation, and handler logic inside a feature folder (e.g., Features/Orders/CreateOrder.cs) to reduce navigation and cognitive load.
  • Low coupling across features: Prevents direct feature-to-feature calls so shared behavior lives in Common/ or Shared/ rather than creating tangled dependencies.
  • Multiple handler options: Supports Mediator-style handlers (source-generated), Wolverine convention-based handlers, or raw handler classes depending on project constraints.
  • Cleaner responsibilities: Treats the handler as the unit of work, discouraging god-classes and large multi-purpose service layers.
  • Practical growth paths: Guides adding module boundaries for larger applications and using shared contracts only when necessary.

Quick Start

Load this skill when designing or refactoring a .NET API so that each feature folder contains the endpoint and handler for one operation, with validation and request/response types colocated.

Frequently Asked Questions about vertical-slice

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

FAQPage Schema
How do I structure a .NET API using vertical slice architecture?

Vertical slice architecture structures a .NET API by co-locating endpoint wiring, request/response types, validation, and handler logic inside a single feature folder like Features/Orders/CreateOrder.cs to reduce navigation and cognitive load.

What is the best way to organize feature folders in ASP.NET Core?

Organizing feature folders in ASP.NET Core involves grouping each business capability as a self-contained vertical slice with its endpoint, handler, and validation colocated, preventing direct feature-to-feature calls and reducing layered abstractions.

Can I use Wolverine or Mediator instead of controllers in a .NET vertical slice?

Yes, vertical slice architecture supports Wolverine convention-based handlers, Mediator-style source-generated handlers, or raw handler classes, treating the handler as the unit of work to discourage god-classes and large multi-purpose service layers.

How do I prevent tight coupling between vertical slices in a .NET application?

Prevent tight coupling between vertical slices by disallowing direct feature-to-feature calls and routing shared behavior or contracts to a Common or Shared folder boundary, keeping each slice self-contained.

When should I refactor a layered .NET API into vertical slices?

Refactor a layered .NET API into vertical slices when scattering a single feature across controllers, services, and repositories creates friction, and you need cohesive feature-first folder structures with minimized cross-feature coupling.

How do vertical slices scale for larger .NET applications?

Vertical slices scale for larger .NET applications by adding module boundaries around cohesive features and using shared contracts only when necessary, providing practical growth paths while maintaining handler-as-unit-of-work conventions.