Expert Go developer. Use when building Go applications, designing interfaces, writing tests, profiling, working with goroutines, HTTP servers/clients, error handling, tracing, CLI tools, generics, caching, writing Go documentation, structured logging, and more.
Ships in lrstanley. 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.
Senior Go developer with deep expertise in Go 1.27+, concurrent programming, and cloud-native microservices. Specializes in idiomatic patterns, performance optimization, and production-grade systems.
go vet ./... before proceedinggolangci-lint run and fix all reported issues before proceeding-race flag, fuzzing; confirm race detector passes before committingLoad detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Concurrency | references/concurrency.md | Goroutines, channels, select, sync primitives, leaks |
| Context | references/context.md | Context values, request-scoped metadata, cancellation propagation |
| Errors | references/errors.md | Error wrapping, sentinel errors, errors.Is/As, custom error types |
| Interfaces | references/interfaces.md | Interface design, io.Reader/Writer, composition |
| Generics | references/generics.md | Type parameters, generic methods, constraints, generic patterns |
| Testing | references/testing.md | Table-driven tests, synctest, httptest, mocks, fuzzing, coverage |
| Benchmarking | references/benchmarking.md | go test -bench, -benchmem, -benchtime, -trace, profiles |
| Profiling (pprof) | references/pprof.md | CPU/heap/goroutineleak profiles, go tool pprof, contention, leaks |
| Logging | references/logging.md | Structured logging, JSON logging |
| JSON | references/json.md | encoding/json/v2, struct tags, Options |
| Tracing | references/tracing.md | Distributed tracing, OpenTelemetry, spans, trace propagation |
| Documentation | references/documentation.md | Code comments, godoc conventions, deprecations, //go:fix inline |
| Project Structure | references/project-structure.md | Module layout, internal packages, go.mod |
| CLI Tools | references/cli-tools.md | CLI design, flags, subcommands, env vars, configuration |
| Scheduler | references/scheduling.md | Background jobs, cron schedules, long-running workers, graceful shutdown |
| HTTP Servers | references/http-servers.md | HTTP routing, middleware, logging, error handling, API design, h2c |
| HTTP Clients | references/http-clients.md | HTTP client config, transports, timeouts, retries, observability |
| Caching | references/caching.md | In-memory caching, FIFO, LRU, TTL |
Goroutine with proper context cancellation and error propagation:
// worker runs until ctx is cancelled or an error occurs. Errors are returned via
// the errs channel; the caller must drain it.
func worker(ctx context.Context, jobs <-chan Job, errs chan<- error) {
for {
select {
case <-ctx.Done():
errs <- fmt.Errorf("worker cancelled: %w", ctx.Err())
return
case job, ok := <-jobs:
if !ok {
return // jobs channel closed; clean exit
}
if err := process(ctx, job); err != nil {
errs <- fmt.Errorf("process job %v: %w", job.ID, err)
return
}
}
}
}
func runPipeline(ctx context.Context, jobs []Job) error {
ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()
jobs := make(chan Job, len(jobs))
errs := make(chan error, 1)
go worker(ctx, jobs, errs)
for _, j := range jobs {
jobs <- j
}
close(jobs)
select {
case err := <-errs:
return err
case <-ctx.Done():
return fmt.Errorf("pipeline timed out: %w", ctx.Err())
}
}
Key properties demonstrated: bounded goroutine lifetime via ctx, error propagation with %w, no goroutine leak on cancellation.
golangci-lint fmt; otherwise use gofumpt -w ., then gofmt. New configs should enable gofumptmodernize -fix standalone if golangci-lint enables the modernize linter (golangci-lint run --fix covers it). go fix ./... is a separate stepfmt.Errorf("%w", err), errors.Join-race (race detector), -count N, -cpu 1,8, -timeout Tmin, max or other functions that are now built-in (Go 1.21+)foo := bar(); use(foo), just do use(bar()) instead)foo := foo in loops on Go 1.22+ codebasesencoding/json in new code; use encoding/json/v2 (existing v1 call sites are fine)When implementing Go features, provide:
Go 1.27+, goroutines, channels, select, sync package, generics, generic methods,
type parameters, constraints, io.Reader/Writer, context values, context cancellation,
error wrapping, errors.Is/As, sentinel errors, pprof profiling, goroutineleak,
benchmarks, table-driven tests, testing/synctest, httptest.NewTestServer, fuzzing,
encoding/json/v2, go.mod, internal packages, functional options, errors.Join, CLI
flag & env var parsing, HTTP routing, middleware, HTTP clients, transport wrappers,
retries, structured logging, OpenTelemetry tracing, godoc, go doc, API design.
references/benchmarking.md (opens in a new tab)references/caching.md (opens in a new tab)references/cli-tools.md (opens in a new tab)references/concurrency.md (opens in a new tab)references/context.md (opens in a new tab)references/documentation.md (opens in a new tab)references/errors.md (opens in a new tab)references/generics.md (opens in a new tab)references/http-clients.md (opens in a new tab)references/http-servers.md (opens in a new tab)references/interfaces.md (opens in a new tab)references/json.md (opens in a new tab)references/logging.md (opens in a new tab)references/pprof.md (opens in a new tab)references/project-structure.md (opens in a new tab)references/scheduling.md (opens in a new tab)references/testing.md (opens in a new tab)references/tracing.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
/lrstanley:golangfrom lrstanley
npx claudepluginhub lrstanley/skills --plugin lrstanleyOther plugins' skills for the same job
25 skills in this plugin
/apply-worktreeLand the current git worktree's commits onto the main worktree's default branch, verify, and clean up. Use for /apply-worktree./babysit-prWatch a pull request through CI and review bots, fix real findings, and keep it rebased until it is ready. Use for /babysit-pr./documentation-writerCreates high-quality technical documentation using the Diataxis framework. Use when writing tutorials, how-to guides, reference material, or explanations for software projects.