Back to Skills

golang-naming

Go (Golang) naming conventions — covers packages, constructors, structs, interfaces, constants, enums, errors, booleans, receivers, getters/setters, functional options, acronyms, test functions, and subtest names. Use this skill when writing new Go code, reviewing or refactoring, choosing between naming alternatives (New vs NewTypeName, isConnected vs connected, ErrNotFound vs NotFoundError, StatusReady vs StatusUnknown at iota 0), debating Go package names (utils/helpers anti-patterns), or aski

1,747stars112forksUpdated 5/20/2026

Security Assessment

Safe(100/100)
Security Score100/100

About golang-naming

The golang-naming skill provides guidance and enforcement of Go (Golang) naming conventions, helping developers write clean, idiomatic, and readable Go code. It focuses on naming patterns for packages, constructors, structs, interfaces, constants, enums, errors, booleans, receivers, getters/setters, functional options, acronyms, test functions, and subtest names. By offering clear rules and examples, this skill reduces ambiguity when choosing between alternative names and ensures consistency across projects, which is critical for maintainability and collaboration in Go codebases.

The skill offers comprehensive features for naming decisions, including capitalization rules for exported versus unexported identifiers, MixedCaps usage, error variable and type naming, constructor patterns, and boolean field prefixes. It also covers idiomatic patterns for test functions, table-driven test fields, and variant naming (e.g., context-specific or in-place functions). Additionally, it provides guidance on enum zero-values, option function naming, import aliases, and proper casing of error strings. These conventions are designed to align with Go's best practices, supporting developers in writing code that is both readable and compatible with standard tooling.

This skill is intended for Go developers involved in writing new code, performing code reviews, refactoring, or debating naming choices. It is particularly useful for teams aiming to standardize codebases, enforce consistent naming practices, or train new developers in idiomatic Go patterns. Target users include software engineers, code reviewers, and AI coding assistants that interact with Go projects, ensuring that naming decisions follow recognized conventions and improve overall code clarity.

FAQ

Can I use this skill with any Go project?

Yes, the golang-naming skill is compatible with projects using Golang and is designed to work with AI coding agents like Claude Code.

Does this skill enforce rules automatically?

The skill provides guidance and best practices for naming conventions, but enforcement depends on the tools and processes used; it can be used interactively by AI agents or developers during code writing and review.

Are there exceptions to the MixedCaps rule?

Yes, underscores are allowed in test function subcases, generated code, and OS/cgo interop. Otherwise, all Go identifiers must use MixedCaps.

Do I need any specific tools to use this skill?

The skill requires the Go binary to be installed. It can also leverage tools like golangci-lint or git via allowed tool integrations.

Should I use this skill for general Go implementation questions?

No, this skill is specifically for naming decisions and best practices. General Go coding questions unrelated to naming are outside its scope.

All Files

7 files
references/testing.md1.2 KB
View
references/types-errors.md4.1 KB
View
SKILL.md11.5 KB
View
references/functions-methods.md3.9 KB
View
evals/evals.json27.9 KB
View
references/identifiers.md5.1 KB
View
references/packages-files.md2.9 KB
View

Install golang-naming

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill