PlugWiki

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. 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. 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

  1. dig vs. fx
  2. Container
  3. Provide and Invoke
  4. Parameter Objects with dig.In
  5. Result Objects with dig.Out
  6. Named Values
  7. Value Groups
  8. Provide as Interface (dig.As)
  9. Full Application Example
  10. Best Practices
  11. Common Mistakes
  12. Testing
  13. Further Reading
  14. Cross-References

Key facts

Author
samber
Installs on skills.sh
37,345 as of 2026-11-02
Last commit to the repo
2026-11-01

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 · Container

  • Lazy, 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 Invoke

  • Group four or more dependencies, tag fields

    Claude embeds dig.In and uses the name, optional and group tags.

    Write · Parameter objects with dig.In

  • Return several values with name or group tags

    One constructor can provide several named or grouped results.

    Write · Result objects with dig.Out

  • dig.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 groups

  • dig.As exposes a concrete type under interfaces

    Claude registers a concrete constructor and exposes it under an interface without an adapter.

    Write · Provide as interface

  • Decorate, 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-onlyNo read-only switch is documented in SKILL.md.
Talks toWebFetch and the Context7 documentation tools appear in allowed-tools
Scopes
  • allowed-tools: Read, Edit, Write, Glob, Grep, Agent, WebFetch, LSP

  • Bash limited to go, golangci-lint, git, godig and gopls

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

Folder
skills/golang-uber-dig

samber/cc-skills-golangskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 3
  1. golang-uber-dig SKILL.md · github.com
  2. samber/cc-skills-golang README · github.com
  3. golang-uber-fx SKILL.md · github.com

Updated Nov 2, 2026.