By cxuu
Apply idiomatic Go best practices for code review, writing, testing, concurrency, error handling, and performance optimization using 20 modular skills that activate contextually with progressive disclosure, checklists, reference files, and bash automation scripts for linting, naming, docs, and benchmarks.
Use when hardening Go code at API boundaries — copying slices/maps, verifying interface compliance, using defer for cleanup, time.Time/time.Duration, or avoiding mutable globals. Also use when reviewing for robustness concerns like missing cleanup or unsafe crypto usage, even if the user doesn't mention "defensive programming." Does not cover error handling strategy (see go-error-handling).
Use when writing or reviewing documentation for Go packages, types, functions, or methods. Also use proactively when creating new exported types, functions, or packages, even if the user doesn't explicitly ask about documentation. Does not cover code comments for non-exported symbols (see go-style-core).
Use when writing Go code that returns, wraps, or handles errors — choosing between sentinel errors, custom types, and fmt.Errorf (%w vs %v), structuring error flow, or deciding whether to log or return. Also use when propagating errors across package boundaries or using errors.Is/As, even if the user doesn't ask about error strategy. Does not cover panic/recover patterns (see go-defensive).
Use when designing a Go constructor or factory function with optional configuration — especially with 3+ optional parameters or extensible APIs. Also use when building a New* function that takes many settings, even if they don't mention "functional options" by name. Does not cover general function design (see go-functions).
Use when organizing functions within a Go file, formatting function signatures, designing return values, or following Printf-style naming conventions. Also use when a user is adding or refactoring any Go function, even if they don't mention function design or signature formatting. Does not cover functional options constructors (see go-functional-options).
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
AI Agent Skills for writing idiomatic, production-quality Go code. 20 modular skills teach AI coding assistants Go best practices derived from:
Skills are tuned following agentskills.io best practices: content the agent already knows is omitted, procedural decision trees guide multi-step tasks, 48 reference files load on demand via progressive disclosure, 8 bundled scripts automate common checks, and 4 asset templates ensure consistent output.
| Skill | Description |
|---|---|
| go-code-review | Systematic checklist for reviewing Go code and PR submissions |
| go-concurrency | Goroutine lifecycle, channels, mutexes, parallelization, thread-safety |
| go-context | Context.Context placement, cancellation, deadlines, request-scoped data |
| go-control-flow | Idiomatic conditionals, loops, switch/break behavior, guard clauses |
| go-data-structures | Slices, maps, arrays — allocation with new vs make, append, copying |
| go-declarations | Variable/const/type declarations, var vs :=, iota enums, shadowing |
| go-defensive | API boundary hardening, defer cleanup, Must functions, time handling |
| go-documentation | Doc comments, package docs, godoc formatting, runnable examples |
| go-error-handling | Error strategy decisions, wrapping (%v vs %w), sentinels, logging patterns |
| go-functional-options | Functional options pattern for constructors with optional config |
| go-functions | Function ordering, signature formatting, Printf verbs, Stringer interface |
| go-generics | When to use generics, constraints, common pitfalls, type aliases |
| go-interfaces | Interface design, abstractions, embedding, "accept interfaces return structs" |
| go-linting | Linters, golangci-lint setup, nolint directives, CI/CD integration |
| go-logging | Structured logging with slog, log levels, request-scoped context, migration |
| go-naming | Naming decision flow for packages, types, functions, variables, receivers |
| go-packages | Package organization, imports, package size, CLI/flag patterns |
| go-performance | String optimization, capacity hints, benchmarking, strconv over fmt |
| go-style-core | Formatting, nesting reduction, style principles, fallback style guide |
| go-testing | Table-driven tests, subtests, test helpers, assertions, test organization |
8 scripts automate common Go checks. All support --help, --json for
structured output, and meaningful exit codes (0 = clean, 1 = issues found,
2 = error). Analysis scripts support --limit to cap output size, and
destructive scripts require --force to overwrite existing files.
| Script | Skill | Purpose |
|---|---|---|
pre-review.sh | go-code-review | Run gofmt + go vet + golangci-lint before review |
check-naming.sh | go-naming | Detect SCREAMING_SNAKE, Get-prefixed getters, bad package names |
check-docs.sh | go-documentation | Find exported symbols missing doc comments |
check-errors.sh | go-error-handling | Catch bare returns, string comparison on errors, log-and-return |
check-interface-compliance.sh | go-interfaces | Find interfaces missing compile-time verification |
bench-compare.sh | go-performance | Run benchmarks with optional benchstat comparison |
setup-lint.sh | go-linting | Generate .golangci.yml with recommended linters |
gen-table-test.sh | go-testing | Scaffold a table-driven test file |
The easiest way to install across any AI coding agent. Supports Cursor, Codex, OpenCode, Cline, GitHub Copilot, Windsurf, Roo Code, and 25+ more agents.
npx skills add cxuu/golang-skills --all
# Add the marketplace (one time)
/plugin marketplace add cxuu/golang-skills
# Install the skills
/plugin install golang-skills@cxuu-golang-skills
https://github.com/cxuu/golang-skillsThese skills follow the Agent Skills open standard, which works across multiple AI coding tools. When you're writing Go code:
npx claudepluginhub cxuu/golang-skills --plugin golang-skillsAI Agent Skills for production-ready Go projects
Enhances code agents with Go best practices covering performance, modern syntax, generics, patterns, testing, error handling, and concurrency.
Go-specific development tools with idiomatic best practices
gopilot is your Go copilot - a skill for writing idiomatic Go code, covering design patterns, error handling, testing, concurrency, generics, and stdlib patterns up to Go 1.26.
Go code review and development skills covering architecture, middleware, data persistence, concurrency, and framework-specific patterns for BubbleTea, Wish SSH, and Prometheus.
Go development following Google Go style guide with Go 1.25+ features and best practices