/skills:go-toolfrom skills
Use when working with Go projects - building, testing, profiling, debugging, or setting up new Go modules. Triggers on "go test", "go build", "coverage", "pprof", "benchmark", or Go project questions.
Ships in 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.
go test ./... # Run all tests
go test -v ./... # Verbose output
go test -run TestName ./... # Run specific test
go test -run TestName/SubTest # Run specific subtest
go test -short ./... # Skip long-running tests
go test -race ./... # Enable race detector
go test -count=1 ./... # Disable test caching
Coverage:
go test -cover ./... # Coverage summary
go test -coverprofile=coverage.out ./... # Generate profile
go tool cover -html=coverage.out -o coverage.html # HTML report
go tool cover -func=coverage.out # Per-function coverage
Benchmarks:
go test -bench=. ./... # Run all benchmarks
go test -bench=BenchmarkName ./... # Run specific benchmark
go test -bench=. -benchmem ./... # Include memory stats
go test -bench=. -count=5 ./... # Multiple runs for stability
See references/testing.md for testing patterns and best practices.
go build ./... # Build all packages
go build -o bin/app ./cmd/app # Output to specific path
go build -ldflags="-s -w" ./... # Strip debug info (smaller binary)
go build -ldflags="-X main.version=1.0" # Inject build-time variables
go install ./... # Install to $GOBIN
Static/Cross-compilation:
CGO_ENABLED=0 go build ./... # Static binary (no CGO)
GOOS=linux GOARCH=amd64 go build ./... # Linux AMD64
GOOS=linux GOARCH=arm64 go build ./... # Linux ARM64
GOOS=darwin GOARCH=arm64 go build ./... # macOS Apple Silicon
GOOS=windows GOARCH=amd64 go build ./... # Windows
go mod init github.com/user/repo # Initialize new module
go mod tidy # Add missing, remove unused deps
go mod download # Download deps to cache
go mod vendor # Copy deps to vendor/
go mod verify # Verify deps match go.sum
go mod why <package> # Explain why package is needed
go mod graph # Print dependency graph
Updating dependencies:
go get -u ./... # Update all deps (minor/patch)
go get -u=patch ./... # Update patch versions only
go get package@latest # Update specific package
go get [email protected] # Pin to specific version
Private modules:
export GOPRIVATE=github.com/myorg/*
export GONOSUMDB=github.com/myorg/*
go fmt ./... # Format code
gofmt -s -w . # Format with simplification
go vet ./... # Static analysis
go vet -vettool=$(which shadow) ./... # Check for shadowed variables
With golangci-lint:
golangci-lint run # Run all enabled linters
golangci-lint run --fix # Auto-fix where possible
golangci-lint run --enable-all # Enable all linters
golangci-lint linters # List available linters
Code generation:
go generate ./... # Run all //go:generate directives
# Generate profiles
go test -cpuprofile=cpu.out -bench=. ./...
go test -memprofile=mem.out -bench=. ./...
go test -trace=trace.out ./...
# Analyze profiles
go tool pprof cpu.out # Interactive CLI
go tool pprof -http=:8080 cpu.out # Web UI
go tool trace trace.out # Trace viewer
Common pprof commands:
top # Top functions by resource usage
top -cum # Top by cumulative usage
list FuncName # Show annotated source
web # Open graph in browser
pdf > profile.pdf # Export to PDF
See references/profiling.md for detailed profiling guide.
New project checklist:
go mod init github.com/user/projectreferences/project-layout.md).gitignore for Go.golangci.yml)Minimal .gitignore for Go:
# Binaries
*.exe
*.exe~
*.dll
*.so
*.dylib
bin/
# Test
*.test
coverage.out
coverage.html
# Profiles
*.out
*.prof
# Vendor (if not committing)
# vendor/
# IDE
.idea/
.vscode/
*.swp
"Tests are failing"
-v for verbose output-run TestName-race-count=1"Need to optimize performance"
-cpuprofile=cpu.out-memprofile=mem.outgo tool pprof"Dependency issues"
go mod tidygo mod why <package>go mod verifygo clean -modcacheWhat SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (jvcorredor/skills) — no native marketplace selected
npx claudepluginhub p/jvcorredor-skills13 skills in this plugin
/better-sqlite3-rebuildUse when seeing errors about better-sqlite3 native module, NODE_MODULE_VERSION mismatch, "was compiled against a different Node.js version", or similar native binding errors./c-modelC4 architecture model and diagrams (context, container, component, code, deployment, sequence/dynamic) for any repo or named system, kept as one Structurizr workspace grounded in the code and rendered to SVG via C4-PlantUML. Use when the user asks for a model, a diagram, the architecture, a C1/C2/C3/C4 or L1-L4 level diagram of something (including "holistically"), a C4 view, a sequence diagram of a flow, how something works end to end, or what X looks like; or types /c-model./drive-prdDrive a PRD's tickets under a WIP cap through implementer, independent review, fixes, a head-pinned verdict, CI, and merge, parking human-only work, until no agent-ready ticket remains.