spring-boot-dependency-injection

spring-boot-dependency-injection is a skill for Claude Code from giuseppe-trisciuoglio/developer-kit. It costs 52 tokens per session (1,288 once invoked), scanned A, original, MIT.

A guide to wiring Spring Boot classes together through dependency injection, where the framework supplies the objects a class needs. It focuses on constructor injection, optional dependencies, selecting between multiple implementations, and checking application startup.

In plain words
What is it for?
Use it when creating services or configuration classes, modernizing existing Spring code, handling optional integrations, or diagnosing circular dependencies.
Why use it?
It helps replace fragile field injection, resolve ambiguous beans, avoid null-based configuration, and make classes easier to test.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the developer-kit-java plugin — 52 skills, 11 commands, 9 agents shipped together

Good fit Use it when creating services or configuration classes, modernizing existing Spring code, handling optional integrations, or diagnosing circular dependencies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/giuseppe-trisciuoglio/developer-kit/spring-boot-dependency-injection
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add giuseppe-trisciuoglio/developer-kit --skill spring-boot-dependency-injection
Clone the repo
git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kit

Made for: Claude Code.

Or install developer-kit-java, the plugin that ships this one along with the rest of its 52 skills, 11 commands, 9 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spring-boot-dependency-injection

README.md
[![agentmods](https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-dependency-injection/github.svg)](https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-dependency-injection)
Your own site
<a href="https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-dependency-injection"><img src="https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-dependency-injection/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for spring-boot-dependency-injection

Your own site · 80×15
<a href="https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-dependency-injection"><img src="https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-dependency-injection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,288 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 1 Apr 2026
  • Snyk pass 1 Apr 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.01288
Opus 5 $0.00026 $0.00644
Sonnet 5 $0.00010 $0.00258
Haiku 4.5 $0.00005 $0.00129

Measured yesterday against content hash 1490386566fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

spring-boot-dependency-injection scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/developer-kit-java/skills/spring-boot-dependency-injection/SKILL.md · 190 lines

How it starts

The opening of the file, as written. The whole thing — 190 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Spring Boot Dependency Injection

Overview

Provides constructor-first dependency injection patterns for Spring Boot:

  • mandatory collaborators via constructor injection
  • optional collaborators via ObjectProvider or no-op fallbacks
  • bean selection via @Primary and @Qualifier
  • validation via minimal context tests before full integration

When to Use

Use this skill when:

  • creating a new @Service, @Component, @Repository, or @Configuration class
  • 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

Instructions

1. Separate mandatory and optional collaborators

For each class, identify:

  • mandatory collaborators required for correct behavior
  • optional collaborators that enable integrations, caching, notifications, or feature-flagged behavior

Mandatory collaborators belong in the constructor. Optional ones need an explicit strategy such as ObjectProvider, conditional beans, or a no-op implementation.

2. Default to constructor injection

For application services and adapters:

  • inject mandatory dependencies through the constructor
  • keep injected fields final
  • instantiate the class directly in unit tests without starting Spring

A single constructor is usually enough; @Autowired is unnecessary in that case.

3. Resolve optional behavior intentionally

Good options include:

  • ObjectProvider<T> when lazy access is useful
  • @ConditionalOnProperty or @ConditionalOnMissingBean when wiring should change by configuration
  • a no-op implementation when the caller should not care whether the feature is enabled

Avoid nullable collaborators that leave runtime behavior ambiguous.

4. Use bean selection annotations only when needed

When multiple beans share the same type:

  • use @Primary for the default implementation
  • use @Qualifier for named variants
  • keep the qualifier names stable and easy to grep

Read the full file on GitHub · 190 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 190 lines · 52 tokens per session scan A 1490386566fd

Subscribe to this mod's changes

spring-boot-dependency-injection is a skill published in the GitHub repository giuseppe-trisciuoglio/developer-kit (344 stars, last pushed 2d ago), licensed MIT. It adds 52 tokens to every session and 1,288 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-10.

Related

Other skills, from other repositories