entity
Installation
SKILL.md
Entity Skill
This skill helps you create or modify domain entities following the hexagonal architecture conventions using the @efesto-cloud/entity package. Scope: entity class + DTO interface only — persistence (repository, mapper, MongoDB document) is a separate concern handled elsewhere.
Installation: If not already installed, add the package with pnpm add @efesto-cloud/entity (peer dependency: luxon).
Before You Write Anything
Read the existing codebase before generating code:
- Locate the entity directory (typically
packages/core/src/entity/) and read a similar existing entity as a reference - Locate the DTO directory (typically
packages/core/src/dto/) and read a similar DTO - Check for a
CLAUDE.mdinside the entity directory — it may have project-specific conventions
If the project is new or the entity/dto directories are empty, use the reference files in this skill's references/ directory as your canonical examples instead:
references/entity-example.ts— fully annotated entity covering every patternreferences/dto-example.ts— fully annotated DTO covering every patternreferences/entity-union.ts— entity union pattern: abstract base + multiple concrete subtypes discriminated by atypeliteralreferences/dto-union.ts— DTO union pattern: base interface + concrete sub-interfaces each carrying atypeliteral discriminant
Related skills