Valgo
cohesivestack/valgo
Add, refactor, debug, review, explain, or migrate type-safe validation in consumer Go applications using github.com/cohesivestack/valgo.
Dependency injection in Go using samber/do — service containers, lifecycle, scopes, health checks, graceful shutdown, module organization.
$ npx skills add context-labs/whip --skill golang-samber-do -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install context-labs/whip golang-samber-do --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/context-labs/whip.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/golang-samber-do .claude/skills/golang-samber-do && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "golang-samber-do" agent skill from https://github.com/context-labs/whip/tree/main/.agents/skills/golang-samber-do into .claude/skills/golang-samber-do/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "golang-samber-do", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/context-labs/whip/tree/main/.agents/skills/golang-samber-doType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add context-labs/whip --skill golang-samber-do -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install context-labs/whip golang-samber-do --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/context-labs/whip.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/golang-samber-do .agents/skills/golang-samber-do && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "golang-samber-do" agent skill from https://github.com/context-labs/whip/tree/main/.agents/skills/golang-samber-do into .agents/skills/golang-samber-do/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "golang-samber-do", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add context-labs/whip --skill golang-samber-do -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install context-labs/whip golang-samber-do --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/context-labs/whip.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/golang-samber-do .cursor/skills/golang-samber-do && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "golang-samber-do" agent skill from https://github.com/context-labs/whip/tree/main/.agents/skills/golang-samber-do into .cursor/skills/golang-samber-do/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "golang-samber-do", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/context-labs/whip.git --path .agents/skills/golang-samber-do--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add context-labs/whip --skill golang-samber-do -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install context-labs/whip golang-samber-do --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/context-labs/whip.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/golang-samber-do .gemini/skills/golang-samber-do && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "golang-samber-do" agent skill from https://github.com/context-labs/whip/tree/main/.agents/skills/golang-samber-do into .gemini/skills/golang-samber-do/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "golang-samber-do", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install context-labs/whip golang-samber-doInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add context-labs/whip --skill golang-samber-do -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/context-labs/whip.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/golang-samber-do .github/skills/golang-samber-do && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "golang-samber-do" agent skill from https://github.com/context-labs/whip/tree/main/.agents/skills/golang-samber-do into .github/skills/golang-samber-do/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "golang-samber-do", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add context-labs/whip --skill golang-samber-do -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install context-labs/whip golang-samber-do --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/context-labs/whip.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/golang-samber-do .opencode/skills/golang-samber-do && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "golang-samber-do" agent skill from https://github.com/context-labs/whip/tree/main/.agents/skills/golang-samber-do into .opencode/skills/golang-samber-do/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "golang-samber-do", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
golang-samber-doDependency injection in Go using samber/do — service containers, lifecycle, scopes, health checks, graceful shutdown, module organization.
Golang Samber Do is an agent skill from context-labs/whip. Dependency injection in Go using samber/do — service containers, lifecycle, scopes, health checks, graceful shutdown, module organization. Apply when using or adopting samber/do, when the codebase imports github.com/samber/do(/v2), or when refactoring constructor injection into a DI container.
Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `evals/evals.json`, `references/advanced.md` and `references/testing.md`). Compatibility notes: Designed for Claude Code, Codex or similar harness, and for projects using Golang.
It sits in Development, covering Design patterns and Refactoring. It works with Go and GitHub. The repository describes itself as: A fast coding-agent harness in Go. Tool-use loop, bubbletea TUI, provider-routable models with live catalog discovery, MCP support, background subagents. One binary, no runtime… The licence is MIT.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 8876467. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadEditWriteGlobGrepBash(go:*)Bash(golangci-lint:*)Bash(git:*)AgentWebFetch…and 6 more on the same allowed-tools line.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
goFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
pkg.go.devdo.samber.devgithub.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Designed for Claude Code, Codex or similar harness, and for projects using Golang.
From compatibility in the SKILL.md frontmatter.
Golang Samber Do loads about 2.3k tokens when it runs, and up to ~3.9k if it reads all its reference files. Until then it costs about 78 tokens; SKILL.md has 615 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from context-labs/whip at commit 8876467, republished under its MIT licence (© context-labs). 615 words, ~2,268 tokens.
.claude/skills/golang-samber-do/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from 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.
Type-safe dependency injection toolkit for Go based on Go 1.18+ generics.
Official Resources:
This skill is not exhaustive. Please 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) — prefer it 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.
DO NOT USE v1 OF THIS LIBRARY. INSTALL v2 INSTEAD:
go get -u github.com/samber/do/v2import "github.com/samber/do/v2"
injector := do.New()Services MUST be registered via provider functions:
type Provider[T any] func(i Injector) (T, error)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})The container MUST only be accessed at the composition root:
// Invoke with error handling — reserve for call sites outside the DI graph
// (e.g. an HTTP handler that must degrade gracefully instead of crashing)
db, err := do.Invoke[Database](injector)
// MustInvoke panics on error — preferred in providers, recovered by do.Invoke on the parent call
db := do.MustInvoke[Database](injector)Inside a provider function, always use do.MustInvoke (or MustInvokeAs/MustInvokeNamed/MustInvokeStruct) rather than the error-returning variant. A provider already returns (T, error), so propagating a dependency failure with do.Invoke costs an extra if err != nil { return nil, err } on every call. do.MustInvoke panics instead, but samber/do correctly catches and recovers that panic at the enclosing Invoke call and converts it back into a regular error — this recover happens inside the library itself, not in caller code, so MustInvoke is safe to use inside providers. The failure still surfaces as an error at the composition root, just without the manual boilerplate in every provider.
func NewUserService(i do.Injector) (UserService, error) {
db := do.MustInvoke[Database](i)
cache := do.MustInvoke[Cache](i)
return &userService{db: db, cache: cache}, nil
}
do.Provide(injector, NewUserService)Register a concrete type and invoke as an interface without explicit aliasing:
// Register concrete type
do.Provide(injector, func(i do.Injector) (*PostgreSQLDatabase, error) {
return &PostgreSQLDatabase{}, nil
})
// Invoke directly as interface (implicit aliasing)
db := do.MustInvokeAs[Database](injector)Register multiple services of the same type:
do.ProvideNamed(injector, "primary-db", func(i do.Injector) (*Database, error) {
return &Database{URL: "postgres://primary..."}, nil
})
mainDB := do.MustInvokeNamed[*Database](injector, "primary-db")Use do.Package() to organize service registration by module:
// infrastructure/package.go
var Package = do.Package(
do.Lazy(func(i do.Injector) (*postgres.DB, error) {
cfg := do.MustInvoke[*Config](i)
return postgres.Connect(cfg.DatabaseURL)
}),
do.Lazy(func(i do.Injector) (*redis.Client, error) {
cfg := do.MustInvoke[*Config](i)
return redis.NewClient(cfg.RedisURL), nil
}),
)
// main.go
injector := do.New(infrastructure.Package, service.Package)func main() {
injector := do.New(
infrastructure.Package,
repository.Package,
service.Package,
transport.Package,
)
server := do.MustInvoke[*http.Server](injector)
go server.ListenAndServe()
_ = injector.ShutdownOnSignalsWithContext(context.Background(), os.Interrupt)
}do.MustInvoke* inside provider functions instead of do.Invoke* — samber/do correctly catches and recovers the panic at the outer Invoke call, turning it back into a returned error, so it's safe to use inside providers and you get the same error propagation without the boilerplateFor scopes, lifecycle management, struct injection, and debugging, see Advanced Usage.
For testing patterns (cloning, overrides, mocks), see Testing.
| Function | Purpose |
|---|---|
do.Provide[T]() | Register lazy service (default) |
do.ProvideNamed[T]() | Register named lazy service |
do.ProvideValue[T]() | Register pre-created value |
do.ProvideNamedValue[T]() | Register named value |
do.ProvideTransient[T]() | Register new instance each time |
do.ProvideNamedTransient[T]() | Register named transient service |
do.Package() | Group service registrations |
| Function | Purpose |
|---|---|
do.Invoke[T]() | Get service (with error) |
do.InvokeNamed[T]() | Get named service |
do.InvokeAs[T]() | Get first service matching interface |
do.InvokeStruct[T]() | Inject into struct fields using tags |
do.MustInvoke[T]() | Get service (panic on error) |
do.MustInvokeNamed[T]() | Get named service (panic on error) |
do.MustInvokeAs[T]() | Get service by interface (panic on error) |
do.MustInvokeStruct[T]() | Inject into struct (panic on error) |
samber/cc-skills-golang@golang-dependency-injection skill for DI concepts, comparison, and when to adopt a DI librarysamber/cc-skills-golang@golang-structs-interfaces skill for interface design patternssamber/cc-skills-golang@golang-testing skill for general testing patterns© context-labs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 3 other files (references) in .agents/skills/golang-samber-do of context-labs/whip.
Open the folder on GitHubat commit 8876467
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in context-labs/whip, which our catalogue first saw on October 7, 2026.
Golang Samber Do next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Golang Samber Do this skillcontext-labs/whip | 1.1k | 1 repos | ~2.3k | Automated safety check: Pass | MIT | |
| Valgocohesivestack/valgo | 508 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Typed Dependencies with fp-go EffectIBM/fp-go | 2k | — | ~4.3k | Automated safety check: Pass | Apache-2.0 | |
| Golang Dependency Injectionsamber/cc-skills-golang | 3.4k | — | ~3.2k | Automated safety check: Pass | MIT | |
| fp-go Pattern MatchingIBM/fp-go | 2k | — | ~2.8k | Automated safety check: Pass | Apache-2.0 | |
| fp-go Pipe and FlowIBM/fp-go | 2k | — | ~3.5k | Automated safety check: Pass | Apache-2.0 |
cohesivestack/valgo
Add, refactor, debug, review, explain, or migrate type-safe validation in consumer Go applications using github.com/cohesivestack/valgo.
IBM/fp-go
Teaches an agent to write fp-go v2 services with the Effect type, carrying dependencies in its type parameter instead of in context.Context or parameters.
samber/cc-skills-golang
Comprehensive guide for dependency injection (DI) in Golang.
IBM/fp-go
Guides writing or reviewing point-free, first-match-wins case lists in fp-go v2 Go code instead of switch statements and if-else chains.
IBM/fp-go
Shows how to compose Go functions with fp-go v2 Pipe and Flow: point-free pipelines, predicates, the reader monad, do-notation and tests for pipelines.
IBM/fp-go
Entry point for writing and reviewing Go code with the fp-go v2 library: core monad types, data-last composition, type parameter order and import conventions.
context-labs/whip
Linting best practices and golangci-lint configuration for Go — running linters, configuring .golangci.yml, nolint suppressions, selecting linters.
context-labs/whip
Golang project layouts and workspaces. An agent skill from context-labs/whip.
context-labs/whip
Golang package/module docs via godig, a pkg.go.dev API client (CLI + MCP) — APIs, symbols, versions, importers, licenses, vulnerabilities.
context-labs/whip
Golang testing with stretchr/testify — assert, require, mock, suite: assertions, mock expectations, argument matchers, suite lifecycle, Eventually, JSONEq.
context-labs/whip
CI/CD with GitHub Actions for Golang — testing, linting, SAST, security scanning, coverage, Dependabot, Renovate, GoReleaser, release pipelines.
context-labs/whip
Golang data structures — slices/maps internals (capacity growth, preallocation, hash buckets), slices/maps packages, container/list/heap/ring, strings.Builder vs bytes.Buffer, generic collections…
Categories
Dependency injection in Go using samber/do — service containers, lifecycle, scopes, health checks, graceful shutdown, module organization. Golang Samber Do is an agent skill from context-labs/whip. Dependency injection in Go using samber/do — service containers, lifecycle, scopes, health checks, graceful shutdown, module organization.
Golang Samber Do fits situations like: tasks that involve Design patterns; tasks that involve Refactoring.
Run `npx skills add context-labs/whip --skill golang-samber-do -a claude-code`. Or copy the skill folder (.agents/skills/golang-samber-do in context-labs/whip) into .claude/skills/golang-samber-do in your project. Claude Code loads it when a task matches its description.
Run `npx skills add context-labs/whip --skill golang-samber-do -a codex`. Or copy the skill folder (.agents/skills/golang-samber-do in context-labs/whip) into .agents/skills/golang-samber-do in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add context-labs/whip --skill golang-samber-do -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/golang-samber-do, .gemini/skills/golang-samber-do, .github/skills/golang-samber-do and .opencode/skills/golang-samber-do in your project.
Going by SKILL.md and its folder, Golang Samber Do needs the command-line tools its instructions call (go). Its frontmatter pre-approves these tools: Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(golangci-lint:*), Bash(git:*), Agent, WebFetch, mcp__context7__resolve-library-id, mcp__context7__query-docs, Bash(godig:*), Bash(gopls:*), LSP, mcp__gopls__*. Compatibility (from SKILL.md): Designed for Claude Code, Codex or similar harness, and for projects using Golang..
SKILL.md names 3 domains. As links in the text: pkg.go.dev, do.samber.dev and github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Golang Samber Do is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.7k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Golang Samber Do: Valgo (cohesivestack/valgo, 508 stars), Typed Dependencies with fp-go Effect (IBM/fp-go, 2k stars), Golang Dependency Injection (samber/cc-skills-golang, 3.4k stars) and fp-go Pattern Matching (IBM/fp-go, 2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
context-labs (a GitHub organization) maintains it in context-labs/whip, which has 1,083 GitHub stars. The repository holds 40 skills in this directory. The repository was last updated on October 5, 2026.
Source: context-labs/whip on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.