cx-modular-architecture
Installation
SKILL.md
When to use
- New API/backend feature
- Refactor into clean layered structure
- Enforce separation of concerns
Architecture
Flow: route → controller → service → repository. Layers strict, no overlap.
Side files per feature: schemas (validation), types (TS types/interfaces), config (feature constants/config), utils or helpers (pure helpers), crons (scheduled jobs), index.ts (barrel).
Folder names plural: controllers/, services/, schemas/, helpers/, utils/, crons/. Pick utils/ or helpers/ per module — stay consistent.
All repositories live in packages/cx-datastore/src/repositories/. Never inside src/modules/.
Folder Structure
Group by feature, not layer. One module = one folder.
Related skills