golang-uber-dig

golang-uber-dig is a skill for Claude Code from samber/cc-skills-golang. It costs 111 tokens per session (2,588 once invoked), scanned A, original, MIT.

A guide to dependency injection in Go using uber-go/dig, a library that builds and supplies an application’s objects from registered constructors. It covers interfaces, named values, groups, optional dependencies, scopes, and related parameter and result structures.

In plain words
What is it for?
Adding or adopting uber-go/dig, wiring Go application dependencies, defining constructors with dig.In or dig.Out, handling named or grouped values, and diagnosing the object graph.
Why use it?
It helps organise how application components are created and connected, while keeping setup in one composition root and treating constructor errors as startup failures.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code; mentions Codex; built for openclaw.

Part of the cc-skills-golang plugin — 46 skills shipped together

Good fit Adding or adopting uber-go/dig, wiring Go application dependencies, defining constructors with dig.In or dig.Out, handling named or grouped values, and diagnosing the object graph.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/samber/cc-skills-golang/golang-uber-dig
About the project

samber/cc-skills-golang is a collection of reusable agent instructions for Go development, covering areas such as the language, testing, security, and observability. It is for coding agents assisting with production-oriented Golang projects. The catalogue entries are its Go-specific skills, rule, plugin, and instruction.

samber/cc-skills-golang · 3,815 stars · on GitHub · skills.sh

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 samber/cc-skills-golang --skill golang-uber-dig
Clone the repo
git clone --depth 1 https://github.com/samber/cc-skills-golang

Made for: Claude Code.

Or install cc-skills-golang, the plugin that ships this one along with the rest of its 46 skills.

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 golang-uber-dig

README.md
[![agentmods](https://agentmods.dev/badge/skills/samber/cc-skills-golang/golang-uber-dig/github.svg)](https://agentmods.dev/skills/samber/cc-skills-golang/golang-uber-dig)
Your own site
<a href="https://agentmods.dev/skills/samber/cc-skills-golang/golang-uber-dig"><img src="https://agentmods.dev/badge/skills/samber/cc-skills-golang/golang-uber-dig/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 golang-uber-dig

Your own site · 80×15
<a href="https://agentmods.dev/skills/samber/cc-skills-golang/golang-uber-dig"><img src="https://agentmods.dev/badge/skills/samber/cc-skills-golang/golang-uber-dig.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 111 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,588 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 14 Sept 2026
  • Snyk pass 14 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 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.00111 $0.02588
Opus 5.5 $0.00044 $0.01035
Sonnet 5.5 $0.00022 $0.00518
Haiku 4.5 $0.00011 $0.00259

Measured 2mo ago against content hash 6dd33a382627, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

golang-uber-dig 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 2mo ago.

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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/golang-uber-dig/SKILL.md · 232 lines

How it starts

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

Persona: You are a Go architect wiring an application graph with dig. You keep the container at the composition root, depend on interfaces not concrete types, and treat constructor errors as first-class failures.

Using uber-go/dig for Dependency Injection in Go

Reflection-based DI toolkit, designed to power application frameworks (it is the engine behind uber-go/fx) and resolve object graphs during startup.

Official Resources:

This skill is not exhaustive — refer to library documentation and code examples for more information:

  • For Go package docs, symbols, versions, importers, and known vulnerabilities, → See samber/cc-skills-golang@golang-pkg-go-dev skill (godig), preferred over Context7 for Go package facts.
  • To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See samber/cc-skills-golang@golang-gopls skill (gopls).
  • Context7 remains a fallback for docs not indexed on pkg.go.dev.
go get go.uber.org/dig

dig vs. fx

fx is built on dig and shares the same container engine — the DI primitives (Provide, Invoke, In/Out structs, named values, value groups) are identical. fx.In/fx.Out are re-exports of dig.In/dig.Out.

What fx adds on top of dig:

Concern dig fx
DI container ✅ dig.New() ✅ (embedded)
Lifecycle hooks ❌ ✅ fx.Lifecycle OnStart/OnStop
Module system ❌ ✅ fx.Module with scoped decorators
Signal-aware run loop ❌ ✅ app.Run() blocks on SIGINT/SIGTERM
Structured event logging ❌ ✅ fx.WithLogger / fxevent
Startup/shutdown timeout ❌ ✅ fx.StartTimeout / fx.StopTimeout

Choose dig when you need the wiring graph only: CLI tools, libraries exposing a container to callers, test harnesses, or embedding DI into an existing app that manages its own lifecycle.

Read the full file on GitHub · 232 lines

Files

What ships with it

4 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. 2mo ago Changed · +4 lines 6dd33a382627
  2. 2mo ago Changed ba2ea79aa449
  3. 2mo ago First seen · 228 lines · 111 tokens per session scan A 13f3af0b74a2

Subscribe to this mod's changes

golang-uber-dig is a skill published in the GitHub repository samber/cc-skills-golang (3,815 stars, last pushed 6d ago), licensed MIT. It adds 111 tokens to every session and 2,588 once invoked, about $0.0004 per session on Opus 5.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-08-30.

Related

golang-uber-dig compared with skills from other repositories

golang-uber-dig next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
golang-uber-digsamber/cc-skills-golangSkill3.8k6d agoMITA111Claude Code
stack-trace-go-probeopensquilla/opensquillaSkill7.1kyesterdayApache-2.0A42Claude Code
golang-prormyndharis/antigravity-skillsSkill2.0k24d agoMITA61Claude Code, Codex
site-launch-checklistsamber/cc-skillsSkill2427d agoMITA206Claude Code
copywriting-hookssamber/cc-skillsSkill2427d agoMITA172Claude Code
copywriting-prose-creatorsamber/cc-skillsSkill2427d agoMITA170Claude Code
deep-researchsamber/cc-skillsSkill2427d agoMITA333Claude Code