This skill helps developers implement the Vertical Slice Architecture pattern, enabling better organization of features into distinct modules. It is particularly useful for developers looking to improve code maintainability and scalability in their applications.
$ npx skills add https://github.com/mryll/skills --skill vertical-slice-architectureVertical Slice Architecture organizes code around features and use-cases rather than technical layers like controllers, services, and repositories. This skill guides your AI agent to structure applications so each feature is a self-contained vertical slice with all its dependencies grouped together. It works with any programming language and app type—web APIs, CLIs, event-driven systems—making it easier to locate, modify, and test individual features. Teams using this pattern experience faster feature development and reduced coupling between domain logic.
Install the skill using the command provided in the installation section.
Implement a new feature using the vertical slice methodology.
Organize existing code into vertical slices for better maintainability.
Conduct tests specifically on the entry points of each feature.
$ npx skills add https://github.com/mryll/skills --skill vertical-slice-architecturegit clone https://github.com/mryll/skillsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
As a senior software architect, help me implement Vertical Slice Architecture for [COMPANY]'s [INDUSTRY] application using [TECHNOLOGY_STACK]. Provide a step-by-step plan to restructure the codebase, including how to group related features into vertical slices, define boundaries, and set up communication between slices. Focus on maintainability and scalability improvements. Current pain points include: [PAIN_POINTS].
# Vertical Slice Architecture Implementation Plan for Contoso E-Commerce
## Current State Analysis
Your monolithic codebase has grown to 50K+ lines with:
- Mixed concerns (e.g., checkout logic in ProductService)
- Tight coupling between modules
- Difficulty in onboarding new developers
## Proposed Vertical Slices
### 1. Product Catalog Slice
- **Features**: Product listing, search, details
- **Boundaries**: ProductController, ProductRepository, ProductValidator
- **Tech**: ASP.NET Core, Entity Framework
### 2. Order Processing Slice
- **Features**: Cart management, checkout, order history
- **Boundaries**: OrderController, PaymentService, OrderRepository
- **Tech**: MediatR for CQRS, Stripe API integration
### 3. User Management Slice
- **Features**: Authentication, profiles, preferences
- **Boundaries**: AccountController, UserRepository, AuthService
- **Tech**: IdentityServer4, JWT tokens
## Implementation Steps
1. **Create Feature Folders**:
```
/Features
/ProductCatalog
/Products
ProductsController.cs
GetProductsQuery.cs
ProductRepository.cs
/OrderProcessing
/Orders
CreateOrderCommand.cs
OrderRepository.cs
```
2. **Define Communication Patterns**:
- Use domain events for cross-slice communication
- Implement integration events for eventual consistency
- Example: `OrderPlacedEvent` published by OrderProcessing slice
3. **Set Up Infrastructure**:
- Configure separate DbContext per slice
- Implement API versioning for each slice
- Add health checks per vertical slice
## Migration Strategy
- Start with read-only features (Product Catalog)
- Gradually move write operations to new slices
- Use feature flags to control rollout
- Plan to decommission old controllers after 3 monthsTake a free 3-minute scan and get personalized AI skill recommendations.
Take free scan