dto-creator

Generates DTO classes for JPA entities in Java or Kotlin Spring projects.

Updated May 4, 2026
One-click install
npx skills add https://github.com/studenkov/FinanceTracker --skill dto-creator-studenkov
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dto-creator
Source: https://github.com/studenkov/FinanceTracker/tree/main/.agents/skills/dto-creator
Command: npx skills add https://github.com/studenkov/FinanceTracker --skill dto-creator-studenkov

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Manually writing Data Transfer Object classes for JPA entities is repetitive and error-prone, especially when handling associations, validation annotations, and language variants. This Skill automates DTO generation by inspecting the entity model through the Spring MCP server and producing consistent, convention-following code. ## Core Features & Use Cases - Multi-variant DTO generation: Creates Java plain classes, Java records, Lombok-annotated classes, or Kotlin data classes, auto-selected from project language, JDK version, and classpath dependencies. - Association handling: Supports four sub-DTO strategies per association (new class, nested class, existing class, or flat id fields) with automatic back-reference filtering. - Validation inheritance: Copies Jakarta/Hibernate Validator constraints from entity fields onto DTO fields, with support for adding or removing constraints per field. - Use Case: When building a REST controller for a Spring PetClinic-style app, ask for a DTO for the Vet entity and receive a Java record with nested SpecialtyDto records, inherited validation annotations, and a Javadoc link to the source entity. ## Quick Start Ask the assistant to create a DTO for a specific entity, for example: create a DTO for the Vet entity as a Java record with all fields.

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 class for a JPA entity in Spring?

Name the entity in your request, such as "create DTO for Vet", and the skill inspects the entity via the Spring MCP server, then generates the DTO with selected fields, constructors, equals/hashCode, and toString. It auto-detects language, JDK, and dependencies to pick the right variant.

Java record vs Lombok vs plain class for DTOs — which does it choose?

The skill decides from project context: Java records when JDK is 16 or higher and Lombok is absent, Lombok annotations when Lombok is on the classpath and requested, and plain classes otherwise. You can override the choice explicitly in your prompt.

Does it support Kotlin data classes for DTO generation?

Yes, Kotlin projects automatically route to data class generation with val/var constructor parameters, @field: validation annotations, and preserved collection types like MutableSet. Java types are converted to Kotlin equivalents such as Int and String.

How are entity associations handled in generated DTOs?

Each association offers four options: a separate DTO file, a nested class, reusing an existing DTO, or flat fields like typeId or specialtyIds. Back-reference ManyToOne fields pointing to a parent entity are automatically excluded from selection.

What happens if the Spring MCP server is not connected?

The skill checks for Amplicode MCP tools before starting. If none are available, it delegates to the amplicode-install skill to install the Amplicode IntelliJ plugin and configure the MCP server, then resumes generation.

Can it copy validation annotations from entity fields to the DTO?

Yes, when Hibernate Validator or Jakarta Validation is on the classpath, constraints like @NotNull, @Size, and @Pattern are inherited from entity fields by default. You can also add extra constraints or remove inherited ones per field.