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:

  1. Locate the entity directory (typically packages/core/src/entity/) and read a similar existing entity as a reference
  2. Locate the DTO directory (typically packages/core/src/dto/) and read a similar DTO
  3. Check for a CLAUDE.md inside 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 pattern
  • references/dto-example.ts — fully annotated DTO covering every pattern
  • references/entity-union.ts — entity union pattern: abstract base + multiple concrete subtypes discriminated by a type literal
  • references/dto-union.ts — DTO union pattern: base interface + concrete sub-interfaces each carrying a type literal discriminant
Related skills
Installs
3
First Seen
14 days ago