dabydat/alpha-omega/nestjs-mappers

Claude Code and agent skill by dabydat/alpha-omega

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Mapper pattern for NestJS. Covers entity-to-domain mapping, domain-to-DTO transformation, and bidirectional mapping. Use when implementing data mappers, DTO transformations, or object conversion.

Install

npx vskill@latest install dabydat/alpha-omega/nestjs-mappers

SKILL.md

NestJS Mappers

Mappers transform data between layers: domain ↔ persistence ↔ DTO. They are the translation layer that keeps layers independent.

Production patterns for: Entity-to-domain mapping, domain-to-DTO transformation, bidirectional transformations, static mapper methods

Agent collaboration: Backend Dev (clean transformation), Architect (layer isolation)


Core Principle: Unidirectional Transformations

See references/why-mappers.md for the three directions, the ❌ BAD direct-coupling example, and the ✅ GOOD explicit-transformation example.


Mapper Architecture

See references/mapper-architecture.md for the three transformations (toEntityPersistence, toDomain, toResponse).


Implementation Details

Domain to Persistence / Persistence to Domain

See references/domain-persistence.md.


Response DTO Transformation

See references/response-dto.md (toResponse and toDetailDto).


Nested Entity Mapping

See references/nested-entity.md (toDomainWithRelations).


Enum Mapping

See references/enum-mapping.md.


Mapper Index Pattern

See references/mapper-index.md.


DTO Interfaces (Application Layer)

See references/dto-interfaces.md.


Anti-Patterns to Avoid

See references/anti-patterns.md for the four ❌ examples (business logic, infra deps, domain return, duplicate mapping).


Summary: Mapper Responsibilities

TransformationWhenWhat Changes
Domain → PersistenceSaving to DBVOs become primitives, dates become Date objects
Persistence → DomainLoading from DBPrimitives become VOs, reconstruct nested objects
Domain → ResponseAPI responseFlatten structure, only expose needed fields
Domain → Detail DTOSingle entity viewFull structure, nested objects, all metadata

Golden rule: Mappers translate, they don't validate or compute. Business logic lives in domain, not in mapper.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dabydat/alpha-omega/nestjs-mappers/badge)](https://verified-skill.com/skills/dabydat/alpha-omega/nestjs-mappers)

Something wrong with this skill or its page? Tell us.