← ClaudeAtlas

vertical-slice-architecturelisted

Enforce Vertical Slice Architecture (VSA) when building applications in any language (Go, .NET/C#, Java, Kotlin, TypeScript, Python, etc.) and any type (web API, mobile backend, CLI, event-driven). Organize code by feature/use-case instead of technical layers. Each feature is a self-contained vertical slice with a single entry point that receives the router/framework handle and its dependencies. Use when the user says "vertical slice architecture", "VSA", "organize by feature", "feature-based architecture", "slice architecture", or when building a new app or feature and the project already follows VSA conventions. Also use when reviewing or refactoring code to align with VSA principles.
mryll/skills · ★ 4 · AI & Automation · score 78
Install: claude install-skill mryll/skills
# Vertical Slice Architecture ## Quick Reference: The 5 Rules 1. **One feature = one directory** containing handler, request/response types, validation, and tests 2. **One entry point per feature** — a setup/registration function that receives the router and dependencies. Name varies by convention (`Setup`, `RegisterRoute`, `Map`); the role is the invariant, not the name. 3. **Minimize coupling between slices, maximize coupling within a slice** 4. **No premature abstractions** — no shared repository/service layers until genuine duplication emerges across multiple slices 5. **Test each feature primarily through its entry point**, verifying outcomes (DB state, API calls, response). Platform/adapter tests are also encouraged. ## Project Structure ``` {project}/ features/ # or internal/features/ (Go), Features/ (.NET) {domain}/ # orders/, users/, kvs/ {operation}/ # create/, list/, delete/ handler # Single entry point + orchestration request/response # DTOs validator # Input validation (optional) test # Co-located integration test internal/ # Feature-private helpers (optional) platform/ # or Infrastructure/ — shared cross-cutting concerns middleware/ # Auth, error handling, idempotency database/ # Connection pooling, circuit breakers observability/ # Metrics, tracing, structured logging opqueue/