golang-samber-do Skill for Claude: What It Does and How to Install It
Makes Claude use samber/do for dependency injection in Go, with containers, scopes, health checks and graceful shutdown.
- Installs
- 39.2K
- on skills.sh
- Stars
- 3.7K
- on GitHub
- Files
- 3
- besides SKILL.md
- Updated
- Nov 2026
- last repo commit
This skill gives Claude a working guide to samber/do v2. Claude registers services with provider functions, keeps the container at the composition root and depends on interfaces instead of concrete types.
It loads when you use or adopt samber/do, when code imports github.com/samber/do or do/v2, or when you refactor manual constructor injection. It insists on v2.
Good for
- Go developers adopting samber/do
- Teams replacing hand-wired constructors with a DI container
- Anyone fixing startup and shutdown order in a Go service
Install golang-samber-do
Claude Code
- 1
Copy this prompt.
Install the golang-samber-do skill in Claude Code. Run this command: npx skills add https://github.com/samber/cc-skills-golang --skill golang-samber-do Then check that it loaded and tell me how to use it.
- 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
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.
Sections in SKILL.md
- Core Concepts
- The Injector (Container)
- Service Types
- Provider Functions
- Basic Usage
- 1. Define and Register Services
- 2. Invoke Services
- 3. Service Dependencies
- 4. Implicit Aliasing (Preferred)
- 5. Named Services
- Package Organization
- Full Application Setup
- Best Practices
- Quick Reference
- Registration
- Invocation
Key facts
- Author
- samber
- License
- MIT
- Installs on skills.sh
- 39,176 (Nov 2, 2026)
- Last repo commit
- Nov 1, 2026
- Skill version
- 1.3.2
- Library version covered
- 2.0.0
What it includes
Tells Claude to use samber/do v2, not v1
The skill says v1 lacks the generics-based container, scopes and lifecycle hooks, so Claude installs v2 with go get.
Try: “Set up dependency injection in my Go service with samber/do.”
Runs code ·
Install v2Lazy, eager, transient and value services
Lazy is the default and creates a service when first requested. Eager starts at container start. Transient makes a new one each time.
Write ·
Service typesRegisters services with do.Provide
Services must be registered through provider functions, with errors handled inside them.
Write ·
Provider functionsAccesses the container only at startup wiring
Inside providers it uses do.MustInvoke, which the library turns back into a normal error.
Write ·
Invoke at the composition rootInvoke a concrete type as an interface
Implicit aliasing is preferred. Named services allow several of the same type.
Write ·
Aliases and named servicesGroups registrations by module
Organises service registration per module.
Write ·
do.PackageReference guide in references/advanced.md
Covers scopes, lifecycle management, struct injection and debugging.
Read ·
Scopes, lifecycle, health checksCloning, overrides and mocks
Reference guide in references/testing.md for swapping services in tests.
Read ·
Testing patterns
From the official docs
Permissions
Low risk
The skill lets Claude edit your Go files and run go, golangci-lint and git commands, and it may fetch web pages. Keep permission prompts on for git and review diffs.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It lists git and shell commands as allowed tools
The allowed-tools line covers any go, golangci-lint and git command (git:*), not just read ones. Keep Claude Code's permission prompts on for git commands that change history. github.com
It may fetch web pages or query Context7
It lists WebFetch and the Context7 tools as allowed. Library names and questions can leave your machine. Do not put secrets in prompts about this code. github.com
It adds samber/do to your go.mod
The skill's install step runs go get for the v2 module. Check go.mod and go.sum in the diff. github.com
Security advisories
No published security advisories as of Nov 2, 2026.
Technical details
| Turning on read-only | No read-only mode in SKILL.md. Use version control. |
|---|---|
| Talks to | WebFetch is listed as an allowed tool. Library lookups go to Context7 if the Context7 MCP server is installed (the skill uses it as a fallback). Installing the library with go get downloads the module |
| Sign-in and keys | SKILL.md does not mention any account or key. |
| Scopes |
|
Questions
What does the golang-samber-do skill do?
It teaches Claude to build dependency injection in Go with samber/do. That covers registering services, resolving them at the composition root, scopes, health checks and graceful shutdown.
How do I install golang-samber-do?
Use the install box at the top of this page. It is a text skill with reference guides, so there is nothing to compile. Start a new session so it loads, then work in a Go project.
golang-samber-do vs golang-dependency-injection?
This skill covers the samber/do library. SKILL.md sends you to the golang-dependency-injection skill for DI concepts, comparison and when to adopt a DI library. The README also lists separate skills for google/wire, uber-go/dig and uber-go/fx.
Does it need other skills from the same repo?
SKILL.md does not list any other skill as required. SKILL.md points to related skills in samber/cc-skills-golang for side topics, and the README says installing only a subset gives a partial and possibly inconsistent view of the guidelines. For best results it recommends installing the general-purpose Go skills together.
Is golang-samber-do safe?
Mostly, for your own Go projects. It is instructions plus reference files, and it lets Claude edit files and run go and git commands. Review diffs, keep the project under version control and avoid secrets in prompts.
Does golang-samber-do work in Codex, Cursor or the Claude app?
It is designed for Claude Code, Codex or a similar tool, and the README says the skills are built for Claude Code, Codex, Gemini, Copilot, Antigravity and Cursor. Because it works on your Go files and uses the go command, use a coding tool rather than the Claude app.
Information
updated Nov 2, 2026
- Repository
- samber/cc-skills-golang
- Folder
skills/golang-samber-do
Sources
Docs, issue trackers and discussions this page is built from.
Show all 2Hide
- golang-samber-do SKILL.md · github.com
- cc-skills-golang README · github.com