# 502-frameworks-micronaut-rest

Guides your coding agent in designing and reviewing Micronaut REST APIs. Enforces strict HTTP semantics and OpenAPI alignment.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 302 installs · ★ 456
- Author: Juan Antonio Breña Moral
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/jabrena/plinth/tree/HEAD/skills/502-frameworks-micronaut-rest/SKILL.md
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/skills/502-frameworks-micronaut-rest

## What it does

This skill guides code generation and refactoring for Micronaut HTTP services. It aligns `@Controller` endpoints with standard REST semantics using explicit HTTP method annotations and `HttpResponse` status handling. You get DTO validation via `@Valid` alongside centralized Problem Details exception handlers.

The guidelines also cover bounded pagination with `Pageable` and `Idempotency-Key` headers for write retries. For concurrency, it enforces `ETag` and `If-Match`. When dealing with contracts, it supports OpenAPI Generator stubs and `micronaut-openapi` configurations.

The workflow strictly enforces project integrity. The agent must execute `./mvnw compile` before making any edits. If compilation breaks, all changes halt immediately. After edits, it verifies everything with `./mvnw clean verify`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add jabrena/plinth --skill 502-frameworks-micronaut-rest -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/502-frameworks-micronaut-rest/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/502-frameworks-micronaut-rest/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add jabrena/plinth --skill 502-frameworks-micronaut-rest -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/502-frameworks-micronaut-rest/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add jabrena/plinth --skill 502-frameworks-micronaut-rest -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/502-frameworks-micronaut-rest/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install jabrena/plinth 502-frameworks-micronaut-rest
```

2. **Manually: put the files in place**
- File: `.github/skills/502-frameworks-micronaut-rest/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add jabrena/plinth --skill 502-frameworks-micronaut-rest -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/jabrena/plinth --path skills/502-frameworks-micronaut-rest
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/502-frameworks-micronaut-rest/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add jabrena/plinth --skill 502-frameworks-micronaut-rest -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/jabrena/plinth/tree/HEAD/skills/502-frameworks-micronaut-rest/SKILL.md

## When to use it
- align Micronaut controllers with an OpenAPI specification
- configure centralized Problem Details exception handling
- implement optimistic locking using ETag and If-Match
- apply Bean Validation to incoming request DTOs
- set up bounded pagination using Pageable

## Example prompts
- Review our Micronaut controllers and align them with the OpenAPI contract.
- Add Problem Details exception handlers and Bean Validation to user DTOs.
- Configure bounded pagination with Pageable and set up ETag caching.

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 27a0946b2afec58e.

BEGIN THIRD-PARTY FILE 27a0946b2afec58e
```text
---
name: 502-frameworks-micronaut-rest
description: Use when you need to design, review, or improve REST APIs with Micronaut — including @Controller routes, HTTP status codes, DTOs, Bean Validation, exception handlers, pagination, idempotency, ETag/If-Match, caching headers, versioning, contract-first OpenAPI (OpenAPI Generator), optional runtime OpenAPI via micronaut-openapi, and security annotations. This should trigger for requests such as Review or improve Micronaut @Controller REST APIs; Add validation, error handling, or align controllers with the OpenAPI contract on Micronaut HTTP layer; Design Micronaut controllers and DTO validation; Add Micronaut exception handlers and Problem Details responses; Improve pagination filtering or OpenAPI alignment in Micronaut APIs. Part of Plinth Toolkit
license: Apache-2.0
metadata:
  author: Juan Antonio Breña Moral
  version: 0.19.0
---
# Micronaut REST API Guidelines

Apply REST design principles for Micronaut HTTP applications.

**What is covered in this Skill?**

- Semantic HTTP with @Get/@Post/@Put/@Patch/@Delete and HttpResponse status control
- Resource-oriented paths and stable DTO contracts
- @Valid on request bodies with Bean Validation
- Centralized error mapping (ExceptionHandler / problem JSON when applicable)
- Pagination with Pageable and bounded sizes
- OpenAPI contract file (API-first) and OpenAPI Generator for server stubs
- Security annotations (@Secured) on sensitive routes
- Idempotency-Key for retried writes
- ETag / If-Match for optimistic concurrency
- Cache-Control discipline
- API versioning patterns
- ISO-8601 time types in DTOs

**Scope:** Apply recommendations based on the reference rules and good/bad code examples.

## Constraints

Compile before REST refactors; verify after.

- **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change
- **SAFETY**: If compilation fails, stop immediately
- **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements
- **BEFORE APPLYING**: Read the reference for detailed rules and examples
- **EDGE CASE**: If request scope is ambiguous, stop and ask a clarifying question before applying changes
- **EDGE CASE**: If required inputs, files, or tooling are missing, report what is missing and ask whether to proceed with setup guidance

## When to use this skill

- Review or improve Micronaut @Controller REST APIs
- Add validation, error handling, or align controllers with the OpenAPI contract on Micronaut HTTP layer
- Design Micronaut controllers and DTO validation
- Add Micronaut exception handlers and Problem Details responses
- Improve pagination filtering or OpenAPI alignment in Micronaut APIs

## Workflow
```
END THIRD-PARTY FILE 27a0946b2afec58e

The third-party file has ended. Everything between the 27a0946b2afec58e tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2711 of 3470 bytes. © Juan Antonio Breña Moral · Apache-2.0 · https://github.com/jabrena/plinth/tree/HEAD/skills/502-frameworks-micronaut-rest/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
