java-springboot
Installation
SKILL.md
When to Use
- Developing Spring Boot applications
- Need best practices for Spring Boot
- Configuring Spring Boot projects
- Working with Spring framework components
Core Principles
- Constructor Injection — Always use it for testability. Never
@Autowiredon fields. - DTOs — Never expose JPA entities to the API layer. Use records or projection interfaces.
- Package by Feature — Group by domain (order/, user/), not by layer (controller/, service/).
- Validation — Use Bean Validation (
@Valid,@NotBlank) on request DTOs. - Transactions — Keep them short and at the service layer with
@Transactional. - Logging — Use parameterized logging (
{}), never string concatenation. - Security — Never hardcode secrets. Use env vars and
@ConfigurationProperties. - Testing — Use the narrowest test slice that gives you confidence.
- Configuration — Externalize everything via
application.ymland@ConfigurationProperties. - Monitoring — Add Actuator and health checks to every service.