spring-api

Generates Spring Boot REST API endpoints across Controller, Service, Repository, Entity, and DTO layers.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/VelkaressiaBlutkrone/spring-python-llm-exam-mng --skill spring-api-velkaressiablutkrone
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: spring-api
Source: https://github.com/VelkaressiaBlutkrone/spring-python-llm-exam-mng/tree/main/.claude/skills/spring-api
Command: npx skills add https://github.com/VelkaressiaBlutkrone/spring-python-llm-exam-mng --skill spring-api-velkaressiablutkrone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually scaffolding a new REST API endpoint in a Spring Boot project requires writing consistent code across five layers (Entity, Repository, DTO, Service, Controller) plus tests, and any deviation from project conventions creates maintenance debt. This Skill generates the entire stack following the project's established patterns, including WebClient-based LLM integration and error handling. ## Core Features & Use Cases - Full-Layer Generation: Creates Entity, JPA Repository, DTO with static from() factory, transactional Service, and REST Controller in one consistent pass. - LLM Integration Patterns: Applies the project's WebClient patterns for calling the Python FastAPI inference server, including LlmServiceUnavailableException and LlmTimeoutException error mapping. - Convention Enforcement: Enforces annotation ordering, FetchType.LAZY relationships, Mono/Flux async responses, SSE streaming, and X-Staff-Id header conventions. - Use Case: When you need to add a new /api/appointments endpoint to the medical consultation system, the Skill generates all layers matching the existing MedicalController and ChatController patterns, plus MockMvc tests covering success, 503, and 504 cases. ## Quick Start Ask the AI to create a new API endpoint for your domain, for example by saying create a Spring API endpoint for patient appointments with history retrieval.

Frequently Asked Questions about spring-api

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

FAQPage Schema
How do I create a Spring Boot REST API endpoint with all layers?▼

Generate the layers in order: Entity with JPA annotations, Repository extending JpaRepository, DTO with a static from() factory method, Service with @Transactional, and Controller with @RestController. This Skill automates that sequence following project conventions.

How to call a Python FastAPI LLM server from Spring Boot?▼

Use WebClient with post().uri("/infer/{endpoint}").bodyValue(...).retrieve().bodyToMono(LlmResponse.class) for non-blocking calls. Map WebClientRequestException to a 503 service-unavailable error and TimeoutException to a 504 timeout error.

Should Spring controllers return Entity objects directly?▼

No, controllers should never expose JPA entities. Convert entities to DTOs using a static from() factory method on the response DTO, which prevents lazy-loading issues and decouples the API contract from the database schema.

Does Spring WebClient support SSE streaming responses?▼

Yes, set produces = MediaType.TEXT_EVENT_STREAM_VALUE on the endpoint and return Flux<String> from the controller method. WebClient consumes the upstream stream reactively and forwards events to the client as Server-Sent Events.

How do I test a Spring controller that returns Mono?▼

Use @WebMvcTest with MockMvc and mock the service with @MockitoBean. Apply the asyncDispatch pattern: perform the request, expect async dispatch to start, then dispatch and verify the final response body and status.