separation-of-concerns
Installation
SKILL.md
Separation of Concerns
Mental Model: Verticals and Horizontals
Vertical = all code for ONE feature, grouped together Horizontal = capabilities used by MULTIPLE features
features/— verticals, containing some combination of entrypoint/, commands/, queries/, domain/, infra/- commands/ orchestrates write operations (state mutations or external side-effects)
- queries/ usually queries database directly but can query domain if easier
- domain/ contains business rules
- entrypoint/ only needed when exposing external interface (HTTP, CLI, events)
- infra/ feature-specific infrastructure (mappers, middleware, persistence implementations)
platform/— horizontals, containsdomain/andinfra/- domain/ depends on nothing — never imports from infra/
- infra/ CAN depend on domain/ (implements domain contracts)
shell/— app wiring/routing only (no business logic). Registers routes, bootstraps frameworks, connects message brokers. Not a package entry point — libraries usesrc/index.tsfor that.src/index.ts— library package entry point. Pure barrel file (only re-export statements, no logic). Only needed for packages consumed by other packages.