last update
May 6, 2026
license
MITv1.0.0
format
SKILL.md
- Install
// Downloads SKILL.md into ~/.claude/skills/golang-engineer/
$ curl -fsSL --create-dirs -o ~/.claude/skills/golang-engineer/SKILL.md https://claudeskil.com/skills/golang-engineer/SKILL.md - Invoke
// Inside Claude Code, type the skill name as a slash command
> /golang-engineer scaffold a typed REST endpoint - Or just ask
// Claude loads the skill by itself when a request matches its description
> scaffold a typed REST endpoint
- name:
- Golang Engineer
- slug:
- golang-engineer
- version:
- v1.0.0
- license:
- MIT
- author:
- @chiragthummar16
- categories:
- tags:
- #golang#go#concurrency#testing#performance
- description:
Idiomatic Go: goroutines done right, error handling, testing, modules, perf tuning.
// What you can do with it
- Concurrency: worker pools, fan-in/fan-out, select with ctx.Done(), errgroup.Group for bounded parallel work, sync.Once/sync.WaitGroup/sync.Mutex placed correctly. Flags goroutine leaks and missing cha
- Errors: wraps with fmt.Errorf("...: %w", err), inspects with errors.Is / errors.As, defines sentinel errors and typed errors where each fits. Discourages naked panic in library code.
- Context: threads context.Context as the first parameter, uses context.WithTimeout/WithCancel, and avoids stashing request data in context except request-scoped values.
- Testing: table-driven tests with subtests via t.Run, t.Parallel(), golden files, testing.B benchmarks, and fuzz targets (func FuzzX(f *testing.F)).
- Tooling: drives go test -race, go test -bench=. -benchmem, go vet, go test -cover, and pprof for CPU/heap profiles.
README.md
Golang Engineer
A senior Go engineer in skill form. It writes and reviews idiomatic Go the way an experienced team lead would: correct concurrency, errors that carry context, tests that fail with useful messages, and a sober view of when the standard library already solves the problem. Aimed at backend and platform developers who want code that survives go vet, the race detector, and a critical PR review.
When to use it
- You're wiring up goroutines and want to avoid leaks, deadlocks, or unsynchronized access.
- An incoming request needs cancellation and deadline propagation through several layers.
- You're standing up a new module and want a sane layout, error strategy, and test scaffolding from the start.
- A function is hot in the profiler and you need a benchmark plus a fix backed by numbers.
- You're deciding between
encoding/json,database/sql,net/httpand a third-party alternative.
What it does
- Concurrency: worker pools, fan-in/fan-out,
selectwithctx.Done(),errgroup.Groupfor bounded parallel work,sync.Once/sync.WaitGroup/sync.Mutexplaced correctly. Flags goroutine leaks and missing channel closes. - Errors: wraps with
fmt.Errorf("...: %w", err), inspects witherrors.Is/errors.As, defines sentinel errors and typed errors where each fits. Discourages nakedpanicin library code. - Context: threads
context.Contextas the first parameter, usescontext.WithTimeout/WithCancel, and avoids stashing request data in context except request-scoped values. - Testing: table-driven tests with subtests via
t.Run,t.Parallel(), golden files,testing.Bbenchmarks, and fuzz targets (func FuzzX(f *testing.F)). - Tooling: drives
go test -race,go test -bench=. -benchmem,go vet,go test -cover, andpproffor CPU/heap profiles.
Usage
curl -fsSL --create-dirs -o ~/.claude/skills/golang-engineer/SKILL.md https://claudeskil.com/skills/golang-engineer/SKILL.md
# then, in your repo:
"Convert this sequential fetch loop into a bounded worker pool with errgroup,
honoring the request context, and add a table-driven test."
g, ctx := errgroup.WithContext(ctx)
sem := make(chan struct{}, 8) // cap concurrency
for _, u := range urls {
u := u
sem <- struct{}{}
g.Go(func() error {
defer func() { <-sem }()
return fetch(ctx, u)
})
}
err := g.Wait()
Tips & gotchas
- The classic loop-variable capture bug only bites on Go ≤ 1.21; the skill still adds
u := uunless yourgo.moddeclares 1.22+. - It runs benchmarks with
-benchmemso allocation counts, not just ns/op, drive optimization decisions. - It treats a passing test suite without
-raceas unverified for any concurrent code. - Buffered channels are sized deliberately, never as an accidental "fix" for a synchronization bug.
FAQ
Does it pull in heavy dependencies? No. It defaults to stdlib and reaches for golang.org/x/... (e.g. errgroup) or well-known libraries only when they clearly earn their place, and says why.
Will it match my project's conventions? Yes — it reads your existing packages, go.mod version, and error-handling style before generating code.
Can it explain a profile? It generates the pprof commands and interprets the hot paths, then proposes a benchmark-backed change.
$ cat reviews/