golang-naming

Enforce Go naming conventions for identifiers, errors, and tests.

1|Updated May 26, 2026
One-click install
npx skills add https://github.com/tokiou/caba-inseguridad-v2-be --skill golang-naming-tokiou
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-naming
Source: https://github.com/tokiou/caba-inseguridad-v2-be/tree/main/.claude/skills/golang-naming
Command: npx skills add https://github.com/tokiou/caba-inseguridad-v2-be --skill golang-naming-tokiou

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Go naming mistakes hurt readability and make code harder to search, review, and maintain, especially when acronyms, boolean predicates, constructors, errors, and test names don’t follow Go’s conventions.

Core Features & Use Cases

  • Consistent Go naming across codebases: Ensures identifiers use MixedCaps, avoid underscores, and follow package/type/function conventions.
  • Correct patterns for tricky cases: Covers New vs NewTypeName, Is/Has/Can for boolean predicates, acronym casing (URL/HTTP/ID), error string lowercase rules, and sentinel error naming with the Err prefix.
  • Test and API naming guidance: Handles table-driven subtest naming (fully lowercase, including acronyms), WithContext variants, In in-place mutations, and Must panic-on-error prefixes.
  • Use during review/refactor: Best for new Go code, refactoring naming collisions, or deciding between naming alternatives (e.g., isConnected vs connected, ErrNotFound vs NotFoundError).

Quick Start

Use the skill when you need to choose or verify Go naming decisions; for example, ask an AI to review a proposed identifier set for MixedCaps compliance, acronym casing, and whether boolean/error/test naming follows Go idioms.

Frequently Asked Questions about golang-naming

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

FAQPage Schema
What are the Go naming conventions for acronyms and MixedCaps?

Go naming conventions require identifiers to use MixedCaps without underscores and follow specific acronym casing rules. Acronyms like URL, HTTP, and ID should maintain consistent capitalization, such as URL or HTTP, depending on their position within the identifier.

How do I name boolean predicates and errors in Go?

Boolean predicates in Go should use Is, Has, or Can prefixes, while error strings must be lowercase without capitalization or punctuation. Sentinel errors should use the Err prefix, such as ErrNotFound, to distinguish them from standard error types.

What is the best way to name constructors and context variants in Go?

Canonical Go constructors should use the New prefix, or NewTypeName if disambiguation is needed. For context variants, append WithContext, use In for in-place mutations, and Must for functions that panic on error.

How should table-driven subtests be named in Go?

Table-driven subtests in Go should be named using fully lowercase strings, including acronyms. This ensures test names remain consistent, readable, and compliant with Go idioms during code generation and execution.

Should I use isConnected or connected for a Go boolean variable?

Go idiomatically prefers boolean predicates with prefixes like Is, Has, or Can. Therefore, isConnected is the correct and idiomatic choice over connected, ensuring the identifier clearly communicates its boolean nature during code reviews.

When do I need to verify Go identifier naming decisions?

You need to verify Go naming decisions when writing new code, refactoring naming collisions, or reviewing identifiers for MixedCaps compliance. This ensures package, type, function, and test names remain readable, consistent, and idiomatic.