persistence
Persistence Skill
Helps you design the persistence layer port — repository interface, mapper contract, and DI symbol registration — for a hexagonal architecture TypeScript project following the ports-and-adapters pattern. This skill is DB-agnostic; it covers the shared concepts that apply regardless of whether the backing store is MongoDB, Prisma, or anything else.
Installation: Add the core packages used by all persistence layers:
pnpm add @efesto-cloud/database-context(forIDatabaseContextinterface)pnpm add @efesto-cloud/entity(forIEntityMapperinterface)pnpm add @efesto-cloud/maybe(for nullable results)
Next step: Once the interface and mapper shape are defined, install the DB-specific skill:
- MongoDB:
mongodb-persistenceskill - Prisma:
prisma-persistenceskill
Repository Interface (Port)
More from efesto-cloud/lib
usecase
>
3observer
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.
3type-enum-dict
|
3monad-maybe
Use when writing or reviewing code that returns Maybe<T> from the @efesto-cloud/maybe package.
3value-object
|
3