
Dependency injection
Guides Guice dependency injection wiring in Sankhya Addon Studio addons
Dependency injection is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 7
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Dependency injection
This skill helps an agent set up, review and debug Google Guice dependency injection inside Sankhya Addon Studio 2.0 projects. It explains which stereotype annotations the framework auto-scans, when to inject through constructors, how custom modules with Multibinder and factory methods are written, and when to use singleton scope or Provider for lazy or circular dependencies.
The guidance includes a checklist for new injectable classes and custom modules, and a table of common errors with their fixes. It covers deploy-time failures such as duplicate bindings for the same interface, which only surface when the injector is created on the server rather than during the build.
The material is written in Portuguese and assumes Java 8, Gradle and the Addon Studio SDK. It points to related skills for controllers, controller advice, MapStruct, Retrofit and configuration values.
When your agent uses it
Configura, revisa e debuga DI Guice em Sankhya Addon Studio — `@Inject` de `com.google.inject`, `@Component`, `@CustomModule`, `Provider<T>`, `Multibinder`, `@Singleton`, escopos. Use ao montar wiring, criar/alterar módulos Guice, ao injetar repository/service em controller, job ou listener (costura entre camadas), ao revisar/auditar dependências, quando o addon sobe (deploy) e reclama que não conseguiu criar/instanciar um componente, que "não achou como criar" o seu service, que falta implementação ligada ou que não achou construtor (`ConfigurationException`, `CreationException`, `No implementation bound`, `Could not find a suitable constructor`), ou ao tocar em código com `@Inject`/`@CustomModule`/`AbstractModule`. Erro de deploy que nomeia o componente que o Guice não conseguiu criar já é diagnóstico pronto: o dono é esta skill, não o sub-agent `troubleshooter`. NÃO usar quando o valor a injetar é parâmetro de configuração do Sankhya — isso é `@Value`, skill `value`.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (17 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the addon-studio plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add snk-devcenter/addon-studio
/plugin install addon-studio@snk-devcenterOr copy only this skill to ~/.claude/skills/dependency-injection:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/dependency-injection &&
cp -R "$tmp/plugins/addon-studio/skills/dependency-injection" ~/.claude/skills/dependency-injection &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/dependency-injection inside it instead.
Copy the skill folder to ~/.agents/skills/dependency-injection to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/dependency-injection &&
cp -R "$tmp/plugins/addon-studio/skills/dependency-injection" ~/.agents/skills/dependency-injection &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/dependency-injection inside it instead.
Copy the skill folder to ~/.cursor/skills/dependency-injection to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/dependency-injection &&
cp -R "$tmp/plugins/addon-studio/skills/dependency-injection" ~/.cursor/skills/dependency-injection &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/dependency-injection inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/snk-devcenter/addon-studio.git --path plugins/addon-studio/skills/dependency-injectionOr copy the folder to ~/.gemini/skills/dependency-injection yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/dependency-injection:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/dependency-injection &&
cp -R "$tmp/plugins/addon-studio/skills/dependency-injection" ~/.copilot/skills/dependency-injection &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/dependency-injection inside it instead.
Get the folder:
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.gitThen copy addon-studio/plugins/addon-studio/skills/dependency-injection into your agent's skills folder as dependency-injection. Agents that support SKILL.md read one folder per skill.
What it does
- Constructor injection rules
- Covers the required use of Guice's Inject annotation on constructors and private final dependencies.
- Stereotype reference
- Explains which annotations are auto-managed for controllers, repositories, components and advice.
- Custom module patterns
- Shows Multibinder strategy registration and factory methods annotated with Provides and Singleton.
- Provider and singleton scope
- Describes when to inject lazy providers for circular dependencies and when to use singleton scope.
- Duplicate binding diagnosis
- Explains why two components implementing one interface break deployment and how to fix it.
- Deploy error troubleshooting
- Lists common Guice exceptions and build problems with their corrections.
Good for
- Wire a service into a REST controller using constructor injection
- Register several strategy implementations through a Multibinder module
- Fix a deploy failure caused by a Guice binding already set
- Make a singleton HTTP interceptor depend on a service without a circular reference
- Review an Addon Studio project for misused dependency injection annotations
Dependency injection FAQ
Which Inject annotation should be used?
The skill specifies com.google.inject.Inject and says javax.inject.Inject should not be used.
Should @Component be added to a @Controller or @Repository?
No. Controllers and repositories are managed automatically, so the Component annotation should be removed from them.
Why does deployment fail with BindingAlreadySet even when the build passes?
Two components implementing the same interface are both bound to it when the injector is created on deploy. The skill recommends removing the stereotype from one and providing it through a custom module.
When should a dependency be injected as Provider instead of directly?
The skill recommends Provider for circular dependencies, singletons that need request-scoped services, and lazy initialization of costly objects.
How do I install Dependency injection in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/dependency-injection to use it in all your projects, or to .claude/skills/dependency-injection in one project. Or install the addon-studio plugin, which includes it: /plugin marketplace add snk-devcenter/addon-studio, then /plugin install addon-studio@snk-devcenter.
Does Dependency injection run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Dependency injection?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Dependency injection?
The closest alternatives to Dependency injection are Retrofit, Go dependency injection, Value, Mapstruct and Test.
Where this comes from
- Description: from the skill's own SKILL.md.
More from snk-devcenter/addon-studio

Adds dynamic search filters to Sankhya entity finders before the query runs
- Open source
- 7 GitHub stars
- Developer tools

Guides writing Sankhya commercial business rules with @BusinessRule for sales documents
- Open source
- 7 GitHub stars
- Enterprise it

Lets agents write, review and refactor Sankhya document callbacks with @Callback hooks
- Open source
- 7 GitHub stars
- Developer tools

Builds and reviews Sankhya REST endpoints with @Controller, DTOs and transactions
- Open source
- 7 GitHub stars
- Developer tools

Sets up global Sankhya exception handlers with rollback, error DTOs and HTTP status
- Open source
- 7 GitHub stars
- Developer tools

Generates Sankhya CRUD screens from table XML in datadictionary/ with no JS or HTML
- Open source
- 7 GitHub stars
- Developer tools


