Constructor-first dependency injection patterns for Spring Boot with optional collaborator handling and bean selection strategies.
Works with
Prioritizes constructor injection to keep dependencies explicit, immutable, and testable without Spring context.
Handles optional dependencies through guarded setters, ObjectProvider, and deterministic no-op defaults.
Resolves bean ambiguity using @Primary, @Qualifier, profiles, and conditional annotations (@ConditionalOnProperty, @ConditionalOnMissingBea
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionspring-boot-dependency-injectionExecute the skills CLI command in your project's root directory to begin installation:
Fetches spring-boot-dependency-injection from giuseppe-trisciuoglio/developer-kit and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate spring-boot-dependency-injection. Access via /spring-boot-dependency-injection in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
0
total installs
0
this week
194
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
194
stars
Provides constructor-first dependency injection patterns for Spring Boot:
ObjectProvider or no-op fallbacks@Primary and @QualifierUse this skill when:
@Service, @Component, @Repository, or @Configuration classFor each class, identify:
Mandatory collaborators belong in the constructor. Optional ones need an explicit strategy such as ObjectProvider, conditional beans, or a no-op implementation.
For application services and adapters:
finalA single constructor is usually enough; @Autowired is unnecessary in that case.
Good options include:
ObjectProvider<T> when lazy access is useful@ConditionalOnProperty or @ConditionalOnMissingBean when wiring should change by configurationAvoid nullable collaborators that leave runtime behavior ambiguous.
When multiple beans share the same type:
@Primary for the default implementation@Qualifier for named variantsIf selection rules become complex, move them into a dedicated configuration class instead of spreading them across services.
Use @Configuration and @Bean methods when:
Business services should not know how infrastructure collaborators are instantiated.
After writing a new service or configuration:
@SpringBootTest
@ContextConfiguration(classes = UserService.class)
class UserServiceWiringTest {
@Autowired UserService userService;
@Test void serviceIsInstantiated() { assertNotNull(userService); }
}
@SpringBootTest for container-wide wiring validation.Failures at step 1 indicate wiring issues before business logic is added.
@Service
public class UserService {
private final UserRepository userRepository;
private final EmailSender emailSender;
public UserService(UserRepository userRepository, EmailSender emailSender) {
this.userRepository = userRepository;
this.emailSender = emailSender;
}
public User register(UserRegistrationRequest request) {
User user = userRepository.save(User.from(request));
emailSender.sendWelcome(user);
return user;
}
}
This class is easy to instantiate directly in a unit test with mocks.
@Service
public class ReportService {
private final ReportRepository reportRepository;
private final NotificationGateway notificationGateway;
public ReportService(
ReportRepository reportRepository,
ObjectProvider<NotificationGateway> notificationGatewayProvider
) {
this.reportRepository = reportRepository;
this.notificationGateway = notificationGatewayProvider.getIfAvailable(NotificationGateway::noOp);
}
}
This keeps optional behavior explicit without leaking null handling through the rest of the class.
@Configuration
public class PaymentConfiguration {
@Bean
@Primary
PaymentGateway stripeGateway() {
return new StripePaymentGateway();
}
@Bean
@Qualifier("fallbackGateway")
PaymentGateway mockGateway() {
return new MockPaymentGateway();
}
}
Use @Primary for the default path and @Qualifier only where a specific variant is required.
@Lazy.references/reference.mdreferences/examples.mdreferences/spring-official-dependency-injection.mdspring-boot-crud-patternsspring-boot-rest-api-standardsunit-test-service-layerMake data-driven prioritization decisions faster
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Prerequisites
Time Estimate
30-60 minutes to see productivity improvements
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid when
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
mattpocock/skills
parcadei/continuous-claude-v3
cursor/plugins
ailabs-393/ai-labs-claude-skills
pproenca/dot-skills
mattpocock/skills
Solid pick for teams standardizing on skills: spring-boot-dependency-injection is focused, and the summary matches what you get after install.
Registry listing for spring-boot-dependency-injection matched our evaluation — installs cleanly and behaves as described in the markdown.
We added spring-boot-dependency-injection from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
Registry listing for spring-boot-dependency-injection matched our evaluation — installs cleanly and behaves as described in the markdown.
spring-boot-dependency-injection reduced setup friction for our internal harness; good balance of opinion and flexibility.
Useful defaults in spring-boot-dependency-injection — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
Useful defaults in spring-boot-dependency-injection — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
I recommend spring-boot-dependency-injection for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
Registry listing for spring-boot-dependency-injection matched our evaluation — installs cleanly and behaves as described in the markdown.
We added spring-boot-dependency-injection from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
showing 1-10 of 55