Tooluck logoTooluck
SKILL.md

golang-naming

Agent skill fromsamber/cc-skills-golang

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 asking about Go naming best practices. Also trigger when the user mentions MixedCaps vs snake_case, ALL_CAPS constants, Get-prefix on getters, or error string casing. Do NOT use for general Go implementation questions that don't involve naming decisions.

How to install golang-naming

install golang-naming
# install the cc-skills-golang pack with the skills CLI
npx skills add samber/cc-skills-golang

# or add only this skill to Claude Code: copy the folder

skills/golang-naming/

# into

~/.claude/skills/golang-naming/ (all projects)

.claude/skills/golang-naming/ (one project)

skills/golang-naming/SKILL.md

MITFull file
1> **Community default.** A company skill that explicitly supersedes `samber/cc-skills-golang@golang-naming` skill takes precedence.
2
3# Go Naming Conventions
4
5Go favors short, readable names. Capitalization controls visibility — uppercase is exported, lowercase is unexported. All identifiers MUST use MixedCaps, NEVER underscores.
6
7> "Clear is better than clever." — Go Proverbs
8>
9> "Design the architecture, name the components, document the details." — Go Proverbs
10
11To ignore a rule, just add a comment to the code.
12
13## Quick Reference
14
15| Element | Convention | Example |
16| --- | --- | --- |
17| Package | lowercase, single word, \_test suffix OK for test files | `json`, `http`, `tabwriter`, `http_test` |
18| File | lowercase, underscores OK | `user_handler.go` |
19| Exported name | UpperCamelCase | `ReadAll`, `HTTPClient` |
20| Unexported | lowerCamelCase | `parseToken`, `userCount` |
21| Interface | method name + `-er` | `Reader`, `Closer`, `Stringer` |
22| Struct | MixedCaps noun | `Request`, `FileHeader` |
23| Constant | MixedCaps (not ALL_CAPS) | `MaxRetries`, `defaultTimeout` |
24| Receiver | 1-2 letter abbreviation | `func (s *Server)`, `func (b *Buffer)` |
25| Error variable | `Err` prefix | `ErrNotFound`, `ErrTimeout` |
26| Error type | `Error` suffix | `PathError`, `SyntaxError` |
27| Constructor | `New` (single type) or `NewTypeName` (multi-type) | `ring.New`, `http.NewRequest` |
28| Boolean field | `is`, `has`, `can` prefix on **fields** and methods | `isReady`, `IsConnected()` |
29…

Excerpt shown under the repository's MIT license.

More skills in cc-skills-golang

Keep exploring

Similar skill repositories

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates