About
This Claude Skill helps developers set up and optimize continuous integration pipelines for Go projects using GitHub Actions. It provides configurations for caching, golangci-lint, test coverage gates, vulnerability scanning with govulncheck, build matrices, and Makefile targets. Use it when you need to implement or improve CI workflows but not for writing tests, commit conventions, or dependency audits.
Quick Install
Claude Code
Recommendednpx skills add eduardo-sl/go-agent-skills -a claude-code/plugin add https://github.com/eduardo-sl/go-agent-skillsgit clone https://github.com/eduardo-sl/go-agent-skills.git ~/.claude/skills/go-ciCopy and paste this command in Claude Code to install this skill
Documentation
Go CI
A Go pipeline has exactly four gates: build, vet/lint, test with race detector, vulnerability scan. Everything else is optimization.
1. Baseline GitHub Actions Workflow
name: ci
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod # single source of truth
cache: true # caches module + build cache
- run: go build ./...
- run: go vet ./...
- run: go test -race -shuffle=on -coverprofile=coverage.out ./...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: golangci/golangci-lint-action@v6
with:
version: latest
vuln:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: go run golang.org/x/vuln/cmd/govulncheck@latest ./...
Key decisions baked in:
go-version-file: go.mod— never hardcode the Go version in two places.cache: trueon setup-go handles module and build caches; do not add manualactions/cachesteps for Go on top of it.-race -shuffle=on— races and order-dependent tests fail in CI, not production.permissions: contents: read— least privilege by default.- Lint in a separate job — it fails fast and parallelizes with tests.
2. golangci-lint Configuration
Commit a .golangci.yml; an unconfigured linter is noise:
linters:
enable:
- errcheck # unchecked errors
- govet
- staticcheck
- errorlint # %w misuse, == on errors
- gosec # security patterns
- revive # style, replaces golint
- misspell
issues:
exclude-rules:
- path: _test\.go
linters: [gosec] # test code may use weak randomness etc.
Start from this small set and add linters deliberately. Enabling
everything produces hundreds of findings nobody triages. nolint
directives require a reason: //nolint:gosec // G404: jitter, not crypto.
3. Build Matrix — Only When You Ship It
strategy:
matrix:
go: ['1.23', '1.24'] # only versions you support
os: [ubuntu-latest, macos-latest, windows-latest]
Libraries: test the two newest Go versions (the Go team supports two).
Services deployed on Linux: skip the OS matrix — it doubles cost for
platforms you never ship. Cross-compilation is cheaper than emulation:
GOOS=windows go build ./... catches most portability breaks.
4. Coverage Gate
- run: go test -race -coverprofile=coverage.out ./...
- name: enforce coverage floor
run: |
total=$(go tool cover -func=coverage.out | awk '/^total:/ {sub(/%/,"",$3); print $3}')
echo "coverage: ${total}%"
awk -v t="$total" 'BEGIN { exit (t < 70.0) }'
Gate on a floor that ratchets up, not a target that gets gamed. Exclude
generated code via //go:generated files' build tags or grep filters,
not by lowering the floor.
5. Makefile — Local Mirror of CI
CI must run what developers run. One definition, two callers:
.PHONY: build lint test vuln ci
build:
go build ./...
lint:
golangci-lint run
test:
go test -race -shuffle=on -coverprofile=coverage.out ./...
vuln:
go run golang.org/x/vuln/cmd/govulncheck@latest ./...
ci: build lint test vuln
If CI does anything make ci doesn't, developers discover failures
only after pushing. Keep them identical.
6. Speed Rules
- Split lint / test / vuln into parallel jobs (as in §1).
go test ./...already parallelizes across packages; don't shard a small repo.- Integration tests behind a build tag run in a separate job or on a
schedule, not on every push:
go test -tags=integration ./.... - If the build cache misses constantly, check that
go.sumis the cache key input (setup-go does this) and that jobs don't mutate it.
Verification Checklist
- Pipeline has all four gates: build, vet+lint, test -race, govulncheck
- Go version sourced from go.mod (
go-version-file), not duplicated permissions: contents: readset at workflow level- Tests run with
-race -shuffle=on .golangci.ymlcommitted with a curated linter set- Every
nolintcarries a linter name and a reason - Matrix limited to versions/platforms actually supported
- Coverage floor enforced, generated code excluded
make cireproduces the pipeline locally, byte-for-byte- Integration tests isolated behind tags, not slowing every push
GitHub Repository
Frequently asked questions
What is the go-ci skill?
go-ci is a Claude Skill by eduardo-sl. Skills package instructions and resources that Claude loads on demand, so Claude can perform go-ci-related tasks without extra prompting.
How do I install go-ci?
Use the install commands on this page: add go-ci to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.
What category does go-ci belong to?
go-ci is in the Meta category, tagged testing and design.
Is go-ci free to use?
Yes. go-ci is listed on AIMCP and free to install.
Related Skills
This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.
This skill enables developers to build applications with the Polymarket prediction markets platform, including API integration for trading and market data. It also provides real-time data streaming via WebSocket to monitor live trades and market activity. Use it for implementing trading strategies or creating tools that process live market updates.
This skill helps developers create OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It provides the plugin structure, event API specifications, and implementation patterns for JavaScript/TypeScript modules. Use it when you need to intercept, monitor, or extend the OpenCode AI assistant's lifecycle with custom event-driven logic.
SGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.
