samber avatar

Golang Samber Do

This brings type-safe dependency injection to Go projects using samber/do's generics-based container. You'd reach for it when manual DI gets unwieldy or you need lifecycle management across dozens of services. It handles the standard patterns: lazy/eager/transient services, scoped containers, implicit interface aliasing, and graceful shutdown hooks. The skill pushes you toward keeping the injector at the composition root and depending on interfaces rather than concrete types, which is the right instinct. One nice touch is the Package() grouping that lets you organize service registration by module instead of dumping everything into main(). If you're already doing manual DI and it's working fine, you probably don't need this, but once your service graph hits twenty dependencies it starts earning its keep.

skills.sh installs
39.8K
GitHub stars
3.8K
last updated
Aug 21, 2026

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-samber-do --agent claude-code

Installs into .claude/skills of the current project.

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.

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.

Sponsors

Details

Repository
github.com/samber/cc-skills-golang
Categories
Git & Pull Requests, Code Review & Quality, Go
First seen
Apr 16, 2026

More from samber/cc-skills-golang

All 47
1neondatabase avatarneon-ai-gatewayneondatabase/agent-skillsOne API and one credential for frontier and open-source LLMs and embedding models, built into your Neon branch and powered by Databricks. Use when a user wants 39.8Kskills.sh installs
2samber avatargolang-samber-slogsamber/cc-skills-golangStructured logging extensions for Golang using samber/slog-**** packages — multi-handler pipelines (slog-multi), log sampling (slog-sampling), attribute formatt39.8Kskills.sh installs
3samber avatargolang-samber-oopssamber/cc-skills-golangStructured error handling in Golang with samber/oops — error builders, stack traces, error codes, error context, error wrapping, error attributes, user-facing v39.7Kskills.sh installs
4samber avatargolang-samber-mosamber/cc-skills-golangMonadic types for Golang using samber/mo — Option, Result, Either, Future, IO, Task, and State types for type-safe nullable values, error handling, and function39.7Kskills.sh installs
5samber avatargolang-samber-hotsamber/cc-skills-golangIn-memory caching in Golang using samber/hot — eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, cache loaders, shard39.7Kskills.sh installs
6samber avatargolang-samber-rosamber/cc-skills-golangReactive streams and event-driven programming in Golang using samber/ro — ReactiveX implementation with 150+ type-safe operators, cold/hot observables, 5 subjec39.6Kskills.sh installs