Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →

cxuu/golang-skills

20 skills17.7k installs2.7k starsGitHub

Install

npx skills add https://github.com/cxuu/golang-skills

Skills in this repo

1Go Code ReviewThe go-code-review skill use when reviewing Go code or checking code against community style standards. Also use proactively before submitting a Go PR or when reviewing any Go code changes, even if the user doesn't explicitly request a style review. Does not cover language-specific syntax - delegates to specialized skills. # Go Code Review Checklist ## Review Procedure > Use `assets/review-template.md` when formatting the output of a code review to ensure consistent structure with Must Fix / Should Fix / Nits severity grouping. Run `gofmt -d .` and `go vet ./...` to catch mechanical issues first 2. Read the diff file-by-file; for each file, check the categories below in order 3. Flag issues with specific line references and the rule name 4. After reviewing all files, re-read flagged items to verify they're genuine issues 5. Summarize findings grouped by severity (must-fix, should-fix, nit) > **Validation**: After completing the review, re-read the diff once more to verify every flagged issue is real.1.2kinstalls2Go Testinggo-testing is a Go testing skill grounded in Google and Uber style guides that teaches table-driven tests, subtests, parallel execution, test helpers, test doubles, and assertions with github.com/google/go-cmp. The skill specifies when to use t.Error versus t.Fatal, patterns for subtests and parallel tests, and cmp.Diff for struct comparisons instead of brittle equality checks. Developers reach for go-testing when asked to write a test for a Go function, refactor flaky tests, or review test quality in packages and services. The skill explicitly excludes benchmark performance testing, which belongs in the separate go-performance skill.989installs3Go Lintinggo-linting is a cxuu Go skill (script v1.0.0) that generates a production-grade .golangci.yml and runs an initial comprehensive lint pass in one command. The bundled config enables 10 linters—errcheck, goimports, revive, govet, staticcheck, gosec, ineffassign, misspell, gocyclo, and bodyclose—with a 5-minute timeout, zero max-issues-per-linter, and revive exported-rule settings. Developers reach for go-linting when bootstrapping Go repos, standardizing CI lint gates, or replacing ad-hoc golangci-lint setups with an opinionated baseline that enforces security (gosec) and complexity (gocyclo min-complexity 15) checks.969installs4Go Documentationgo-documentation is a Claude Code skill from cxuu/golang-skills that teaches agents to write Go documentation matching Google Go Style Guide conventions. The skill covers package-level doc comments, exported types, functions, methods, constants, and error variables with godoc-compatible formatting including cross-references like [NewWidget]. Developers reach for go-documentation when adding or reviewing doc comments in Go modules, libraries, or internal packages. Output renders correctly in pkg.go.dev and local godoc viewers.949installs5Go PerformanceGo Performance is a Claude Code skill for Go backend engineers who need disciplined benchmark methodology instead of guesswork profiling. It documents how to write Benchmark functions in _test.go files using testing.B, loop with b.N, prevent compiler dead-code elimination, and call b.ResetTimer after setup. The skill covers comparing strconv versus fmt approaches, reading ns/op and allocation lines, and using benchstat or benchcmp workflows to judge regressions. Developers reach for Go Performance when optimizing hot paths, validating micro-optimizations, or establishing a repeatable benchmark suite before release.939installs6Go Error Handlinggo-error-handling is a cxuu/golang-skills guide to error flow in Go, centered on the handle-once principle and logging decisions that keep the normal code path visible. It teaches indent-error-flow by handling errors before proceeding, avoiding else-clause normal paths, and cautioning against if-with-initializer patterns for long-lived variables. Developers reach for go-error-handling when refactoring noisy if err != nil blocks or standardizing logging across a Go codebase. The skill is pattern-oriented with concrete good-and-bad Go snippets rather than a standalone linter binary.929installs7Go Naminggo-naming is an Apache-2.0 cxuu/golang-skills checker grounded in Google and Uber Go style guides for packages, types, functions, methods, variables, constants, and receivers. It ships scripts/check-naming.sh, runnable via allowed Bash tooling, to flag SCREAMING_SNAKE_CASE constants, Get-prefixed getters, vague package names like util or helper, and receiver naming issues. Developers invoke go-naming when creating exported APIs or reviewing naming consistency without waiting for reviewer feedback. The skill complements go-packages for organization topics it explicitly does not cover.925installs8Go Concurrencygo-concurrency is an advanced Go reference skill grounded in Effective Go for situational concurrency patterns beyond basic goroutines. It explains channels of channels, embedding reply channels inside request structs, and patterns for multiplexing many clients through shared workers while keeping responses routed correctly. The skill emphasizes when to use each pattern for request/response fan-in and CPU-bound parallelization instead of reaching for mutexes by default. Backend and systems developers reach for go-concurrency when a Go service must coordinate many concurrent callers, route replies safely, or scale CPU work across goroutines without introducing data races.924installs9Go Interfacesgo-interfaces is an Apache-2.0 cxuu/golang-skills module sourced from Effective Go, the Google Style Guide, and the Uber Style Guide for interface design and composition in Go. The skill applies when defining interfaces, choosing accept-interface versus return-concrete-type boundaries, writing type assertions with the comma-ok idiom, using type switches, or embedding types in public APIs—excluding generics-based polymorphism covered by go-generics. It ships bash scripts/check-interface-compliance.sh to find exported interfaces missing compile-time var _ I = (*T)(nil) assertions, plus references/EMBEDDING.md and references/RECEIVER-TYPE.md for deeper patterns. Core rules: consumers define interfaces, producers return concrete types, avoid embedding in public structs, prefer pointer receivers when any method mutates state, and add blank-identifier checks only when static conversions will not catch drift. Reach for go-interfaces when designing mockable Go package boundaries or reviewing whether an interface is premature.919installs10Go Contextgo-context is an Apache-2.0 skill from cxuu/golang-skills that guides idiomatic use of context.Context in Go backends. The skill enforces context as the first parameter in function signatures, proper propagation of cancellation and deadlines, and storing values in context versus explicit parameters. It applies when cancelling long-running operations, setting timeouts, or passing request-scoped data—even when the user does not mention context.Context directly. The skill requires Go 1.7+ when context moved to the standard library and cites the Go Wiki CodeReviewComments as its source. It explicitly excludes goroutine lifecycle and sync primitives, which belong to the sibling go-concurrency skill.911installs11Go Defensivego-defensive is a Go style skill from cxuu/golang-skills based on the Uber Style Guide for preventing accidental mutation of shared slice and map backing arrays at API boundaries. The skill shows bad patterns like assigning caller slices directly to struct fields and good patterns using make plus copy for slices and equivalent defensive copies for maps. Backend developers reach for go-defensive when writing setters, constructors, and repository methods that accept []T or map[K]V from external callers, tests, or HTTP handlers. Applying go-defensive early avoids subtle data races and state corruption in services where returned references would let callers modify internal collections after the function exits.905installs12Go Style Corego-style-core is a formatting and style reference skill from cxuu/golang-skills that mandates gofmt-compliant Go source across every project. It documents required use of gofmt, optional goimports for import management, and gofumpt as a stricter formatter superset, with concrete shell examples such as `gofmt -w myfile.go` and `gofmt -w .`. The skill also covers Go-specific syntax conventions including reduced parentheses in control structures and clearer operator precedence than C or Java. Developers reach for go-style-core when agents generate or review Go files and need automatic alignment with community-standard formatting without manual style debates. It pairs with code review flows where inconsistent imports or non-gofmt layouts would fail CI.903installs13Go Functional Optionsgo-functional-options is a cxuu/golang-skills agent skill sourced from the Uber Go Style Guide and Google Style Guide that teaches the functional options pattern for Go constructors. Its decision framework recommends config structs for internal or test-only APIs, functional options for public APIs with 3+ optional parameters, and validation-friendly option application inside constructors. The pattern uses an unexported options struct, an exported Option interface with unexported apply methods, and With* helper functions applied variadically in New constructors. Developers reach for go-functional-options when designing Connect-style APIs, evolving library constructors, or choosing between functional options, config structs, and builder patterns in Go packages.895installs14Go Packagesgo-packages is a Go agent skill from cxuu/golang-skills that standardizes how agents organize import blocks in generated and edited Go files. The skill documents minimal Uber-style grouping—standard library first, then everything else—and extended Google-style grouping that separates external packages, protocol buffers, and side-effect imports with blank lines between groups. Developers reach for go-packages when agents produce messy import blocks, mix stdlib with third-party paths, or omit proto aliases and side-effect import sections expected by team style guides. Examples show correct grouping for fmt and os alongside go.uber.org and golang.org/x dependencies, plus fuller layouts with protobuf and blank-import packages. The skill keeps import hygiene consistent across backend services and CLI tools without requiring manual goimports cleanup on every agent edit.895installs15Go Data Structuresgo-data-structures is a Go-focused agent skill from cxuu/golang-skills that distills Effective Go slice semantics into agent-actionable rules. The skill documents the three-item slice descriptor—pointer, length, and capacity—and shows how slices describe sections of underlying arrays rather than storing data independently. Developers reach for go-data-structures when agents generate or review Go code involving sub-slicing, append growth, shared backing storage, or nil slices, because subtle aliasing can cause cross-variable mutations and capacity surprises. Concrete examples cover creating slices from fixed arrays, interpreting len and cap after slicing, and recognizing when two slice variables observe the same memory. The skill is reference guidance for backend Go services, CLIs, and APIs where in-memory collection behavior affects correctness and performance reviews.893installs16Go Control Flowgo-control-flow is a Go coding skill from cxuu/golang-skills that documents when and how to use the blank identifier `_` in real Go programs. The skill covers discarding unwanted values from multi-assignment expressions, importing packages purely for side effects, and asserting interface compliance at compile time without runtime overhead. It also warns against silently discarding errors that cause nil-pointer panics, with examples using `os.Stat`, `if _, err :=` patterns, and documented intentional ignores. Developers reach for go-control-flow when reviewing Go error-handling code, refactoring imports, or enforcing interface contracts during backend or CLI implementation.891installs17Go Logginggo-logging is a Go instrumentation skill from cxuu/golang-skills that guides adding structured, leveled logging to services and command-line tools. The skill emphasizes consistent field keys, context propagation through request handlers, and hooks compatible with production observability pipelines so logs remain parseable in aggregation systems. Developers reach for it when standing up a new Go microservice, CLI, or refactoring printf-style debugging into leveled structured output. Outputs include logger initialization patterns, context-aware child loggers, and field conventions that survive multi-package codebases. Use it during backend build when traceability and operability must be designed in, not bolted on after deploy.677installs18Go Functionsgo-functions is a skill in cxuu/golang-skills for designing and organizing functions within Go files. It routes agents to references/SIGNATURES.md for parameters, return values, named results, and readability, plus references/PRINTF-STRINGER.md for fmt verbs, Stringer, GoStringer, Formatter, and Printf-style naming. The skill triggers when users add or refactor any Go function even without mentioning signature design. It explicitly does not cover functional options constructors, which belong to the separate go-functional-options skill. Developers reach for go-functions when cleaning up Go APIs, standardizing error returns, or aligning logging helpers with idiomatic Printf naming patterns.666installs19Go Genericsgo-generics from cxuu/golang-skills helps developers decide when to use Go generics versus concrete types or interfaces when writing generic functions, types, and constraints in Go 1.18 or later. The skill routes constraint composition questions to references/CONSTRAINTS.md and advises starting with concrete types before generalizing only when multiple types share real behavior. Developers reach for go-generics when choosing constraints, comparing type aliases to type definitions, or writing utility functions that could work across multiple Go types even if generics are not explicitly mentioned. Interface design without generics is explicitly deferred to the go-interfaces sibling skill.665installs20Go Declarationsgo-declarations is a Go style skill from cxuu/golang-skills focused on declaration and initialization idioms. It routes agents to references/SCOPE.md for var versus :=, if-init narrowing, and composite literal formatting, plus references/IOTA.md for constant blocks and enumerated types. Examples use any instead of interface{}, requiring Go 1.18+. Developers reach for go-declarations when creating new structs, const blocks, or maps even if they do not explicitly ask about style, because the skill prevents scope leaks and non-idiomatic patterns before review. It pairs with go-naming for identifiers but owns declaration mechanics exclusively.659installs

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.

cxuu/golang-skills · 20 skills · Skillselion