spring-boot-4-conventions
Installation
SKILL.md
Spring Framework 7 / Spring Boot 4 conventions
Java 25 + Spring Framework 7 + Spring Boot 4. Prefer the most modern idiom unless an ADR explains otherwise.
Defaults to apply
Package layout — by feature, not by layer
Top-level packages are bounded contexts / features, not technical layers.
Default: flat feature package. All classes live directly in com.example.<feature> while the feature is small. Add typed sub-packages only when the feature package becomes crowded (rule of thumb: more than ~6–8 classes of mixed types, or when navigation becomes hard).
When the feature grows, extract into these typed sub-packages (add only the ones needed — do not pre-create empty ones):