/micronaut-standards:dtofrom Micronaut Standards
OneLiteFeather's request-DTO conventions for Micronaut REST APIs — records with @Serdeable/@Introspected, one shared Create/Update DTO controlled by JSR-380 validation groups instead of separate DTO types per action, and entity conversion methods living on the DTO itself. Use this whenever adding a new request body type to a Micronaut controller. For the response side (success/error modeling), see the response-modeling skill; for endpoint-level OpenAPI documentation, see openapi — this skill covers only the incoming request DTO and its own field-level @Schema annotations.
Ships in Micronaut Standards. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A request DTO is a Java record, annotated @Serdeable (Micronaut Serde, for JSON (de)serialization,
meta-annotated with @Introspected so bean introspection for validation works without reflection at
runtime too — no separate @Introspected needed alongside it). It lives in domain/<feature>/,
alongside the response DTOs from the response-modeling skill.
Rather than a separate CreateFooDTO/UpdateFooDTO pair, one DTO serves both actions, with JSR-380
validation groups deciding which fields are required for which action:
package net.onelitefeather.otis.domain.font;
import net.onelitefeather.otis.validation.ValidationGroup.Create;
import net.onelitefeather.otis.validation.ValidationGroup.Update;
@Schema
@Serdeable
public record FontModelDTO(
@Schema(description = "ID of the font model", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@Null(groups = Create.class)
@NotNull(groups = Update.class)
UUID id,
@Schema(description = "Display name for the UI", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(groups = {Create.class, Update.class})
String uiName,
@Schema(description = "The path to the texture", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(groups = {Create.class, Update.class})
String texturePath
) {
public @NotNull FontEntity toFontModel() {
return new FontEntity(id, uiName, texturePath);
}
}
The marker interfaces live in a shared validation package, next to the DTOs that use them:
package net.onelitefeather.otis.validation;
public interface ValidationGroup {
interface Create { }
interface Update { }
}
The controller (see routing) triggers the right group per action:
@Post
@Validated(groups = ValidationGroup.Create.class)
public HttpResponse<FontModelResponseDTO> add(@Body FontModelDTO item) { /* ... */ }
@Put("/{id}")
@Validated(groups = ValidationGroup.Update.class)
public HttpResponse<FontModelResponseDTO> update(@PathVariable UUID id, @Body FontModelDTO item) { /* ... */ }
The id field is a good example of why groups matter here: it must be absent (@Null) on create — the
server assigns it — and present (@NotNull) on update — the client must say which record it's updating.
A single DTO with groups expresses this without two near-duplicate record types that would drift apart
over time as fields get added to one and forgotten on the other.
A request DTO owns its own toXxxEntity() conversion method (as toFontModel() above) — never on the entity (see entity-design, which explicitly keeps entities free of anything but persistence concerns),
and never in a standalone FooMapper class. The DTO already knows its own field-to-constructor mapping;
introducing a third class whose only job is to repeat that knowledge adds a file with no independent
reason to change on its own.
@Schema annotations belong here@Schema(description = ..., requiredMode = ...) on each field documents the field for OpenAPI. This is
this skill's responsibility, not openapi's — openapi covers the endpoint-level @Operation/
@ApiResponse documentation on the controller/*Api interface, while the DTO documents its own shape
once, reused by every endpoint that consumes or returns it.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub onelitefeathernet/onelitefeather-claude-marketplace --plugin micronaut-standards14 skills in this plugin
/configurationOneLiteFeather's convention for typed application configuration in a Micronaut REST API — one @ConfigurationProperties class per functional area in a dedicated config/ package, instead of ad-hoc properties scattered across the application entry point. Use this whenever a Micronaut backend needs a new piece of externalized configuration (a feature flag, an external service URL, a limit/threshold) and you're deciding where the corresponding Java type should live./dependency-managementOneLiteFeather's Gradle/Micronaut dependency-management conventions for REST API backends — the Micronaut Application and AOT plugins, reading the Micronaut version from gradle.properties instead of hardcoding it, the mn.* platform catalog, the private OneLiteFeather Maven repo, and the optional CycloneDX SBOM plugin. Use this whenever setting up or editing a Micronaut backend's build.gradle.kts/settings.gradle.kts. For the general OneLiteFeather Gradle/BOM mechanics that apply beyond Micronaut (private repo credential split, Java toolchain pattern), see minestom-knowledge:gradle/boms instead. For observability, database-migration, Testcontainers, and security dependencies specifically, see the observability, liquibase, testcontainers, and security skills — this skill only lists that those dependencies exist and where to look, not their coordinates; the one exception is structured-logging dependencies (Logstash encoder, OpenTelemetry MDC appender), whose coordinates live directly in this skill since `logging` covers only their usage.Other plugins' skills for the same job