Builds reproducible and verifiable Go binaries with version stamping, trimpath builds, cross-compilation, GoReleaser, checksums, SBOMs, cosign signing, provenance attestations, and container images via ko or multi-stage Dockerfile.
Ships in go-agent-skills. 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.
A release is a promise that the binary users run is the one your source and pipeline produced. Make it reproducible so anyone can rebuild it, and verifiable so anyone can check it — before automating the publishing.
Detailed reference material, loaded on demand:
references/goreleaser.md — a complete .goreleaser.yaml and the
tag-triggered release workflow.references/supply-chain.md — SBOMs, cosign signing and verification,
provenance attestations, signing container images.Read a reference file only when the summary below is not enough.
// Go 1.24+: built from a git checkout, Main.Version is the tag (v1.4.0)
// or a pseudo-version; vcs.* settings carry the commit and dirty flag.
info, _ := debug.ReadBuildInfo()
fmt.Println(info.Main.Version, info.GoVersion)
go version -m ./bin/api # inspect what a binary was built from
.git, inject the
values: -ldflags "-X main.version=v1.4.0 -X main.commit=$SHA".The same source, toolchain and flags must give byte-identical binaries:
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o bin/api ./cmd/api
sha256sum bin/api # rebuild in a clean checkout and compare
-trimpath removes your machine's paths from the binary.go and toolchain lines in go.mod, the same
image or setup-go version in CI. Go's own toolchain is reproducible
since 1.21.CGO_ENABLED=0 unless you need cgo — a C toolchain is one more input
that varies between machines.go mod download and go mod verify before building, so a tampered
module cache fails the build.go tool dist list # every GOOS/GOARCH pair
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -trimpath -o bin/api-linux-arm64 ./cmd/api
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -o bin/api.exe ./cmd/api
Pure Go cross-compiles from any host. With cgo you need a C cross-compiler
per target; prefer pure-Go dependencies (e.g. a pure-Go SQLite driver)
when you ship to several platforms. Raise GOAMD64 (v2/v3) only when every
target CPU supports it — the binary will not start on older ones.
One config builds every target, archives, checksums, SBOMs and signs:
# .goreleaser.yaml (excerpt — full file in references/goreleaser.md)
version: 2
builds:
- main: ./cmd/api
env: [CGO_ENABLED=0]
flags: [-trimpath]
ldflags: ["-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"]
mod_timestamp: "{{ .CommitTimestamp }}" # reproducible file times
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
checksum:
name_template: checksums.txt
goreleaser check # validate the config
goreleaser release --snapshot --clean # full dry run, nothing published
Release on tag push (v1.4.0) from CI, never from a laptop: the pipeline
is the only place whose inputs are recorded.
| Artifact | Answers | Produced by |
|---|---|---|
checksums.txt | Did my download arrive intact? | GoReleaser checksum |
| SBOM (SPDX or CycloneDX) | What is inside this binary? | syft, GoReleaser sboms |
Signature bundle (.sigstore.json) | Did this project's pipeline publish it? | cosign sign-blob --bundle, keyless in CI |
| Provenance attestation | Which workflow, commit and runner built it? | actions/attest (SLSA provenance) |
Sign the checksums file rather than every archive — one signature then
covers them all. Keyless signing uses the CI job's OIDC identity, so there
is no private key to leak or rotate. Publish the exact verification
commands in the release notes; a signature nobody verifies protects
nobody. Commands: references/supply-chain.md.
ko. Builds from the Go source without a
Dockerfile, on a distroless base, multi-arch, with an SBOM, reproducibly:
KO_DOCKER_REPO=ghcr.io/acme ko build --bare --platform=linux/amd64,linux/arm64 ./cmd/api.golang:<version>,
copy the binary into gcr.io/distroless/static:nonroot, run as non-root.v prefix: v1.4.0. Never move or delete a
published tag — the module proxy has cached it, and users' go.sum
pins its hash./v2
module path, not just a v2.0.0 tag.retract in go.mod (the
go-dependency-audit skill), then fixed in a new patch release.changelog.groups sorts them into features and fixes.go version -m on the release binary shows the tag and commit-trimpath, CGO_ENABLED=0 (or a justified cgo build), pinned toolchainchecksums.txt is signed; SBOMs are published; provenance is attestedcosign verify-blob / gh attestation verify commandsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
go-release, reproducible-builds, goreleaser, sbom, cosign, container-image
/go-agent-skills:go-build-releasefrom go-agent-skills
npx claudepluginhub eduardo-sl/go-agent-skills --plugin go-agent-skills35 skills in this plugin
/git-commitStructured git commit messages following Conventional Commits format for Go projects. Generates well-scoped, atomic commits with clear descriptions. Use when committing changes, writing commit messages, preparing PRs, or reviewing commit history quality. Trigger examples: "commit these changes", "create commit", "commit message", "prepare PR", "squash commits". Not for: code review (go-code-review), changelog generation.
/go-api-designHTTP/REST API design for Go services: handlers, ServeMux routing, middleware, request validation, pagination, idempotency, health checks, error responses, and graceful shutdown. Use when designing APIs, writing HTTP handlers, implementing middleware, or structuring REST endpoints. Trigger examples: "design API", "REST endpoints", "HTTP handler", "middleware pattern", "graceful shutdown", "API versioning". Not for: gRPC services (go-grpc), spec-first OpenAPI work (go-openapi), general architecture (go-architecture-review), concurrency in handlers (go-concurrency-review).
/go-architecture-reviewReview Go project architecture: package structure, dependency direction, layering, separation of concerns, domain modeling, and module boundaries. Use when reviewing architecture, designing package layout, evaluating dependency graphs, or refactoring monoliths into modules. Trigger examples: "review architecture", "package structure", "project layout", "dependency direction", "clean architecture Go", "module boundaries". Not for: code-level style (go-coding-standards), endpoint design (go-api-design).
/go-binary-sizeReduce the size of compiled Go binaries and container images: linker flags, inlining budget, CGO and build tags, embedded assets, dependency weight, and measuring what actually costs bytes. Use when a binary or image is too large, when shrinking a CLI for distribution, or when auditing what a dependency adds to the build. Trigger examples: "binary is too big", "shrink the binary", "reduce image size", "strip symbols", "what is making my binary large", "ldflags -s -w". Not for: runtime speed and allocations (go-performance-review), CI setup (go-ci), release pipelines and signing (go-build-release), dependency CVEs (go-dependency-audit).
/go-ciContinuous integration for Go projects: GitHub Actions pipelines, caching, golangci-lint setup, test/coverage gates, vulnerability scanning, SAST (CodeQL, gosec), Dependabot, action pinning, build matrices, Makefile targets. Use when: "set up CI", "GitHub Actions for Go", "add lint to the pipeline", "CI is slow", "coverage gate", "build matrix", "write a Makefile", "run govulncheck in CI". Not for: commit conventions (git-commit), choosing or auditing dependencies (go-dependency-audit), writing the tests themselves (go-test-quality), releases and signing (go-build-release).
/go-cliBuild command-line tools in Go: flag handling, subcommands, stdin/stdout discipline, exit codes, signal handling, and when Cobra/Viper earn their weight over the standard library. Use when: "build a CLI", "add a subcommand", "parse flags", "exit codes", "handle Ctrl+C", "cobra command", "read from stdin", "CLI UX". Not for: HTTP APIs (go-api-design), scaffolding (go-project-layout), service configuration (go-architecture-review).
Other plugins' skills for the same job