go-samber-do

go-samber-do is a skill for Claude Code, Codex from RaNDoM6913/claude-code-superkit. It costs 65 tokens per session (1,376 once invoked), scanned A, original, MIT.

A guide to using samber/do, a Go dependency-injection container. Dependency injection is a way to create services and supply their required parts from a central setup.

In plain words
What is it for?
Use it to register and retrieve services, create dependencies lazily, shut them down in order, provide multiple named instances, and replace dependencies in tests.
Why use it?
It can organize construction and shutdown when a Go application has many connected services, while still allowing simpler manual setup for smaller projects.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/random6913/claude-code-superkit/go-samber-do
Any agent
npx skills add RaNDoM6913/claude-code-superkit --skill go-samber-do
Clone the repo
git clone --depth 1 https://github.com/RaNDoM6913/claude-code-superkit

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/random6913/claude-code-superkit/go-samber-do.svg)](https://agentmods.dev/skills/random6913/claude-code-superkit/go-samber-do)
Your own site
<a href="https://agentmods.dev/skills/random6913/claude-code-superkit/go-samber-do"><img src="https://agentmods.dev/badge/skills/random6913/claude-code-superkit/go-samber-do.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,376 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00065 $0.01376
Opus 5 $0.00032 $0.00688
Sonnet 5 $0.00013 $0.00275
Haiku 4.5 $0.00006 $0.00138

Measured 3d ago against content hash 42f01dfeb7ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

go-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 3d 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.

packages/codex/skills/go-samber-do/SKILL.md · 159 lines

How it starts

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

samber/do — Dependency Injection Container

Upstream: https://github.com/samber/do · v2: https://github.com/samber/do/tree/v2

When to Reach for DI

Manual NewX(deps...) wiring scales to ~10 services. Past that, the wiring file becomes the second-largest file in the project. samber/do adds: lazy construction, reverse-order shutdown, and Override for testing.

If none of those apply, stay with manual wiring.

Core API (v1)

import "github.com/samber/do"

injector := do.New()

do.Provide(injector, func(i *do.Injector) (*pgxpool.Pool, error) {
    return pgxpool.New(context.Background(), os.Getenv("DATABASE_URL"))
})

do.Provide(injector, func(i *do.Injector) (*UserRepository, error) {
    pool := do.MustInvoke[*pgxpool.Pool](i)
    return NewUserRepository(pool), nil
})

repo, err := do.Invoke[*UserRepository](injector) // (T, error)
svc := do.MustInvoke[*UserService](injector)      // panics; main/init only

defer injector.Shutdown()

Providers are indexed by concrete type. Two providers for the same type is an error.

Named Providers

For multiple instances of the same type (primary vs replica pool):

do.ProvideNamed(injector, "primary", func(i *do.Injector) (*pgxpool.Pool, error) { ... })
do.ProvideNamed(injector, "replica", func(i *do.Injector) (*pgxpool.Pool, error) { ... })

primary := do.MustInvokeNamed[*pgxpool.Pool](injector, "primary")

Use do.ProvideNamedValue(injector, "name", value) for pre-built values.

Scoped Injectors (v2)

Child injectors inherit providers, can override them. Use for request-scoped services or multi-tenant:

root := do.New()
do.Provide(root, newLogger)

reqScope := root.Scope("request-42")
do.ProvideValue(reqScope, &TraceID{ID: "abc123"})

trace := do.MustInvoke[*TraceID](reqScope)  // scope-local
log := do.MustInvoke[*Logger](reqScope)     // inherited
reqScope.Shutdown()                         // root untouched

Don't create a scope per request if there are no scope-local providers — pure overhead.

Read the full file on GitHub · 159 lines

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. 3d ago First seen · 159 lines · 65 tokens per session scan A 42f01dfeb7ae

Subscribe to this mod's changes

go-samber-do is a skill published in the GitHub repository RaNDoM6913/claude-code-superkit (2 stars, last pushed 1mo ago), licensed MIT. It adds 65 tokens to every session and 1,376 once invoked, about $0.0003 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-31.