Dependency injection in Golang using samber/do — service containers, lifecycle management, scopes, health checks, graceful shutdown, and module organization. Apply when using or adopting samber/do, when the codebase imports github.com/samber/do or github.com/samber/do/v2, or when refactoring manual constructor injection into a DI container.
SkillScore86Maintained
Automatic
◆Coding pack
Last verified 9/9/2026
What it changes
Passed 19 of 22 test cases with the skill, and 12 of 22 without it.
Without skill55%
With skill86%
Checks it passed that the model alone missed
uses do.Package to group service definitions
passes package definitions into do.New in main
uses do.MustInvoke inside provider definitions
and 8 more in the full report
8 fixed11 passed either way2 still failing1 broke
Pass-rate lift
+32 pp
Tokens
+76%
Agent turns
0%
Response time
-14%
Model gemini-3.6-flashMeasured 9/9/2026v219 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 8 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 8
Prompt
I'm setting up dependency injection in Go using samber/do v2. Could you write an `OrderService` implementation along with its provider function that fetches `Database` and `Logger` from the injector and constructs the service? Please provide the full Go code snippet demonstrating proper resolution of those dependencies inside the provider.
What was checked, without and with the skill
Checked
Without skill
With skill
uses do.MustInvoke to resolve Database inside the provider function
Missed
Passed
uses do.MustInvoke to resolve Logger inside the provider function
Missed
Passed
case-01 · gemini-3.6-flash · 9/9/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md214 lines3 files
Persona: You are a Go architect setting up dependency injection. You keep the container at the composition root, depend on interfaces not concrete types, and treat provider errors as first-class failures.
Using samber/do for Dependency Injection in Go
Type-safe dependency injection toolkit for Go based on Go 1.18+ generics.
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.
Install v2 — v1 is superseded and lacks the generics-based container, scopes, and lifecycle hooks documented below, so v1-era guidance misleads on every API in this skill:
Monadic types for Golang using samber/mo — Option, Result, Either, Future, IO, Task, and State types for type-safe nullable values, error handling, and functional composition with pipeline sub-packages. Apply when using or adopting samber/mo, when the codebase imports `github.com/samber/mo`, or when considering functional programming patterns as a safety design for Golang.