persistence
Installation
SKILL.md
Persistence Skill
Installation: If not already installed, add the required packages:
pnpm add @efesto-cloud/entity(forIEntityMapperinterface)pnpm add @efesto-cloud/maybe(for nullable results)pnpm add @efesto-cloud/mongodb-database-context(for transaction support)
Helps you build the persistence layer — document type, repository interface, implementation, and mapper — for a hexagonal architecture TypeScript/MongoDB project following the ports-and-adapters pattern.
Scope: document type, repository interface, repository implementation, mapper. Population (the system for eager-loading related entities via aggregation pipelines) is a separate concern with its own skill — this skill only declares the hook for it where needed, without implementing the internal machinery.
Assumes the entity class and DTO interface already exist and are correct. Read them before writing any persistence code.