dto-creator

Generate Java or Kotlin DTOs from entities with per-field controls.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Generating DTOs for entities is repetitive and error-prone; this skill automates the boilerplate and enforces consistent DTO structures.

Core Features & Use Cases

  • Supports Java and Kotlin DTOs (plain classes, records, and Lombok-enabled variants).
  • Handles per-field controls (renaming, validations, and customizations), sub-DTOs (NEW_CLASS, NEW_NESTED_CLASS, EXIST_CLASS, FLAT), and collision-safe naming.
  • Delegates mapping tasks to a dedicated mapper-creator when downstream conversion is required, keeping DTO generation focused.
  • Provides skeletons and fragment-driven generation order to produce clean, consistent code that respects project indentation and import rules.

Quick Start

Generate a DTO for an entity using the default Java plain-class settings.

Frequently Asked Questions about dto-creator

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

FAQPage Schema
How do I generate a DTO from a Java or Kotlin entity?

To generate a DTO from an entity, the Skill reads your entity class and produces a matching DTO with inherited constraints, preserving your project's indentation and import rules. It supports plain classes, records, and Lombok variants for both Java and Kotlin.

Can I customize individual fields and handle sub-DTOs during DTO generation?

Yes, you can apply per-field controls like renaming and validations, and manage sub-DTOs using strategies like NEW_CLASS, NEW_NESTED_CLASS, EXIST_CLASS, or FLAT. The generation process also includes auto-resolving naming collisions to ensure clean code.

How does DTO generation handle mapping conversions between entities and DTOs?

When conversion is required, the DTO generator delegates mapping tasks to a dedicated mapper-creator Skill. This delegation keeps the DTO generation process focused on structure while ensuring mapping logic is handled by a specialized tool.

Does this DTO generator support Lombok and Kotlin records?

Yes, the DTO generator supports Lombok-enabled variants and Kotlin records out of the box. It accurately produces clean, consistent code that aligns with your chosen Java or Kotlin DTO shapes and project conventions.

What is the best way to avoid naming collisions when creating multiple DTOs?

The best way to avoid naming collisions is to rely on the generator's built-in collision-safe naming auto-resolution. It automatically adjusts names during the generation of DTOs and sub-DTOs, preventing conflicts without manual intervention.