golang-uber-dig Skill for Claude: What It Does and How to Install It
Makes Claude wire a Go app with uber-go/dig, a runtime container that builds your objects from constructors.
- Installs
- 37.3K
- on skills.sh
- Stars
- 3.7K
- on GitHub
- Files
- 4
- besides SKILL.md
- Updated
- Nov 2026
- last repo commit
golang-uber-dig teaches Claude how to use dig for dependency injection in Go. It covers the container, Provide and Invoke, dig.In and dig.Out parameter objects, named values, value groups and dig.As.
It triggers when you use or adopt uber-go/dig or when the code imports go.uber.org/dig. The skill says dig has no built-in lifecycle and points to fx when you need start and stop hooks.
Good for
- Go developers who want a DI container without a full framework
- Authors of CLI tools, libraries and test harnesses that wire objects at startup
- Developers deciding between dig and fx
Install golang-uber-dig
Claude Code
- 1
Copy this prompt.
Install the golang-uber-dig skill in Claude Code. Run this command: npx skills add https://github.com/samber/cc-skills-golang --skill golang-uber-dig Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
Implements dependency injection in Golang using uber-go/dig — reflection-based container, Provide/Invoke, dig.In/dig.Out parameter and result objects, named values, value groups, optional dependencies, scopes, and Decorate. Apply when using or adopting uber-go/dig, when the codebase imports `go.uber.org/dig`, or when wiring an application graph at startup. For higher-level lifecycle and modules, see `samber/cc-skills-golang@golang-uber-fx` skill.
Sections in SKILL.md
- dig vs. fx
- Container
- Provide and Invoke
- Parameter Objects with dig.In
- Result Objects with dig.Out
- Named Values
- Value Groups
- Provide as Interface (dig.As)
- Full Application Example
- Best Practices
- Common Mistakes
- Testing
- Further Reading
- Cross-References
Key facts
- Author
- samber
- Repository
- samber/cc-skills-golang
- Installs on skills.sh
- 37,345 as of 2026-11-02
- License
- MIT (SKILL.md frontmatter)
- Last commit to the repo
- 2026-11-01
- What is inside
- 5 files including SKILL.md: evals/evals.json and 3 reference guides (advanced, recipes, testing)
- Version
- 1.1.2 (SKILL.md frontmatter)
- skills.sh audits
- Gen Agent Trust Hub pass, Socket pass, Snyk pass
What it includes
dig.New with options such as DryRun and RecoverFromPanics
Claude keeps the container in main and never passes it into services. The skill lists three options: DeferAcyclicVerification, RecoverFromPanics and DryRun.
Read ·
ContainerLazy, memoized constructors
Each output type is built once and shared. Claude wraps Provide calls so registration errors do not turn into confusing missing-type errors later.
Write ·
Provide and InvokeGroup four or more dependencies, tag fields
Claude embeds dig.In and uses the name, optional and group tags.
Write ·
Parameter objects with dig.InReturn several values with name or group tags
One constructor can provide several named or grouped results.
Write ·
Result objects with dig.Outdig.Name for same-type providers; groups for slices
Two providers of one type collide, so Claude names them. Groups feed handlers or health checks into one slice, in no guaranteed order.
Write ·
Named values and value groupsdig.As exposes a concrete type under interfaces
Claude registers a concrete constructor and exposes it under an interface without an adapter.
Write ·
Provide as interfaceDecorate, scopes, optional deps, Visualize
Deeper notes sit in references/advanced.md, recipes.md and testing.md.
Read ·
Advanced and testing guides
From the official docs
Permissions
Low risk
Claude can edit your Go files and run go and git commands in your project. Review the diff before you commit.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It can edit your wiring code and run go commands
Container changes affect how the whole app starts. Commit first and run your tests after. github.com
It shows a go get command for dig
The SKILL.md code block shows go get go.uber.org/dig, which adds dig to your go.mod. Run it yourself if you prefer to control versions. github.com
Technical details
| Turning on read-only | No read-only switch is documented in SKILL.md. |
|---|---|
| Talks to | WebFetch and the Context7 documentation tools appear in allowed-tools |
| Scopes |
|
Questions
What does golang-uber-dig do?
It gives Claude a working method for uber-go/dig: how to register constructors, group parameters and results, name same-type values and test the container.
How do I install golang-uber-dig?
Use the install box at the top of this page. The README says the Go skills are designed as cross-referencing units, so installing only a subset gives a partial view of the guidelines.
Is golang-uber-dig safe to use?
It bundles no scripts. Its allowed-tools line lets Claude read and edit files, run go, golangci-lint, git, godig and gopls commands, and fetch web pages. Review the diff before you commit.
dig vs fx?
The skill says fx is built on dig and adds lifecycle hooks, modules, a signal-aware run loop and event logging. Choose dig for CLI tools, libraries and test harnesses, and fx for long-running services. The repo has a separate golang-uber-fx skill.
dig vs wire?
The skill points to golang-google-wire for compile-time injection. Dig resolves the graph at runtime with reflection, so errors show up at Provide or Invoke time rather than in generated code.
Why does Provide fail with two providers of one type?
The skill says dig errors at Provide time when two providers return the same type without a name. Name them, or merge them into one provider that returns a dig.Out result struct.
Information
updated Nov 2, 2026
- Repository
- samber/cc-skills-golang
- Folder
skills/golang-uber-dig
Sources
Docs, issue trackers and discussions this page is built from.
Show all 3Hide
- golang-uber-dig SKILL.md · github.com
- samber/cc-skills-golang README · github.com
- golang-uber-fx SKILL.md · github.com