golang-samber-do

golang-samber-do is a skill for Claude Code from samber/cc-skills-golang. It costs 74 tokens per session (2,173 once invoked), scanned A, original, MIT.

A dependency-injection setup for Go using samber/do, a library that connects services and manages how they are created and shared.

In plain words
What is it for?
Setting up service containers, lifecycles, scopes, health checks, graceful shutdown, and module organization in Go projects using samber/do v2.
Why use it?
It organizes service construction and lifecycle handling instead of scattering manual setup throughout the code. It also helps keep application code dependent on interfaces rather than specific implementations.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code; mentions Codex; built for openclaw.

Part of the cc-skills-golang plugin — 46 skills shipped together

Good fit Setting up service containers, lifecycles, scopes, health checks, graceful shutdown, and module organization in Go projects using samber/do v2.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/samber/cc-skills-golang/golang-samber-do
About the project

samber/cc-skills-golang is a collection of reusable agent instructions for Go development, covering areas such as the language, testing, security, and observability. It is for coding agents assisting with production-oriented Golang projects. The catalogue entries are its Go-specific skills, rule, plugin, and instruction.

samber/cc-skills-golang · 3,232 stars · on GitHub · skills.sh

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 samber/cc-skills-golang --skill golang-samber-do
Clone the repo
git clone --depth 1 https://github.com/samber/cc-skills-golang

Made for: Claude Code.

Or install cc-skills-golang, the plugin that ships this one along with the rest of its 46 skills.

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-samber-do

README.md
[![agentmods](https://agentmods.dev/badge/skills/samber/cc-skills-golang/golang-samber-do/github.svg)](https://agentmods.dev/skills/samber/cc-skills-golang/golang-samber-do)
Your own site
<a href="https://agentmods.dev/skills/samber/cc-skills-golang/golang-samber-do"><img src="https://agentmods.dev/badge/skills/samber/cc-skills-golang/golang-samber-do/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-samber-do

Your own site · 80×15
<a href="https://agentmods.dev/skills/samber/cc-skills-golang/golang-samber-do"><img src="https://agentmods.dev/badge/skills/samber/cc-skills-golang/golang-samber-do.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,173 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. Third-party audits
  • Socket pass 20 May 2026
  • Snyk pass 20 May 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found 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.00074 $0.02173
Opus 5 $0.00037 $0.01086
Sonnet 5 $0.00015 $0.00435
Haiku 4.5 $0.00007 $0.00217

Measured 8d ago against content hash 1cb03d08b022, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

golang-samber-do 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 8d 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.

skills/golang-samber-do/SKILL.md · 237 lines

How it starts

The opening of the file, as written. The whole thing — 237 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

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:

go get -u github.com/samber/do/v2

Core Concepts

The Injector (Container)

import "github.com/samber/do/v2"

injector := do.New()

Service Types

  • Lazy (default): Created when first requested
  • Eager: Created immediately when the container starts
  • Transient: New instance created on every request
  • Value: Pre-created value, no instantiation

Provider Functions

Services MUST be registered via provider functions:

type Provider[T any] func(i Injector) (T, error)

Basic Usage

1. Define and Register Services

Follow "Accept Interfaces, Return Structs":

// Register a service (lazy by default)
do.Provide(injector, func(i do.Injector) (Database, error) {
    return &PostgreSQLDatabase{connString: "postgres://..."}, nil
})

// Register a pre-created value
do.ProvideValue(injector, &Config{Port: 8080})

// Register a transient service (new instance each time)
do.ProvideTransient(injector, func(i do.Injector) (*Logger, error) {
    return &Logger{}, nil
})

// Register an eager service (created immediately at startup)
do.ProvideValue(injector, &Config{Port: 8080})

Read the full file on GitHub · 237 lines

Files

What ships with it

3 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. 8d ago Changed · +8 lines 1cb03d08b022
  2. 10d ago Changed b7b9da8f09b7
  3. 13d ago First seen · 229 lines · 74 tokens per session scan A d6df335b20aa

Subscribe to this mod's changes

golang-samber-do is a skill published in the GitHub repository samber/cc-skills-golang (3,232 stars, last pushed 5d ago), licensed MIT. It adds 74 tokens to every session and 2,173 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

golang-pro

Master Go 1.21+ with modern patterns, advanced concurrency, performance optimization, and production-ready microservices. Expert in the latest Go ecosystem including generics, workspaces, and cutting-edge frameworks. Use PROACTIVELY for Go development, architecture design, or performance optimization.

rmyndharis/antigravity-skills · 61 tokens

go-programming-expert

Expert-level skill for Go programming (Go 1.25+). Covers high-performance microservices, concurrency patterns, sqlc, net/http, Gin/Echo/Fiber, gRPC, and testing in English and Indonesian.

roedyrustam/vibes-plug · 51 tokens

rails-dev

Opinionated Rails conventions: rich models, concerns, CRUD-everything, state-as-records, minimal dependencies, Minitest with fixtures. Load this skill BEFORE any code-level thinking, not only before editing a file. It is required the moment a task touches Rails code in ANY way: designing or even just discussing a data…

tech-leads-club/agent-skills · 199 tokens

goroutine-patterns

Implement Go concurrency patterns using goroutines, channels, and synchronization primitives. Use when building concurrent systems, implementing parallelism, or managing goroutine lifecycles. Trigger words include "goroutine", "channel", "concurrent", "parallel", "sync", "context".

armanzeroeight/fastagent-plugins · 60 tokens

grpc-golang

Build production-ready gRPC services in Go with mTLS, streaming, and observability. Use when designing Protobuf contracts with Buf or implementing secure service-to-service transport.

tmolavi/mcp-agent-skills-hub · 38 tokens

dbos-golang

Guide for building reliable, fault-tolerant Go applications with DBOS durable workflows. Use when adding DBOS to existing Go code, creating workflows and steps, or using queues for concurrency control.

tmolavi/mcp-agent-skills-hub · 44 tokens