samber avatar

Golang Code Style

Enforces Go code style decisions that linters miss: semantic line breaking at 4+ arguments, early returns to reduce nesting, default-then-override instead of else-if chains, and named booleans for complex conditions. Built by samber to work alongside the naming and design patterns skills in the same collection. The line breaking rules are strict (one argument per line even when prompts ask for single-line code), which feels heavy-handed until you're reviewing diffs on a team. Focuses on readability over cleverness, with practical guidance on when to use var versus :=, how to handle nil slices in JSON responses, and why blank imports belong in main packages only. Includes parallelization hints for reviewing large codebases.

install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
27
skills.sh installs
46.1K
GitHub stars
3.8K
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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:

Sponsors

Details

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

More from samber/cc-skills-golang

All 47
1samber avatargolang-databasesamber/cc-skills-golangComprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connec42.5Kskills.sh installs
2samber avatargolang-stretchr-testifysamber/cc-skills-golangComprehensive guide to stretchr/testify for Golang testing. Covers assert, require, mock, and suite packages in depth. Use when writing tests with testify, crea40.9Kskills.sh installs
3samber avatargolang-swaggersamber/cc-skills-golangGolang OpenAPI/Swagger documentation with swaggo/swag — annotation comments (@Summary, @Param, @Success, @Router, @Security), swag init code generation, framewo38.6Kskills.sh installs
4firebase avatarfirebase-firestore-standardfirebase/agent-skillsComprehensive guide for Firestore Standard Edition, including provisioning, security rules, and SDK usage. Use this skill when the user needs help setting up Fi37Kskills.sh installs
5firebase avatarfirebase-firestore-enterprise-native-modefirebase/agent-skillsComprehensive guide for Firestore enterprise native including provisioning, data model, security rules, and SDK usage. Use this skill when the user needs help s36Kskills.sh installs
6firecrawl avatarfirecrawl-monitorfirecrawl/cliDetect when content on a website changes and get notified by webhook or email — no cron jobs, scrapers, or diff scripts required. Use this skill whenever the us33.7Kskills.sh installs