golang-uber-dig

golang-uber-dig is a skill for Claude Code from alexastrum/skl. It costs 111 tokens per session (2,460 once invoked), scanned A, a copy of golang-uber-dig, MIT.

A guide to dependency injection in Go using uber-go/dig. Dependency injection means providing a component's required services from outside instead of having the component create them itself.

In plain words
What is it for?
Use it when adopting dig or wiring Go applications with constructors, interfaces, optional or named dependencies, groups of values, scopes, and decorators.
Why use it?
It helps organize how application components are created and connected, especially when many services depend on one another.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code; installed under .agents/ (shared by several agents); built for openclaw.

Good fit Use it when adopting dig or wiring Go applications with constructors, interfaces, optional or named dependencies, groups of values, scopes, and decorators.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alexastrum/skl/golang-uber-dig
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 alexastrum/skl --skill golang-uber-dig
Clone the repo
git clone --depth 1 https://github.com/alexastrum/skl

Made for: Claude Code.

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/alexastrum/skl/golang-uber-dig/github.svg)](https://agentmods.dev/skills/alexastrum/skl/golang-uber-dig)
Your own site
<a href="https://agentmods.dev/skills/alexastrum/skl/golang-uber-dig"><img src="https://agentmods.dev/badge/skills/alexastrum/skl/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/alexastrum/skl/golang-uber-dig"><img src="https://agentmods.dev/badge/skills/alexastrum/skl/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,460 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.
Origin 94% copy Near-identical to another mod 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.02460
Opus 5.5 $0.00044 $0.00984
Sonnet 5.5 $0.00022 $0.00492
Haiku 4.5 $0.00011 $0.00246

Measured 2mo ago against content hash 70b02f933190, 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

This is a copy

94% identical to golang-uber-dig — 16 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/golang-uber-dig/SKILL.md · 226 lines

How it starts

The opening of the file, as written. The whole thing — 226 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. Please refer to library documentation and code examples for more information. Context7 can help as a discoverability platform.

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.

Choose fx for long-running services (HTTP servers, workers, daemons) — lifecycle and signal handling are non-negotiable there. See samber/cc-skills-golang@golang-uber-fx skill.

Container

import "go.uber.org/dig"

c := dig.New()

Useful options: dig.DeferAcyclicVerification() (faster startup), dig.RecoverFromPanics() (turn panics into dig.PanicError), dig.DryRun(true) (validate without invoking).

Read the full file on GitHub · 226 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 First seen · 226 lines · 111 tokens per session scan A 70b02f933190

Subscribe to this mod's changes

golang-uber-dig is a skill published in the GitHub repository alexastrum/skl (10 stars, last pushed 4mo ago), licensed MIT. It adds 111 tokens to every session and 2,460 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 94% identical to golang-uber-dig, differing in 16 lines, and is treated as a copy.

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-digalexastrum/sklSkill104mo agoMITA111Claude Code
goericrisco/rsc-harnessSkill5293d agoMITA86Claude Code, Codex
goznlgis/opengis-skillsSkill7811d agoMITD88Claude Code, Codex
printing-pressmvanhorn/cli-printing-pressSkill4.9ktodayMITA86Claude Code
gographozgurcd/gographSkill231yesterdayMITA69Claude Code
go-127dimetron/pi-goSkill222yesterdayMITA177Claude Code, Codex
bubbletea-testingdimetron/pi-goSkill222yesterdayMITA139Claude Code, Codex