spring-boot-dependency-injection
Installation
SKILL.md
Spring Boot Dependency Injection
Overview
Provides constructor-first dependency injection patterns for Spring Boot:
- mandatory collaborators via constructor injection
- optional collaborators via
ObjectProvideror no-op fallbacks - bean selection via
@Primaryand@Qualifier - validation via minimal context tests before full integration
When to Use
Use this skill when:
- creating a new
@Service,@Component,@Repository, or@Configurationclass - replacing field injection in legacy Spring code
- resolving multiple beans of the same type with qualifiers or primary beans
- handling optional features, adapters, or integrations without null-driven wiring
- reviewing circular dependencies or brittle context startup failures
- preparing code for direct constructor-based unit testing