What problem does it solve?
This skill ensures Go code follows idiomatic style and maintainability conventions to prevent Java-flavored or brittle Go, reduce bugs caused by poor naming, import misuse, and incorrect struct initialization, and to keep codebases consistent.
Core Features & Use Cases
- Import Ordering & Grouping: Enforces standard, external, and internal import grouping and forbids dot imports and unnecessary aliases.
- Naming & Declarations: Validates package, function, variable, and interface naming conventions and appropriate use of short names versus descriptive identifiers.
- Struct Initialization & Nesting: Requires field-name struct initialization, promotes early returns to reduce nesting, and recommends clear function ordering and receiver placement.
- Verification Checklist: Aligns code with goimports, go vet, and golangci-lint expectations and enforces enum, time, and defer best practices.
- Use Case: Run during code review or as an agent helper to automatically flag style regressions in PRs and to suggest idiomatic fixes for authored code.
Quick Start
Ask the go-coding-standards skill to review a Go file or pull request for style, import ordering, naming, struct initialization, and linting issues.