create-rest-controller

Scaffold or update Spring REST controllers with nested DTOs and toCommand() mappings.

3|Updated Feb 6, 2025
One-click install
npx skills add https://github.com/emaarco/easy-zeebe --skill create-rest-controller
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: create-rest-controller
Source: https://github.com/emaarco/easy-zeebe/tree/main/.claude/skills/create-rest-controller
Command: npx skills add https://github.com/emaarco/easy-zeebe --skill create-rest-controller

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of boilerplate code for Spring Boot REST controllers, reducing manual coding effort and ensuring consistency in API development.

Core Features & Use Cases

  • Scaffolds @RestController: Generates a new Spring REST controller file.
  • Creates DTOs: Automatically defines nested request and response Data Transfer Objects (DTOs).
  • Generates Mapping: Includes a toCommand() function for mapping request DTOs to use-case commands.
  • Updates Existing Controllers: Intelligently updates existing controllers if they are found, adding missing elements.
  • Use Case: When you need to expose a new use case as a REST API endpoint, this skill will generate the necessary controller, DTOs, and mapping logic.

Quick Start

Use the create-rest-controller skill to scaffold a new REST controller for the CreateOrderUseCase by providing the path to its port file.

Frequently Asked Questions about create-rest-controller

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

FAQPage Schema
How do I scaffold a Spring Boot REST controller from a use case?โ–ผ

To scaffold a Spring Boot REST controller, provide the path to your use-case port file. The skill generates an @RestController with nested request/response DTOs and a toCommand() mapping function, automating boilerplate API development.

What is the best way to generate request and response DTOs for Spring Boot APIs?โ–ผ

Generating request and response DTOs for Spring Boot APIs is handled by nesting them directly inside the @RestController. The skill automatically defines these Data Transfer Objects alongside the endpoint logic to ensure consistency with domain models.

Can I update an existing Spring REST controller with new endpoints?โ–ผ

Updating existing Spring REST controllers is fully supported. The skill intelligently modifies current controllers by adding missing elements and endpoints, ensuring incremental updates remain consistent with your use-case signatures.

Does this Spring Boot code generator infer HTTP verbs and paths automatically?โ–ผ

Inferring HTTP verbs and paths automatically is a core feature of this Spring Boot code generator. It derives them from use-case names, though you can also provide explicit arguments to override the inferred routing.

How do I map a request DTO to a use-case command in Spring Boot?โ–ผ

Mapping a request DTO to a use-case command in Spring Boot is achieved via a generated toCommand() function. This built-in mapping logic translates inbound adapter requests directly into use-case commands.