/vocdoni-go:go-best-practicesfrom vocdoni-go
Use this skill for architectural and idiomatic Go decisions - the philosophical side of Go work. Encodes Rob Pike's Go Proverbs ("share memory by communicating", "the bigger the interface the weaker the abstraction", "errors are values", "clear is better than clever", "Cgo is not Go", etc.) as concrete guidance with rationale and examples. Trigger on "is this idiomatic", "should I use a channel or a mutex", "small vs large interface", "should I use Cgo / unsafe / reflect", "is this the Go way", or whenever a design call hinges on Go philosophy rather than a concrete checklist. For production-readiness review and the rule-by-rule checklist (domain types, error contracts, context discipline, goroutine lifetimes), reach for go-code-quality instead.
Ships in vocdoni-go. 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.
Rob Pike's Go Proverbs as concrete guidance. Use these as defaults when writing or reviewing Go. Deviation is fine when the situation justifies it, but the deviation should be deliberate.
This file is the index. The 19 proverbs each have rationale and idiomatic code examples in references/proverbs.md. Load the full reference when:
For a quick sanity check or to refresh which proverb is relevant, the one-liners below are usually enough.
Concurrency
Interfaces and types
io.Reader is powerful because it has one method. Many-method interfaces force narrow implementations.var x T is already valid (sync.Mutex, bytes.Buffer, nil slices).interface{} says nothing — The empty interface (or any) tells the reader and the compiler nothing. Keep it at serialization boundaries only.Style and tooling
gofmt's style is no one's favorite, yet gofmt is everyone's favorite — A standard format matters more than personal preferences. Run gofmt/goimports and move on.Cgo, syscall, unsafe
syscall, you should have a build tag. If you're writing portable code, use os instead.unsafe package, there are no guarantees — unsafe opts out of Go's version-stability and memory-safety contracts. Isolate it, document why, accept the cost.Clarity and reflection
Errors
if err != nil { return err }.Design and docs
Panics
Open references/proverbs.md and jump to the proverb by number or by title. Each entry has:
slices/maps/cmp, t.Context(), omitzero, b.Loop(), wg.Go(), errors.AsType, etc.).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub vocdoni/skills --plugin vocdoni-go3 skills in this plugin
/go-code-qualityUse this skill for production-grade Go code review, refactor, or generation - the checklist-driven side of Go work. Enforces strong domain modeling (no primitive obsession, no stringly-typed enums), explicit error contracts (return vs panic, %w vs %v, sentinel/typed/predicate errors, handle-once), context-and-cancellation discipline, bounded goroutine lifetimes, consumer-side interfaces, table-driven tests with got/want, and input validation at boundaries. Load this when the task is "review this Go", "is this production-ready", "harden this API", "refactor this package", or when assessing concurrency, error handling, or API design. Companion deep reference loaded on demand from references/go-practices.md./go-modernUse this skill when writing, reviewing, or refactoring Go code. Detects the project's Go version from go.mod and applies only language features available in that version - modern built-ins like slices/maps/cmp, type-safe atomics, errors.Join, range-over-int, t.Context(), omitzero, b.Loop(), strings.SplitSeq, wg.Go(), new(val), errors.AsType. Avoids both outdated patterns and features from newer-than-target versions.Other plugins' skills for the same job