SkillsReviewed · samber

golang-uber-dig

golang-uber-dig is a coding-assistant skill for Go developers connecting application components with Uber's dig, but its examples need project-specific completion and review. It covers constructor registration, named dependencies, value groups and graph validation, with additional guidance on scopes, decorators and testing. The underlying dig library leaves application lifecycle management to other code.

Researched 16 Nov 2026

In short.

golang-uber-dig is a coding-assistant skill for Go developers connecting application components with Uber's dig, but its examples need project-specific completion and review. Its main strength is focused guidance on constructor wiring, interfaces, named values, groups and structural graph validation. Important limits include inconsistent descriptions of cycle detection and request-scope examples that do not establish concurrent-use safety. The underlying dig library has no built-in application lifecycle management. No code or model evaluations were executed, and the supplied evaluation scenarios contain no results.

Researched and written by an AI model and checked by a second AI model. How it works

Covers all five supplied files within skills/golang-uber-dig at commit d68d80aec298e1b74b37c2a472c002b5217248b3: SKILL.md, evals/evals.json and references/advanced.md, recipes.md and testing.md. The repository-root LICENSE is included as the related notice. Other repository files, companion skills, linked documentation and the dig implementation are outside the supplied evidence. No code, assistant evaluations or application journeys were executed. Runtime correctness, concurrency, performance and environment compatibility remain unassessed.

The overview

Identity

golang-uber-dig is an assistant-loadable instruction package in samber/cc-skills-golang, attributed to samber. Its metadata declares version 1.2.2, user invocation support and compatibility with Claude Code, Codex or similar coding assistants working on Go projects. The source folder is [https://github.com/samber/cc-skills-golang/tree/main/skills/golang-uber-dig].

The package contains SKILL.md, three reference documents and an evaluation file. Its role is to guide an assistant's work with go.uber.org/dig.

Assessment

This is a useful starting point for reviewing or implementing dig wiring. It connects common problems to specific patterns: dig.In for many dependencies, named values for multiple instances of one type, groups for independently registered contributors and dig.As for exposing interfaces.

Its usefulness rests on written guidance and examples. Several snippets contain application-specific types or placeholder bodies, and no execution results establish correctness, assistant improvement or production suitability.

Who it is for

The clearest audience is Go developers already using dig or considering it for application startup wiring. Beginners get examples explaining how constructors supply dependencies; experienced developers get references for interface exposure, decorators, scopes, error handling and graph visualization.

The guide positions dig for wiring graphs in CLI tools, test harnesses and applications that already manage their lifecycle. For services needing startup hooks, graceful shutdown and signal handling, it directs readers toward Uber Fx.

What it covers

The skill explains Provide and Invoke, dig.In parameter objects, dig.Out result objects, named values, unordered value groups, group flattening and dig.As interface registration. Supporting references cover optional dependencies, child scopes, scoped decorators, constructor errors, panic recovery and DOT graph output.

Testing guidance includes fresh containers, replacement dependencies, production-graph validation using DryRun and constructor failure assertions. The evaluation file defines 11 behavioral scenarios spanning these topics; it supplies expectations rather than demonstrated capabilities or scores.

Using it

Requirements

The metadata requires the go binary and a compatible coding-assistant environment. No minimum Go release, pinned dig version, model requirement or supported assistant-version matrix is supplied.

The declared tool list includes file reading and editing, Go and Git commands, linting, web fetching, agent delegation, Context7 and Go language-server tools. These declarations do not establish that a particular assistant environment provides those tools. The example projects also require their own application types and any libraries referenced by the chosen snippet.

How it works

Dependency injection builds components from constructors whose arguments declare what they need. This skill guides the assistant to keep that wiring at the composition root, meaning the application's startup boundary, while services receive explicit, typed dependencies.

The described dig container uses runtime reflection. Provide registers constructors, and Invoke requests a function's dependencies and triggers their construction. The guide describes construction as lazy and memoized. Parameter and result structs add names, optional fields and groups without forcing every dependency into a long function signature.

Getting started

Load the skill using the coding assistant's supported skill mechanism, retaining the relative reference files. The supplied folder does not document a harness-specific installation command.

The guide shows go get go.uber.org/dig to add the Go library; this command does not install the assistant skill and does not pin a dependency version. Its basic implementation sequence is to create a container, register constructors with Provide, handle registration errors and invoke the application entry function.

Example use

For an application with a primary database and read replica, the recipes show NewDatabases returning a dig.Out struct with two *sql.DB fields named primary and readonly. A consumer embeds dig.In and uses matching names to request the correct connection without introducing wrapper types.

The recipe closes the first database handle if opening the second reports an error. It still needs the application's configuration, database driver, repository implementation and shutdown handling. This example was not executed.

Assessment & evidence

Limitations

The references disagree about cycle-detection timing. The advanced error-handling section suggests detection typically happens at the first Invoke unless verification is deferred, while its quick reference and the testing guide describe DeferAcyclicVerification as delaying the default registration-time check. Confirm the behavior for the dig version in use.

The request-scope recipe creates child scopes during HTTP handling and registers Handler at the root as a shared object. It does not establish concurrent-use safety, scope cleanup or how a shared Handler would receive request-local injected dependencies.

DryRun is presented as structural validation that skips constructors. It therefore cannot establish successful initialization or runtime behavior. Several examples also require missing application code, and dig itself supplies no lifecycle hooks or graceful-shutdown machinery.

Why these patterns matter

The resource's practical value comes from making dependency choices explicit. Named values distinguish same-typed databases, groups let independent constructors contribute to a consumer's collection, and interface registration limits which type consumers request.

Keeping the container at startup preserves visible dependencies in business code. Important tradeoffs remain: groups have no guaranteed order, optional dependencies can conceal configuration mistakes, and structural graph checks leave constructor behavior unverified.

Alternatives

The guide recommends Uber Fx when the application needs lifecycle hooks, startup and shutdown sequencing, signal handling or modules. It describes Fx as built on dig, allowing the core wiring patterns to transfer.

It also points to companion skills for samber/do as a generics-based alternative without reflection and Google Wire for compile-time wiring. Those libraries and companion skills are outside the supplied source scope; their current status, compatibility and comparative performance were not assessed.

Evidence available

The available source includes the complete supplied skill folder: SKILL.md, references/advanced.md, references/recipes.md, references/testing.md and evals/evals.json. The repository LICENSE provides the accompanying rights notice.

The evaluation file defines 11 scenarios with assertions about expected assistant responses. It contains no recorded responses, scores, model identities or run results. The references provide illustrative code and proposed testing patterns, not evidence that those tests passed. No code or evaluations were executed.

Access & freshness

Costs

The supplied files provide no pricing, token-use measurements or integration-time estimates. Coding-assistant subscription or API charges and the total cost of using the skill are unknown.

The MIT license grants broad usage rights, but it does not establish operating costs. No measurements establish dig's runtime overhead or any productivity savings from the skill.

License and reuse

SKILL.md declares MIT, and the repository LICENSE carries a 2026 copyright notice for Samuel Berthe. The license permits use, copying, modification, publication, distribution, sublicensing and sale, provided the copyright and permission notices accompany copies or substantial portions.

The software is supplied without warranty. This notice supports reuse of the supplied skill files; it does not establish the licensing terms of linked libraries or other external resources.

Source version

The supplied source is pinned to repository commit d68d80aec298e1b74b37c2a472c002b5217248b3 and was captured at 2026-11-16T23:33:12.068Z. The capture timestamp does not establish when the files were last changed.

Metadata reports skill version 1.2.2 and skill-library-version 1.19.0. Neither identifies the installed Uber dig version. Later repository changes and compatibility with current Go, dig or assistant releases are unknown.

Practical next steps

Start with a small startup-wiring change, handle every Provide error and keep service dependencies explicit. Adapt the suggested DryRun test to the actual production entry dependencies, then use separate integration tests to exercise constructor behavior and shutdown.

Before adopting request scopes or copying error-handling snippets, check the documentation for your chosen dig version at [https://pkg.go.dev/go.uber.org/dig] and [https://github.com/uber-go/dig]. Verify concurrency and dependency-lifetime behavior specifically. Consider Fx if lifecycle management is a central requirement.

Evidence for this report

LICENSEnotice · checked 2026-11-16
skills/golang-uber-dig/SKILL.mdselected · checked 2026-11-16
skills/golang-uber-dig/evals/evals.jsonselected · checked 2026-11-16
skills/golang-uber-dig/references/advanced.mdselected · checked 2026-11-16
skills/golang-uber-dig/references/recipes.mdselected · checked 2026-11-16
skills/golang-uber-dig/references/testing.mdselected · checked 2026-11-16