
cxuu/golang-skills
16 skills11k installs1.8k starsGitHub
Install
npx skills add https://github.com/cxuu/golang-skillsSkills in this repo
1Go Code ReviewGo Code Review is a procedural agent skill that walks reviewers through community-aligned Go pull request review: run mechanical checks with gofmt and go vet, read the diff file-by-file against formatting, documentation, naming, error handling, and concurrency categories drawn from Go Wiki CodeReviewComments and the Uber style guide, flag issues with line references and rule names, then summarize in Must Fix, Should Fix, and Nits buckets using the bundled review template. Solo builders shipping Go APIs or CLIs use it proactively before submitting a PR or when reviewing teammate changes—even when the user did not ask for style review—because the skill's description encodes that default. It spans Ship review as the primary shelf and Build backend when iterating on packages locally. Prism lists it for Go-focused discovery; it is a checker pattern, not a code generator, and points to go-linting for specialized lint depth.929installs2Go TestingGo Testing is an agent skill for solo builders shipping Go services, CLIs, or APIs who want tests that match production team norms. It activates when you write, review, or improve Go test code—even if you only ask to “write a test for this function.” The skill encodes when to use table-driven layouts, named subtests, parallelism, helpers with t.Helper(), and teardown via t.Cleanup() instead of fragile defer chains. Assertions favor github.com/google/go-cmp cmp.Diff for rich diffs on complex types. Every failure message must be self-diagnosing: YourFunc(inputs) = got, want expected. It does not cover benchmark tuning; use the companion performance skill for that. Apache-2.0 licensed with optional Bash tool allowance for running tests in agent environments.733installs3Go LintingGo-linting is a procedural agent skill packaged as a bash script that materializes a battle-tested .golangci.yml and immediately executes golangci-lint against your repository. Solo builders shipping Go APIs, CLIs, or backend services often postpone lint setup until CI breaks; this skill collapses that setup into one invocation with sensible defaults spanning correctness (errcheck, govet, staticcheck), style (revive, goimports), security (gosec), and hygiene (ineffassign, misspell, bodyclose, gocyclo). You can dry-run the config to stdout, force-overwrite an existing file, or emit structured JSON for agents to triage findings. It fits the ship-phase review subphase as an automated gate before merge or release, and pairs naturally with Go backend work without replacing full test suites or security audits.718installs4Go Documentationgo-documentation is a Go-focused agent skill that demonstrates and enforces proper documentation conventions for packages, types, functions, methods, and constants. Solo builders maintaining CLI tools or backend services use it when comments must read well on pkg.go.dev and match team expectations grounded in the Google Go Style Guide. The bundled example package shows how to write a package-level narrative, sectioned Getting Started guidance, linkable references to constructors, explicit error variables, concurrency safety statements, cleanup instructions, and deprecated entry points with migration hints. Agents apply the same patterns to your real packages so exported symbols stay discoverable and reviewable without a separate documentation pass. It is a narrow, high-leverage docs skill—not a tutorial on Go syntax—aimed at consistent godoc output during everyday implementation work.696installs5Go Naminggo-naming is an agent skill that walks solo and indie builders through idiomatic Go identifier naming whenever they add packages, types, functions, methods, variables, constants, or receivers. It is triggered even when the user does not ask for “naming conventions,” including new exported APIs and fresh types. The skill encodes a practical decision tree—from lowercase singular package nouns through single-method -er interfaces, 1–2 letter receivers, MixedCaps constants with iota enums, and verb-shaped exported functions without redundant Get prefixes. It emphasizes that Go names are usually shorter than in other languages and that good names avoid repeating context already obvious from types or packages. A companion Bash script, check-naming.sh, flags common anti-patterns so agents can verify renames in the repo. Use it during backend and CLI work when readability and API clarity matter before review or release.684installs6Go Error HandlingGo Error Handling is a focused pattern skill from golang-skills that teaches how to structure error branches, avoid double logging, and keep normal code readable in Go services and CLIs. Indie builders shipping APIs or workers use it whenever they write or refactor error paths—not only on greenfield files. It covers indent-error-flow (check err before proceeding), separating long-lived variable declaration from short if-init scopes, and the handle-once rule: return wrapped errors upstream, log and degrade without returning, or switch on sentinel errors while passing others through. The skill contrasts good and bad snippets so agents do not nest business logic inside else blocks or combine logging with returns at the same layer. It pairs naturally with code review and debugging phases when stack traces show duplicated log lines or swallowed errors. Assumes an existing Go module and comfort reading idiomatic Go.677installs7Go PerformanceGo Performance is an agent skill that teaches solo Go builders how to measure what actually costs CPU and allocations before they ship backends, CLIs, or APIs. It walks through idiomatic `Benchmark*` functions in `_test.go` files: loop on `b.N`, reset timers after setup, assign outputs so the compiler cannot elide work, and use sub-benchmarks with `b.Run` for size sweeps. Running guidance covers `go test -bench=.`, targeted `-bench=BenchmarkName`, `-benchmem` for per-op bytes and allocs, and `-count` for repeated runs when you need stability—not a single lucky number. The included strconv versus fmt example shows how to structure fair comparisons agents can extend to your hot paths. Place it on the Ship perf shelf, but reach for it during Build backend when choosing between implementations and during Operate iterate when regressions appear. Intermediate complexity assumes familiarity with Go modules and `go test`. It is methodology, not a profiler replacement: pair results with pprof when you need line-level attribution.677installs8Go ConcurrencyGo Concurrency is a focused reference skill drawn from Effective Go for advanced patterns solo builders reach for after basics—embedding reply channels in request structs for multiplexed RPC-style servers, and splitting independent CPU work with WaitGroup. It explicitly frames these as situational: not every handler needs a channel-of-channels, and parallelization applies when computation decomposes cleanly. Agents invoking it during backend implementation get idiomatic struct shapes, client/server send/receive loops, and a modernized Vector.DoSome-style parallel slice. There is no external toolchain; value is procedural knowledge for correct, deadlock-aware Go design during API and worker code.676installs9Go Interfacesgo-interfaces is a Go-focused agent skill for solo builders and small teams shipping APIs, CLIs, and backend services. It encodes how to define and implement interfaces, design abstractions, and carve mockable boundaries for tests—without waiting for the user to say the word “interface.” It walks through the consumer-side interface pattern, concrete return types from constructors, embedding and composition, and safe use of type assertions and type switches, grounded in Effective Go and common Google and Uber guidance. A helper script scans your tree for exported interfaces that lack compile-time compliance checks. Use it during backend refactors, when splitting packages, or when tests need fakes without exporting huge surface areas. It deliberately does not teach generics-first polymorphism; pair it with go-generics when type parameters are the right tool.665installs10Go Style Corego-style-core is a compact formatting and naming reference for solo builders using AI agents on Go backends, CLIs, and agent tooling. It makes non-negotiable rules explicit: every file must match gofmt output, imports should be managed with goimports or stricter gofumpt when you want tighter consistency, and identifiers follow MixedCaps rather than underscore shouting. It explains why Go uses lighter parentheses than C or Java, how operator precedence affects readable expressions, and how to break long lines without mangling URLs or function signatures. The skill is ideal when an agent just generated a pile of Go and you need a single authoritative style pass before review. It is reference-weight rather than a full style guide for error handling or package layout—pair with broader golang-skills for architecture topics.665installs11Go ContextGo-context is an agent skill that encodes idiomatic use of context.Context for solo builders shipping Go APIs, CLIs with network calls, and background workers. It is invoked whenever code touches cancellation, timeouts, or request-scoped data—even if the user never says “context.Context” aloud. The skill reinforces the community convention that context is the first parameter, must not live as a struct field except where interfaces force otherwise, and should flow explicitly through methods so lifetimes stay obvious. It complements concurrency skills by focusing on API shape and propagation rather than goroutine primitives. For indie backends on Claude Code or Cursor, it reduces review churn and production incidents from leaked goroutines, missing deadlines, and ambiguous value bags in middleware.661installs12Go Defensivego-defensive is an agent skill that encodes the Uber Go Style Guide rule: slices and maps are reference types, so you must copy them at API boundaries. Solo builders shipping Go APIs, workers, or microservices install it when implementing setters, config loaders, or read methods that expose collections. The skill walks through receiving slices and maps—never assign the caller’s slice directly; allocate and copy—and receiving maps with an explicit loop into a new map. It also covers returning internal state: returning a live map or slice lets callers mutate data under your locks or invariants. The intended workflow is to paste or generate a function, compare against the Bad/Good pairs, and fix storage and return paths before review. It pairs naturally with code review and security-minded backend work because boundary bugs often surface only under concurrent or multi-tenant usage. Complexity is intermediate: you need basic Go slices, maps, and when to use mutexes, but no new libraries.653installs13Go Data StructuresGo Data Structures (slice internals) is a compact reference skill distilled from Effective Go so your agent does not hallucinate slice behavior while writing Go backends. Solo builders shipping APIs, workers, or CLIs hit subtle bugs when sub-slices alias arrays, append reallocates, or capacity is assumed stable. The skill walks through descriptors, sharing examples, indexing forms, and the append return-value rule with concrete snippets. Use it during implementation and code review when the task involves buffers, batching, parsing, or any code path that reslices or appends frequently. It is reference material, not a scaffolding generator—you still own tests and benchmarks for hot paths.650installs14Go Functional Optionsgo-functional-options is a concise design guide for solo and indie builders writing Go packages who must pick between a config struct and the functional options pattern for optional constructor settings. It frames the problem as the same—optional configuration—but with different trade-offs around ceremony, extensibility, and caller stability. Use it when you are exposing a NewClient-style API and debating whether callers should pass one struct literal or a chain of WithTimeout, WithLogger, and similar functions. The skill walks a explicit decision framework: internal or test-only APIs often favor structs; public APIs with several options that may grow favor functional options; cases needing cross-field validation map cleanly to apply functions. It includes good and bad examples for struct-based clients and when all options are usually set together. Complexity is intermediate because it assumes familiarity with Go zero values and package boundaries, not greenfield syntax tutorials.650installs15Go Control FlowGo control flow in this catalog entry presents blank identifier patterns—the `_` construct—for solo builders writing Go backends and CLIs. It explains when to discard secondary return values in conditionals, why silently ignoring errors is dangerous unless explicitly justified, how to import packages purely for init side effects such as pprof handlers or PNG decoders, and how to assert interface implementation at compile time without runtime cost. The material is phase-specific reference knowledge for the build stage rather than a multi-step agent ritual: you invoke it while reviewing or generating Go code that mishandles multi-value returns or missing interface methods. Complexity is beginner-friendly if you already write Go, with emphasis on avoiding subtle nil dereferences. It complements broader Go skills in the same repository but does not prescribe a workflow chain or external integrations.648installs16Go Packagesgo-packages is an agent skill that encodes detailed import-organization rules for Go modules, drawing from Uber’s minimal grouping and Google’s extended grouping for protos and side effects. Solo and indie builders shipping APIs, CLIs, or backend services install it when they want agents to format import blocks consistently—stdlib first, external second, with optional proto and blank-import sections—without re-pasting style guide excerpts into every session. It covers when to rename imports (collisions, uninformative v1 aliases, generated pb packages), when to prefer urlpkg over net/url when a url variable exists, and how to structure import _ lines. Use it during code review prep or when refactoring packages so diffs stay readable and linters stay quiet. It does not replace gofmt or golangci-lint but gives procedural knowledge agents can apply file-by-file before you ship.647installs