golang-naming

Enforce Go naming conventions and propose safe renames via gopls.

Updated Aug 9, 2022
One-click install
npx skills add https://github.com/BizShuk/gosdk --skill golang-naming-bizshuk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-naming
Source: https://github.com/BizShuk/gosdk/tree/main/skills/golang-naming
Command: npx skills add https://github.com/BizShuk/gosdk --skill golang-naming-bizshuk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Inconsistent Go naming conventions reduce code readability, introduce stutter between package and symbol names, and create technical debt that slows team collaboration and code maintenance.

Core Features & Use Cases

  • Comprehensive rule enforcement: Covers 13 symbol-level naming rules (acronym casing, no stutter, short receivers, verb-first functions, etc.) and 8 package-level naming rules (no grab-bag packages, no stutter, correct casing) aligned with Effective Go and Google Go Style Guide.
  • Safe two-phase workflow: First generates a full report of all violations, only applies renames after explicit per-batch user approval, defaulting to dry-run to prevent unintended changes.
  • Accurate rename execution: Uses gopls as the sole renaming mechanism to respect Go scope, cross-package references, and interface satisfaction, avoiding broken textual replacements that break builds.
  • Automatic exclusion of unsafe code: Skips generated files, vendored code, mocks, and external dependencies to avoid modifying code that should not be changed.
  • Use case: Go development teams can use this skill to quickly audit large codebases for naming inconsistencies, safely refactor symbol and package names, and enforce team-wide naming standards without risking broken imports or interface mismatches.

Quick Start

Use the golang-naming skill to review all naming conventions in the current Go module and propose safe renames for any violations.

Frequently Asked Questions about golang-naming

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

FAQPage Schema
How do I enforce Go naming conventions across a large codebase?

To enforce Go naming conventions across a large codebase, you can scan the workspace for violations of acronym casing, package stutter, and receiver naming, generating a report before applying any changes.

What is the best way to safely rename Go symbols without breaking cross-package references?

Safely renaming Go symbols without breaking cross-package references requires using gopls as the renaming mechanism to respect Go scope, cross-package imports, and interface satisfaction, avoiding broken textual replacements.

How do I check if my Go packages violate naming idioms like stutter or grab-bag naming?

To check if your Go packages violate naming idioms, scan the module against 8 package-level rules including no grab-bag packages, no stutter, and correct casing aligned with the Google Go Style Guide.

Do I need gopls to refactor Go code and fix receiver naming violations?

Yes, you need gopls installed to perform scope-aware renames that fix receiver naming violations, as it ensures cross-package references and interface satisfaction are preserved without breaking builds.

Will a Go naming convention tool modify my generated and vendored code?

A Go naming convention tool should automatically exclude generated files, vendored code, mocks, and external dependencies to avoid modifying code that should not be changed during the refactoring process.

Can I review Go naming violations before applying symbol renames to my module?

Yes, you can review Go naming violations before applying symbol renames by using a two-phase workflow that generates a full report of all violations first, only applying renames after explicit per-batch user approval.