Provides Go naming conventions for packages, files, types, functions, methods, receivers, variables, constants, errors, acronyms and tests, grounded in Effective Go and Go Code Review Comments.
Ships in go-agent-skills. 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.
In Go the package name is part of every call site, capitalization decides visibility, and short names are the norm. A good name reads well where it is used, not where it is declared.
Community default. A project skill or agent-config rule that explicitly supersedes
go-namingtakes precedence over this one.
Detailed reference material, loaded on demand:
references/examples.md — before/after renames for every rule below,
including the initialism and stuttering edge cases.Read a reference file only when the summary below is not enough.
| Element | Convention | Example |
|---|---|---|
| Package | short, lowercase, one word, singular | order, httpsign, postgres |
| File | lowercase, _ allowed, named after its main type or concern | order_service.go, order_service_test.go |
| Exported identifier | MixedCaps | ParseToken, MaxRetries |
| Unexported identifier | mixedCaps | parseToken, maxRetries |
| Initialism | all one case | URL, userID, ServeHTTP, xmlParser |
| Getter / setter | Owner() / SetOwner() | never GetOwner() |
| Constructor | New for the package's main type, NewThing otherwise | ring.New, http.NewRequest |
| Panicking variant | Must prefix | template.Must, regexp.MustCompile |
| Functional option | With + setting | WithTimeout, WithLogger |
| One-method interface | method + -er | Reader, Notifier |
| Receiver | 1-2 letters, same on every method | func (s *Server) |
| Sentinel error | Err prefix (err unexported) | ErrNotFound, errClosed |
| Error type | Error suffix | ValidationError |
| Enum constant | type name prefix, zero = unknown | StatusUnknown, StatusActive |
| Test | Test + function, Test + type _ method | TestParse, TestCache_Get |
mixedCaps, no plural
(order, not orders).retry, httpsign, postgres. Never
util, common, helpers, misc, base, models, types — they
say nothing and collect everything.url, user, buf) when
the package is imported widely; a call site with u := user.New() reads
better than shadowing the package.The package name is always present at the call site, so don't repeat it:
// ✅ Good — reads once
http.Client order.Service user.New() config.Load()
// ❌ Bad — says it twice
http.HTTPClient order.OrderService user.NewUser() config.LoadConfig()
The rule covers every exported name in the package, not just the main
type: in package dbpool, Pool, Status and Option — not DBPool,
PoolStatus, PoolOption.
MixedCaps or mixedCaps. Underscores appear only
in test names (TestCache_Get), generated code, and cgo.URL, ID, HTTP, JSON,
API — userID, parseURL, ServeHTTP, HTTPServer, xmlHTTPRequest.
Never UserId, ParseUrl, HttpServer.MixedCaps like everything else: MaxRetries, not
MAX_RETRIES — case already means "exported" in Go.DefaultPort, not
Port8080.len, cap, new, make,
close, copy, error, string, min, max.Get: u.Name(), and the setter is u.SetName().
Is/Has/Can stay on boolean predicates: IsActive().New when the package has one main type, NewThing
otherwise. A constructor that panics on bad input is MustThing.Read, Write,
Close, Flush, String, Error or ServeHTTP only if it has the
standard signature and meaning — and if it does, use that name
(String(), never ToString()).Users(), not
QueryAndBuildUserList().f: Errorf, Logf.i, n, err, ctx, buf inside a few
lines; retryTimeout, pendingOrders across a function; full words at
package level.userSlice → users, nameStr →
name), and don't repeat context the reader already has (order.ID
inside type Order, not order.OrderID).s *Server,
rw *responseWriter), the same on every method of the type — never
this or self._ prefix
(_defaultTimeout) to keep them distinct from locals — the Uber style
convention. Follow whichever the codebase already uses.isReady, hasChildren, canRetry.Request, FileHeader, RetryPolicy.-er: Reader, Notifier,
Validator. Never an I prefix or Interface suffix.orderStore in the service), not after the
implementation it happens to have.ErrNotFound, unexported errClosed.Error: NotFoundError, SyntaxError."order: invalid quantity". They get wrapped
into longer messages, so they must read mid-sentence.Unknown at zero: StatusUnknown, StatusActive, StatusClosed.TestParse, TestCache_Get, BenchmarkParse, ExampleCache_Get
(the example name must match a real identifier, or go vet complains)."empty input",
"expired token" — because go test -run 'TestParse/empty_input'
selects them.Rename with gopls, not search-and-replace: it follows the type graph and refuses renames that would break interface satisfaction (the go-semantic-tools skill). Then grep struct tags, templates and SQL for the old name — gopls does not see them. Exported names in a published library need a deprecation cycle (the go-refactoring skill).
util, common, helpers, models, types, misc or baseID, URL, HTTP); no ALL_CAPS constantsGet prefix on getters; Must only on panicking functionsString, Read, Close, …) have canonical signaturesthis/selfErr, error types end in Error, error strings are lowercaseUnknown zero valueWhat SKILL.md sets; muted values are Claude Code's defaults
/go-agent-skills:go-namingfrom go-agent-skills
npx claudepluginhub eduardo-sl/go-agent-skills --plugin go-agent-skills35 skills in this plugin
/git-commitStructured git commit messages following Conventional Commits format for Go projects. Generates well-scoped, atomic commits with clear descriptions. Use when committing changes, writing commit messages, preparing PRs, or reviewing commit history quality. Trigger examples: "commit these changes", "create commit", "commit message", "prepare PR", "squash commits". Not for: code review (go-code-review), changelog generation.
/go-api-designHTTP/REST API design for Go services: handlers, ServeMux routing, middleware, request validation, pagination, idempotency, health checks, error responses, and graceful shutdown. Use when designing APIs, writing HTTP handlers, implementing middleware, or structuring REST endpoints. Trigger examples: "design API", "REST endpoints", "HTTP handler", "middleware pattern", "graceful shutdown", "API versioning". Not for: gRPC services (go-grpc), spec-first OpenAPI work (go-openapi), general architecture (go-architecture-review), concurrency in handlers (go-concurrency-review).
/go-architecture-reviewReview Go project architecture: package structure, dependency direction, layering, separation of concerns, domain modeling, and module boundaries. Use when reviewing architecture, designing package layout, evaluating dependency graphs, or refactoring monoliths into modules. Trigger examples: "review architecture", "package structure", "project layout", "dependency direction", "clean architecture Go", "module boundaries". Not for: code-level style (go-coding-standards), endpoint design (go-api-design).
Other plugins' skills for the same job