What problem does it solve?
This Skill provides a structured, repeatable approach to building Spring Boot applications that align with modern Java best practices, helping teams deliver high-quality, maintainable software.
Core Features & Use Cases
- Dependency Injection: use constructor injection with private final fields and Lombok's @RequiredArgsConstructor to generate constructors.
- REST Controllers & API Design: create controllers with proper HTTP methods, use ResponseEntity for status control, apply @Valid for request bodies, and version APIs (e.g., /api/v1/...).
- Service & Data Layers: keep services focused on business logic, use Optional<T> for potentially absent results, and apply @Transactional where needed.
- JPA Entities & DTOs: annotate with @Entity/@Table, define @Id, and leverage Lombok for boilerplate reduction; establish clear relationships.
- Testing & Documentation: scaffold controller, service, repository, and integration tests; document public APIs with JavaDoc and OpenAPI annotations.
- Error Handling: use a @ControllerAdvice for global error handling and meaningful error responses.
- Configuration Best Practices: prefer application.yml, externalize configuration, and use Spring Profiles for environment-specific settings.
Quick Start
Example: Generate a Spring Boot module named 'demo' that includes a User entity, a REST controller at /api/v1/users, and a UserService with constructor injection, following the guidelines above.