Skip to content
samber avatar

Golang Code Style

Clear, opinionated Go style rules for line breaking, variable declarations, and control flow that linters cannot judge.

CCM score
69 of 100
install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
9
skills.sh installs
47.9K
GitHub stars
4K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers line length and breaking, variable declarations, slice and map initialization, and composite literals
  • Includes control-flow guidance: early returns, eliminating else, named boolean conditions, and switch over if-else chains
  • Enforces explicit slice and map initialization and field names in composite literals, since nil maps panic and positional fields break
  • Designed for reviewing Go code or setting project standards; naming, lint config, and doc comments are covered by sibling skills

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-code-style -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Orchestration mode: Fan out the sub-agents described in the "Parallelizing Code Style Reviews" section, each covering an independent style concern, when reviewing code style across a large codebase, and merge their findings. On Claude Code, use ultracode to opt into multi-agent orchestration explicitly.

Community default. A company skill that explicitly supersedes samber/cc-skills-golang@golang-code-style skill takes precedence.

Go Code Style

Style rules that require human judgment — linters handle formatting, this skill handles clarity. For naming see samber/cc-skills-golang@golang-naming skill; for design patterns see samber/cc-skills-golang@golang-design-patterns skill; for struct/interface design see samber/cc-skills-golang@golang-structs-interfaces skill.

"Clear is better than clever." — Go Proverbs

When ignoring a rule, add a comment to the code.

Line Length & Breaking

No rigid line limit, but lines beyond ~120 characters MUST be broken. Break at semantic boundaries, not arbitrary column counts. Function calls with 4+ arguments MUST use one argument per line — even when the prompt asks for single-line code:

Details

Repository
github.com/samber/cc-skills-golang
Categories
Go, Code Review & Quality
First seen
Apr 16, 2026

Questions

What does the golang-code-style skill cover?

The golang-code-style skill covers Go style conventions that need human judgment, such as line length and breaking, variable declarations, control flow clarity, and when comments help or hurt. It is meant for writing or reviewing Go code and for setting project coding standards.

How do I install the golang-code-style skill?

Run npx -y skills add samber/cc-skills-golang --skill golang-code-style -y in your project. Once installed, the agent can apply these Go style rules when writing or reviewing code.

Is golang-code-style the best Go skill for code style?

It ranks first in the Go category on Claude Marketplaces, ahead of skills such as golang-testing, golang-error-handling, golang-design-patterns, golang-concurrency and golang-performance. It sets itself apart by focusing on clarity rules that linters cannot check, while naming, linter setup and doc comments are handled by separate skills.

More from samber/cc-skills-golang

All 47

Similar to Golang Code Style

More Go