golang-naming

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

1|Updated May 27, 2026
One-click install
npx skills add https://github.com/dmwin72015/netdisk --skill golang-naming-dmwin72015
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-naming
Source: https://github.com/dmwin72015/netdisk/tree/main/.agents/skills/golang-naming
Command: npx skills add https://github.com/dmwin72015/netdisk --skill golang-naming-dmwin72015

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Go codebases degrade when naming drifts, making it harder to navigate, review, and refactor; this skill enforces consistent, idiomatic identifier and API naming so code remains readable and tool-friendly.

Core Features & Use Cases

  • Go naming conventions for packages, files, exported vs unexported identifiers, and MixedCaps rules (no underscores).
  • API naming patterns for constructors (New vs NewTypeName), boolean predicates (Is/Has/Can), getters (no Get prefix), and functional options (With*).
  • Error and test naming discipline including lowercase error strings with lowercase acronyms, Err* sentinel conventions, and fully lowercase subtest names.

Quick Start

Ask an AI agent: "Refactor this Go API draft to follow golang-naming conventions for acronyms, constructors, boolean predicates, error strings, and test subcase names."

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 constructors and functional options?

Go naming conventions for constructors use the New prefix, while functional options use the With* suffix, such as WithContext. These standard API patterns prevent readability issues and ensure your codebase remains tool-friendly and easy to navigate.

How do I name errors and test subcases in Go code reviews?

To name errors and test subcases in Go code reviews, enforce lowercase error strings and lowercase subtest names. Use the Err* prefix for sentinel errors and the Error suffix for custom error types to maintain consistency.

Should Go getters use a Get prefix in idiomatic API design?

Idiomatic Go API design does not use the Get prefix for getters. Instead, name boolean predicates with Is, Has, or Can prefixes, and rely on MixedCaps identifiers without underscores to prevent tooling issues.

When do I need to apply MixedCaps rules for Go package and file naming?

You need to apply MixedCaps rules for Go package and file naming whenever writing new code or refactoring existing packages. This prevents inconsistent identifiers and ensures exported versus unexported identifiers are immediately recognizable.

How do I handle acronyms in Go identifier names like API or ID?

To handle acronyms in Go identifier names, enforce consistent capitalization rules for acronyms within MixedCaps identifiers. Treating acronyms consistently prevents naming drift and keeps code readable during pull requests.

What is the best way to standardize Go naming across a large codebase?

The best way to standardize Go naming across a large codebase is to enforce consistent constructor suffixes, boolean predicates, and error conventions. Applying these rules during refactoring prevents readability degradation and tooling issues.