vertical-slice-architecture

Organize code into vertical slices with feature-first boundaries and inward-facing dependencies.

Updated Sep 25, 2025
One-click install
npx skills add https://github.com/iyaki/opencode-base-template --skill vertical-slice-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vertical-slice-architecture
Source: https://github.com/iyaki/opencode-base-template/tree/main/.agents/skills/vertical-slice-architecture
Command: npx skills add https://github.com/iyaki/opencode-base-template --skill vertical-slice-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This approach helps teams avoid tangled, monolithic codebases by organizing code around feature use cases and aligning ownership with business capabilities.

Core Features & Use Cases

  • Clear slice boundaries: each feature is implemented inside its own slice with endpoint, orchestration, domain behavior, and persistence coordinated together.
  • Dependency direction: inward-facing dependencies that reduce cross-slice leakage and improve testability.
  • Incremental adoption: migrate legacy flows one slice at a time to avoid big-bang rewrites.
  • Use cases: ideal for medium to large projects with evolving requirements and frequent integration changes.

Quick Start

Begin a new feature as a single slice by placing the endpoint, application logic, domain rules, and persistence together in one cohesive folder.

Frequently Asked Questions about vertical-slice-architecture

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

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

Vertical slice architecture organizes code around feature use cases, placing endpoint, application logic, domain rules, and persistence together in a single slice to reduce cross-cutting coupling and improve maintainability.

How do I start organizing code into vertical slices for a new feature?

Begin a new feature as a single vertical slice by placing the endpoint, application logic, domain behavior, and persistence together in one cohesive folder, ensuring inward-facing dependencies that reduce cross-slice leakage.

Can I incrementally migrate a legacy monolithic codebase to vertical slice architecture?

Yes, vertical slice architecture supports incremental adoption by migrating legacy flows one slice at a time, allowing teams to avoid big-bang rewrites while progressively reducing monolithic codebase entanglement.

Is vertical slice architecture suitable for small software projects?

Vertical slice architecture is ideal for medium to large projects with evolving requirements and frequent integration changes, as it aligns code ownership with clear business capabilities and feature boundaries.

How does vertical slice architecture compare to hexagonal architecture for software design?

Vertical slice architecture focuses on feature-first boundaries and slice-local orchestration, whereas hexagonal architecture emphasizes separating core domain logic from external interfaces, with vertical slices promoting inward-facing dependencies for better testability.

Why should I use vertical slice architecture to reduce cross-cutting coupling?

Vertical slice architecture reduces cross-cutting coupling by enforcing clear slice boundaries and inward-facing dependencies, ensuring each feature coordinates its endpoint, orchestration, domain behavior, and persistence independently.