
Go Naming
Install this when you are naming Go packages, exported APIs, or identifiers and want idiomatic Google/Uber-style names instead of util/helper or SCREAMING_SNAKE_CASE drift.
Install
npx skills add https://github.com/cxuu/golang-skills --skill go-namingWhat is this skill?
- Decision flow for packages, interfaces (-er), receivers, constants (iota), exported funcs, and variables
- Bundled check-naming.sh scans SCREAMING_SNAKE_CASE, Get-prefixed getters, util/helper/common packages, and this/self rec
- Core principle: short names, no repeated concepts, context-aware—not repetitive when read at call sites
- Explicit scope: naming only; package layout belongs in go-packages
- Sources anchored to Google and Uber Go style guides
Adoption & trust: 684 installs on skills.sh; 110 GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Journey fit
Naming decisions happen while you are actively shaping Go modules, types, and public APIs during implementation. Backend Go services and CLIs are where package boundaries, receivers, and exported symbols need consistent MixedCaps and short package nouns.
Common Questions / FAQ
Is Go Naming safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Go Naming
# Go Naming Conventions ## Available Scripts - **`scripts/check-naming.sh`** — Scans Go code for naming anti-patterns: SCREAMING_SNAKE_CASE constants, Get-prefixed getters, bad package names (util/helper/common), and receivers named "this"/"self". Run `bash scripts/check-naming.sh --help` for options. ## Core Principle Names should: - Not feel repetitive when used - Take context into consideration - Not repeat concepts that are already clear Naming is more art than science—Go names tend to be shorter than in other languages. --- ## Naming Decision Flow ``` What are you naming? ├─ Package → Short, lowercase, singular noun (no underscores, no mixedCaps) ├─ Interface → Method name + "-er" suffix when single-method (Reader, Writer) ├─ Receiver → 1-2 letter abbreviation of type (c for Client); consistent across methods ├─ Constant → MixedCaps; use iota for enums; no ALL_CAPS ├─ Exported func → Verb or verb-phrase in MixedCaps; no Get prefix for getters ├─ Variable → Length proportional to scope distance │ ├─ Tiny scope (1-7 lines) → single letter (i, n, r) │ ├─ Medium scope → short word (count, buf) │ └─ Package-level / wide → descriptive (userAccountCount) └─ Any name → Check: does it repeat package name or context? If yes, shorten it ``` --- ## MixedCaps (Required) > **Normative**: All Go identifiers must use MixedCaps. Underscores are allowed only in: test functions (`TestFoo_InvalidInput`), generated code, and OS/cgo interop. --- ## Package Names > **Normative**: Packages must be lowercase with no underscores. Short, lowercase, singular nouns. Avoid generic names like `util`, `common`, `helper` — prefer specific names: `stringutil`, `httpauth`, `configloader`. ```go // Good: user, oauth2, tabwriter // Bad: user_service, UserService, count (shadows var) ``` > Read [references/IDENTIFIERS.md](references/IDENTIFIERS.md) when naming packages, deciding on import aliases, or choosing between generic and specific package names. --- ## Interface Names > **Advisory**: One-method interfaces use "-er" suffix. Name one-method interfaces by the method plus `-er`: `Reader`, `Writer`, `Formatter`. Honor canonical method names (`Read`, `Write`, `Close`, `String`) and their signatures. > Read [references/IDENTIFIERS.md](references/IDENTIFIERS.md) when defining new interfaces or implementing well-known method signatures. --- ## Receiver Names > **Normative**: Receivers must be short abbreviations, used consistently. One or two letters abbreviating the type, consistent across all methods: `func (c *Client) Connect()`, `func (c *Client) Send()`. Never use `this` or `self`. > Read [references/IDENTIFIERS.md](references/IDENTIFIERS.md) when choosing receiver names or ensuring consistency across methods. --- ## Constant Names > **Normative**: Constants use MixedCaps, never ALL_CAPS or K prefix. Name constants by role, not value: `MaxRetries` not `Three`, `DefaultPort` not `Port8080`. ```go const MaxPacketSize = 512 const defaultTimeout = 30 * time.Second ``` > Read [references/IDENTIFIERS.md](references/IDENTIFIERS.md) when naming constants or choosing between role-based and value-based names. --- ## Initialisms and Acronyms > **Normative**: Initialisms maintain consistent case throughout. Initialisms (URL, ID, HTTP, API) must be all uppercase or all lowercase: `HTTPClient`, `userID`, `ParseURL()` — not `HttpClient`, `orderId`, `ParseUrl()`. > Read [re