What problem does it solve?
This Skill helps you implement correct, maintainable dependency injection in Go using uber-go/dig, so your application components can be composed cleanly at startup without manual plumbing.
Core Features & Use Cases
- Provide/Invoke graph wiring: Register constructors with Provide and resolve runtime dependencies with Invoke, with clear construction-error behavior.
- Parameter and result objects: Use dig.In and dig.Out to keep constructor signatures readable while supporting optional dependencies, named values, and grouped results.
- Practical DI patterns: Disambiguate duplicate types with dig.Name, aggregate many implementations with value groups, expose interfaces via dig.As, and structure request-level isolation using dig scopes.
- Startup correctness guidance: Use container options like DryRun, DeferAcyclicVerification, and RecoverFromPanics to validate graphs early and handle constructor failures safely.
Quick Start
Use the golang-uber-dig skill to generate a dig container setup that uses dig.In parameter objects, dig.Name (or dig.Out result tags) for multiple *sql.DB instances, and a group-based dig.Out for assembling route handlers into a single consumer.