web-layer

Enforce OpenAPI annotations and DTO conversion in Java Spring controllers.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/GreenFirst-kr/green_first_be --skill web-layer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: web-layer
Source: https://github.com/GreenFirst-kr/green_first_be/tree/main/.claude/skills/web-layer
Command: npx skills add https://github.com/GreenFirst-kr/green_first_be --skill web-layer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides teams to implement or review the web-layer (controller) code with a consistent, well-scoped approach, enforcing patterns such as direct OpenAPI annotations and standardized response handling.

Core Features & Use Cases

  • Direct OpenAPI annotations on controller methods, explicit naming conventions (GetXxxController, CreateXxxController, UpdateXxxController), and no API spec interfaces.
  • DTO conversion via static from() methods in response classes to keep conversion out of controllers.
  • Validation with Bean Validation (@Valid) and clear separation between controller, service, and domain layers to improve maintainability.
  • Avoidance of API spec directories (api/ or api/spec/) and a clear base for web-layer contracts.

Quick Start

Implement or review a new web-layer controller using GetXxxController or CreateXxxController patterns, with OpenAPI annotations on methods and responses wrapped in BaseResponse.

Frequently Asked Questions about web-layer

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

FAQPage Schema
How do I structure Spring Boot controllers with OpenAPI annotations and DTO conversion?

Spring Boot controllers should use direct OpenAPI annotations on methods, avoid API spec interfaces, and handle DTO conversion via static from() methods in response classes to keep controllers clean. Responses are wrapped in BaseResponse for consistent web-layer contracts.

What is the best way to organize web-layer controllers in a Java Spring application?

The best way to organize web-layer controllers is using explicit naming conventions like GetXxxController or CreateXxxController, separating controller, service, and domain layers, and avoiding API spec directories like api/ or api/spec/ to improve maintainability.

Should I use API spec interfaces for Spring REST controllers?

You should avoid using API spec interfaces for Spring REST controllers. Instead, apply OpenAPI annotations directly on controller methods to enforce well-structured REST endpoints and maintain a clear base for web-layer contracts.

How do I validate requests and convert DTOs in Spring web-layer controllers?

Validate requests in Spring web-layer controllers using Bean Validation with @Valid. Convert DTOs by implementing static from() methods within response classes to move conversion logic out of the controller and into the DTO itself.

Why wrap Spring controller responses in BaseResponse?

Wrapping Spring controller responses in BaseResponse ensures standardized response handling across all web-layer REST endpoints. This approach enforces consistent controller practices and provides a uniform contract for API consumers.

Does this web-layer pattern support separating controller logic from service and domain layers?

Yes, this web-layer pattern enforces a clear separation between controller, service, and domain layers. By using static from() methods for DTO conversion and avoiding API spec interfaces, it keeps controller logic focused on routing and web-layer contracts.