go

Applies idiomatic Go conventions for writing, reviewing, and refactoring Go code.

10|2|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/nrdxp/predicate --skill go-nrdxp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go
Source: https://github.com/nrdxp/predicate/tree/main/skills/go
Command: npx skills add https://github.com/nrdxp/predicate --skill go-nrdxp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Go code written without knowledge of the language's conventions often fights the ecosystem: inconsistent naming, ignored errors, oversized interfaces, and formatting debates. This Skill anchors Go development to established idioms so code reads like the rest of the Go ecosystem. ## Core Features & Use Cases - Idiomatic Style Rules: Covers naming (PascalCase vs camelCase, acronym casing like HTTP/URL/ID), package naming, getter/setter conventions, and one-method interface naming with the -er suffix. - Error Handling Patterns: Enforces explicit error checks, error wrapping with %w, sentinel errors, custom error types, and clear guidance on when panic is acceptable. - Concurrency & Tooling Guidance: Documents goroutines, channels, select, sync.WaitGroup, context.Context, and the standard toolchain (gofmt, go vet, golangci-lint, go test -race). - Use Case: When asked to refactor a Go service, the agent applies these rules automatically — replacing GetName() getters with Name(), wrapping errors with context, and verifying interface satisfaction at compile time with var _ io.Reader = (*MyReader)(nil). ## Quick Start Review my Go package for idiomatic style issues and refactor any non-idiomatic error handling, naming, or interface definitions.

Frequently Asked Questions about go

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle errors idiomatically in Go?

Go treats errors as values: check every returned error explicitly and never discard it with _. Wrap errors with context using fmt.Errorf and the %w verb, and define sentinel errors or custom error types for library code.

What are Go naming conventions for functions and packages?

Exported identifiers use PascalCase, unexported use camelCase, and packages are short lowercase single words. Acronyms stay all-caps (HTTP, URL, ID), getters omit the Get prefix, and one-method interfaces use the method name plus -er, like Reader or Stringer.

When should I use pointer vs value receivers in Go?

Use pointer receivers when the method modifies the receiver, the struct is large, or other methods already use pointers for consistency. Use value receivers for small immutable types and methods that do not modify state.

Should I use channels or mutexes for Go concurrency?

Go's motto is to share memory by communicating, so prefer channels for coordination between goroutines. Use sync.WaitGroup to wait for completion, context.Context for cancellation, and select to multiplex channel operations; start simple before adding primitives.

When is it acceptable to panic in Go?

Library code should never panic and must return errors instead. Panic is acceptable for truly impossible states that violate invariants, and log.Fatal is acceptable for initialization failures in main packages.