/golang:golangfrom golang
Writes, reviews, debugs and tests Go code (packages, errors, interfaces, context, goroutines, modules, Go tests). Use for any work in *.go, *_test.go or go.mod, "review this Go package", a `go test -race` data race, a goroutine leak, a shutdown hang or a cancellation bug.
Ships in golang. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Keep the existing observable contract (API, error behavior, cancellation, concurrency guarantees) unless the request changes it.
Not for: benchmarks and profiling (golang-performance), cobra/viper CLIs (golang-cli), generic test strategy (unit-testing), CI configuration, or Postgres schema and query tuning (postgres).
go.mod (the go and toolchain lines), the changed package and its callers, nearby _test.go files, and any Makefile or Taskfile that defines supported commands.go version, even if the local toolchain has it. Examples include range-over-func (1.23), min/max builtins (1.21), and per-iteration loop variables (1.22).search_graph for symbols, trace_path for callers and callees, get_code_snippet for source). Otherwise use the LSP tool (gopls), go doc, or Grep.resolve-library-id, then query-docs) or go doc <pkg>.<Symbol> against the version in go.mod.go test ./pkg/... -run 'TestName/subcase' -count=1.trace_path). After each edit, check diagnostics or go build ./....main handles startup, config, wiring and exit codes; reusable behavior lives in ordinary packages.internal/ only to enforce repository-private imports. A trivial tool can use stdlib flag; anything bigger goes to golang-cli.cmd/<name>, each with a main that only parses flags, wires dependencies and calls Run. Keep the module path equal to the repository URL, and use go.work only for local multi-module development.go.work only when current callers need that boundary.util or common.var _ Iface = (*T)(nil) when nothing else in the package proves a type satisfies an interface. Pass types that hold a lock or other no-copy state only by pointer.any plus assertions. For optional behavior, assert a narrow interface (the io.Flusher pattern) instead of widening the main one.user.Service, not user.UserService), initialisms in one case (ID, URL, HTTP), ErrX for sentinels and XError for error types, lowercase error strings without trailing punctuation, and an import alias only on a collision. Make the zero value of an enum mean "unknown", with real values starting at 1.null and an API promising an array needs [].doc.go only for a multi-file package.ctx context.Context as the first parameter for request-, job- or caller-scoped I/O, blocking work, or child work. Pass the received context through.defer cancel().context.Background(), pass nil, or use context values as optional parameters.context.Background() or signal.NotifyContext. Use context.WithoutCancel (1.21+) for work that must outlive the request, with its own timeout, and context.AfterFunc for cleanup when a context ends.error. Panic only for unrecoverable programmer or process invariants, and recover only at an intentional request, worker or process boundary.Close on writers where it matters.fmt.Errorf("op: %w", err) only where the context helps locate the failing layer and callers may need errors.Is/errors.As. Use %v to deliberately hide the cause.errors.Join only when several independent failures all matter. On Go 1.26+, errors.AsType[*MyErr](err) replaces errors.As with a typed result.slog.Error("load user", "id", id, "err", err)). Never put internal error text in a user-facing response.go, name the goroutine's owner, input, result or error path, cancellation signal, and the event that proves it exited. Stay synchronous unless concurrency serves a stated need.errgroup.WithContext plus SetLimit. Only the sending owner closes a channel. Every blocking send, receive or timer wait selects on ctx.Done() or another exit path.Prefer existing dependencies, then the stdlib. Pass dependencies as constructor arguments wired in main, never through globals or init. Read references/dependencies.md when adding, updating or retracting a module, or choosing a DI approach for a large service graph.
_test.go next to the code. Prefer external package x_test tests through the public API, and use same-package tests only when unexported behavior must be reached.testing unless the repo already uses testify.Use golang-performance for benchmarks, profiling and optimization. Optimize only against a measured bottleneck.
gofmt -l (or the repo's goimports/gofumpt) on changed files, plus go vet ./pkg/....go test that proves the contract, then go test ./... when shared code or the public boundary changed.go test -race for any change touching goroutines or shared state. A race report is a defect, not a flake. The detector only covers exercised paths.staticcheck or golangci-lint run when the repo configures them. Suppress with //nolint:<linter> // <reason> only for a justified false positive, never for gosec, bodyclose or sqlclosecheck to get a pass. See references/lint.md.-timeout plus the goroutine dump), toolchain/version mismatch, or missing prerequisite.defer in loops, numeric conversions, timers, context keys or receivers.database/sql, sqlx or pgx code.google.golang.org/grpc.go directive, or fixing a deprecation warning.references/concurrency.md (opens in a new tab)references/database.md (opens in a new tab)references/debugging.md (opens in a new tab)references/dependencies.md (opens in a new tab)references/grpc.md (opens in a new tab)references/lint.md (opens in a new tab)references/modernize.md (opens in a new tab)references/pitfalls.md (opens in a new tab)references/refactoring.md (opens in a new tab)references/security.md (opens in a new tab)references/testing.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub adminhead/claude-plugins --plugin golangOther plugins' skills for the same job