Create a new module at packages/server/src/modules/$ARGUMENTS[0]/ with the full
Clean Architecture structure:
- •
domain/entities/— empty directory with index.ts - •
domain/value-objects/— empty directory with index.ts - •
domain/errors.ts— base error class usingData.TaggedError - •
domain/index.ts— re-export all domain types - •
ports/inbound/— empty port interface file - •
ports/outbound/— empty repository interface file - •
ports/index.ts - •
application/— empty use case file with Effect.gen template - •
adapters/inbound/— empty handler file - •
adapters/outbound/— empty repository implementation - •
adapters/index.ts - •
events/published.ts— empty DomainEvent definitions - •
events/subscriptions.ts— empty subscription handlers - •
events/index.ts - •
module.ts— Layer composition template - •
index.ts— public API (exports Layer, events, ports only)
Use the identity module as a reference for file structure.
Follow all conventions in @docs/02-ARCHITECTURE.md.
Use branded types from shared/kernel/types.ts.