vertical-slices

Orchestrate feature-first vertical slices for TypeScript backend projects.

1.1k|189|Updated Mar 11, 2025
One-click install
npx skills add https://github.com/databuddy-analytics/Databuddy --skill vertical-slices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vertical-slices
Source: https://github.com/databuddy-analytics/Databuddy/tree/main/.agents/skills/vertical-slices
Command: npx skills add https://github.com/databuddy-analytics/Databuddy --skill vertical-slices

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vertical-slices prevents feature development from diffusing logic across controllers, services, and repositories by enforcing ownership, contracts, persistence, and tests inside a single capability-driven module for TypeScript backend and fullstack projects.

Core Features & Use Cases

  • Slice Planning: Define a capability statement, boundaries, contracts, and dependency map before touching implementation so everyone agrees on the intent and scope.
  • Implementation Guidance: Keep handlers thin, business rules inside the slice, persistence co-located, and low-coupling interaction patterns that emit events or use explicit interfaces.
  • Quality Gates: Treat verification as mandatory by documenting required unit/integration/e2e commands, checking references/checklists, and driving behavior-focused regression tests for each slice.

Quick Start

Use the vertical-slices skill to outline the capability statement, boundary contracts, data ownership, and verification plan before coding a new backend feature.

Frequently Asked Questions about vertical-slices

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

FAQPage Schema
How do I reduce coupling in a TypeScript backend architecture?

To reduce coupling in a TypeScript backend, adopt vertical slices to group capability-driven modules, replacing layered architectures. This enforces slice-level boundaries by co-locating handlers, business rules, and persistence inside a single module rather than diffusing logic across controllers and services.

What is the vertical slice architecture pattern for backend feature development?

The vertical slice pattern organizes backend feature development by capability instead of technical layers. It requires defining a capability statement, boundary contracts, and data ownership before implementing behavior, ensuring logic stays within a single module rather than spread across controllers and repositories.

How do I refactor controllers and services into feature-first slices?

Refactor controllers and services into feature-first slices by documenting capability boundaries, contracts, and persistence ownership per slice. Keep handlers thin, move business rules inside the slice, and establish explicit interfaces or event-driven interaction patterns to minimize cross-slice dependencies.

Does vertical slice architecture work for fullstack TypeScript projects?

Yes, vertical slice architecture works for both backend and fullstack TypeScript projects. It applies when creating new capabilities or refactoring existing layered code, requiring you to document contracts, persistence, tests, and verification commands before implementing the slice's behavior.

When should I not use vertical slices over a layered architecture?

You should avoid vertical slices if you cannot enforce mandatory quality gates, such as documenting verification commands and driving behavior-focused regression tests per slice. Without strict slice-level boundaries and contract documentation, the architecture loses its coupling reduction benefits.

How do I structure tests for vertical slices in TypeScript?

Structure tests for vertical slices by treating verification as mandatory. Document required unit, integration, and e2e commands for each slice, and drive behavior-focused regression tests that validate the slice's contracts and boundaries before implementation is considered complete.