Spring Boot 3+ project setup (Initializr), REST controllers, Service layer patterns, Exception handling (@ControllerAdvice), Profiles and configuration, Bean validation, Async operations
Spring Boot 3+ project setup (Initializr), REST controllers, Service layer patterns, Exception handling (@ControllerAdvice), Profiles and configuration, Bean validation, Async operations
Build production Spring Boot applications using REST controllers, service layer patterns, exception handling, configuration management, and async operations.
scripts/scaffold.py --name myapp --group-id com.example.@RestController with HTTP methods, constructor injection, DTOs.@Service with @Transactional(readOnly = true) for reads, @Transactional for writes.@RestControllerAdvice with handlers for domain exceptions, MethodArgumentNotValidException, ConstraintViolationException, and generic Exception.application.yml with profiles (dev, prod), @ConfigurationProperties for type-safe config.@Valid on request bodies, use @NotBlank, @NotNull, @Size, etc. on DTOs.@EnableAsync and @Async for long-running operations.@Transactional(readOnly = true) for read operations@ControllerAdvice for global exception handling@Async for long-running operationsResponseEntity for proper HTTP status codes| Anti-Pattern | Fix |
|--------------|-----|
| Field injection with @Autowired | Use constructor injection |
| Exposing entities directly | Use DTOs |
| Missing @Transactional on writes | Add @Transactional |
| Synchronous blocking operations | Use @Async |
| Hardcoded configuration | Use @ConfigurationProperties |
| No exception handling | Implement @ControllerAdvice |
| Missing validation | Add Bean Validation |
| Not using readOnly = true on reads | Add to read methods |
| Resource | Purpose | |----------|---------| | Installation Guide | 5-minute guide: Setup and run | | scripts/utils.py | Project utilities | | scripts/validate.py | Verify project follows skill patterns | | REST API Patterns | references/spring-patterns.json |
This skill should be used when strict adherence to the defined process is required.
Category:other