mapper-creator

Generate entity-to-DTO mappers with MapStruct or custom converters.

106|11|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/Amplicode/spring-skills --skill mapper-creator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mapper-creator
Source: https://github.com/Amplicode/spring-skills/tree/main/skills/mapper-creator
Command: npx skills add https://github.com/Amplicode/spring-skills --skill mapper-creator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Creates a mapper between an entity and a DTO using MapStruct or a custom converter, accelerating development by automating boilerplate code.

Core Features & Use Cases

  • Generates mapping methods between entity fields and DTO fields, including direct, renamed, flat, and nested mappings.
  • Supports MapStruct-based generation with @Mapping, @InheritInverseConfiguration, and optional AfterMapping or context helpers, or a fully custom mapper variant.
  • Ideal for adding a DTO layer after domain modeling, enabling CRUD mappings, data transfer, and integration with Spring applications.

Quick Start

Provide the entity and DTO, choose MapStruct or a custom mapper, and generate the mapper in the target package.

Frequently Asked Questions about mapper-creator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a MapStruct mapper between an entity and a DTO?

To generate a MapStruct mapper, provide your entity and DTO classes, and the tool produces mapping methods with @Mapping annotations, update helpers, and optional AfterMapping logic in the target package.

What is the best way to map nested and renamed fields in a Kotlin DTO?

Mapping nested, flat, and renamed fields in a Kotlin DTO is handled automatically by generating @Mapping annotations that align mismatched field names and structures between the entity and DTO.

Can I create a custom converter instead of using MapStruct for entity mapping?

Yes, you can generate a fully custom converter instead of a MapStruct mapper, providing standalone mapping logic without relying on annotation-driven code generation.

Does MapStruct support inverse configurations and context helpers for CRUD mappings?

MapStruct supports inverse configurations via @InheritInverseConfiguration and allows optional context helpers, making it suitable for CRUD mappings and data transfer in Spring applications.

When do I need to add a DTO layer after domain modeling?

You need a DTO layer after domain modeling to enable secure data transfer and CRUD mappings, separating your internal domain entities from external API boundaries.

Why use automated mapper generation for Spring applications?

Automated mapper generation accelerates Spring application development by removing the boilerplate code required to manually convert data between domain entities and DTOs.