usecase
Use Case Skill
Installation: If not already installed, add the package with pnpm add @efesto-cloud/usecase.
Use cases are the application layer's entry points in a hexagonal architecture. They orchestrate domain entities, repositories (persistence), and services (email, auth, storage, etc.) to execute a single well-defined business operation.
Each use case ships four artifacts:
- Interface —
useCase/{domain}/I{Name}.ts— the type contract - Implementation —
useCase/{domain}/impl/{Name}.ts— the class - Symbol —
di/Symbols.ts— a new symbol entry - Binding —
di/container.ts— a DI binding line
Read references/templates.md for ready-to-copy code templates.
Before You Start
Gather context if the user hasn't already provided it:
More from efesto-cloud/lib
observer
Use when writing or reviewing Observable code from the @efesto-cloud/observable package.
3entity
Create or modify domain entities using the @efesto-cloud/entity package. Use this skill whenever the user asks to add a new entity, update an existing entity, add properties or methods to an entity, or work on the entity/dto layer. Trigger when the user says things like "create a Foo entity", "add a field to Bar", "I need a new domain object", or "add entity X". Also trigger for DTO creation or modification.
3persistence
>
3type-enum-dict
|
3monad-maybe
Use when writing or reviewing code that returns Maybe<T> from the @efesto-cloud/maybe package.
3value-object
|
3