golang-code-style Skill (samber) for Claude Code: Go Style
Makes Claude write and review Go code with clear style rules linters do not catch, like early returns and short parameter lists.
- Installs
- 45.2K
- on skills.sh
- Stars
- 3.7K
- on GitHub
- Files
- 2
- besides SKILL.md
- Updated
- Nov 2026
- last repo commit
golang-code-style makes Claude follow Go style rules that need human judgment. Lines over about 120 characters get broken at meaningful points, calls with 4 or more arguments get one argument per line, and errors are handled first with an early return. It also asks for explicit slice and map initialisation, field names in composite literals, and functions of at most 4 parameters with context first.
It triggers on Go files. For a large codebase it can review in parallel with up to 5 sub-agents, one per style concern. Formatting is left to linters such as gofmt, gofumpt, goimports, gocritic and revive.
Good for
- Go developers who want Claude to match idiomatic style
- Reviewers checking Go pull requests for clarity
- Teams setting coding standards for a Go project
Install golang-code-style
Claude Code
- 1
Copy this prompt.
Install the golang-code-style skill in Claude Code. Run this command: /plugin marketplace add samber/cc /plugin install cc-skills-golang@samber Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
The README says these skills are built as atomic, cross-referencing units, and that installing only a subset gives a partial and potentially inconsistent view of the guidelines. It recommends installing all the general-purpose skills together, which the plugin does. Its manifest lists no hooks or MCP servers, and the repo holds 46 skills. Use the skills CLI line only if you want just this one. Pick one route, not both.
From the project README. Source.
What's in the skill
When it loads
Golang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt. Use when writing or reviewing Go code, asking about style or clarity, or establishing project coding standards. Not for naming conventions (→ See `samber/cc-skills-golang@golang-naming` skill), linter configuration (→ See `samber/cc-skills-golang@golang-lint` skill), or doc comments (→ See `samber/cc-skills-golang@golang-documentation` skill).
Sections in SKILL.md
- Line Length & Breaking
- Variable Declarations
- Slice & Map Initialization
- Composite Literals
- Control Flow
- Reduce Nesting
- Eliminate Unnecessary else
- Complex Conditions & Init Scope
- Switch Over If-Else Chains
- Function Design
- Prefer range for Iteration
- Value vs Pointer Arguments
- Code Organization Within Files
- String Handling
- Type Conversions
- Philosophy
Key facts
- Installs on skills.sh
- 45,168 (Nov 2, 2026)
- GitHub stars
- 3,749 (Nov 2, 2026)
- License
- MIT
- Last commit
- Nov 1, 2026
- Skill version
- 1.3.0
- Triggers on
- Go files (paths: **/*.go). Needs the go tool
- skills.sh checks
- Gen Agent Trust Hub pass, Socket pass, Snyk pass
What it includes
Break lines over ~120 chars; 4+ arguments get one per line
Break at meaning boundaries. If a signature is too long, cut the parameters (use an options struct) rather than rewrapping.
Read ·
Line length and breakingUse := for non-zero values, var for zero values; initialise slices and maps
Nil maps panic on write and nil slices encode to null in JSON. Composite literals must use field names.
Variable declarationsEarly returns, no needless else, named booleans, switch over if-else chains
When an if has 3 or more operands, extract named booleans. Scope variables to the if block when only the check needs them.
Control flowShort functions, at most 4 parameters, context first, range for loops
Beyond 4 parameters use an options struct. Pass small types by value and use pointers for mutation, large structs or meaningful nil.
Function designGroup related declarations, one primary type per file, unexport by default
Blank imports only in main and test packages. Dot imports never in library code.
Code organisationstrconv for simple conversions, strings.Builder in loops, %q in errors
Prefer generics over any when a concrete type will do.
Strings and conversionsA little copying beats a little dependency; avoid reflect; do not abstract early
Use the slices and maps packages, and github.com/samber/lo for filter, group-by and chunk.
PhilosophyUp to 5 sub-agents, each on one style concern, for large codebases
Concerns include control flow, function design, variable declarations, string handling and code organisation. On Claude Code, `ultracode` opts into multi-agent runs.
Read ·
Parallel style reviewgofmt, gofumpt, goimports, gocritic, revive, wsl_v5 enforce the rest
Points to the golang-lint skill for configuration.
Linter pointers
From the official docs
Permissions
Low risk
Claude can edit and write your Go files and run go, golangci-lint and git commands. Review the diff before you commit.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It can edit files and run go and git
The header lists Edit, Write and Bash for go, golangci-lint and git. Review changes before committing. github.com
It can start sub-agents on big reviews
For large codebases it fans out up to 5 sub-agents. That uses more of your usage allowance. github.com
Security advisories
No published security advisories as of Nov 2, 2026.
Technical details
| Turning on read-only | Review mode looks at a diff, but the skill's tool list includes Edit and Write. |
|---|---|
| Scopes |
|
Questions
How do I install golang-code-style?
Use the install box above. The plugin route installs the whole Go skill set, and the skills CLI route installs only this skill. Pick one so you do not get every skill twice.
What does golang-code-style do?
It makes Claude apply Go style rules that need judgment, such as when to break a line, how to declare variables and how to keep the happy path flat. SKILL.md says linters handle formatting and this skill handles clarity.
Does it need other skills?
It works on its own, but SKILL.md points to 8 other skills in the same repo: golang-continuous-integration, golang-design-patterns, golang-documentation, golang-gopls, golang-lint, golang-naming, golang-refactoring, golang-structs-interfaces. The README says installing only a subset gives a partial and potentially inconsistent view, so install the set together.
Does it work in the Claude app, Codex or Cursor?
The SKILL.md header says it is designed for Claude Code, Codex or a similar harness, and the README says the set is built for Claude Code, Codex, Gemini, Copilot, Antigravity and Cursor, with an install section for each. The README does not describe a Claude app install.
Does it need an API key?
SKILL.md names no key. It needs the go tool on your PATH. The skill folder holds SKILL.md, reference guides and an evals file, with no scripts.
Is it safe to use?
It bundles no scripts. Its header lets Claude edit and write files and run go, golangci-lint and git commands, so Claude can change your Go files and run those tools in your project. Read the diff before you commit.
golang-code-style vs golang-naming and golang-lint?
golang-code-style covers layout, declarations and control flow. SKILL.md says to use golang-naming for naming conventions, golang-lint for linter configuration and golang-documentation for doc comments.
Information
updated Nov 2, 2026
- Repository
- samber/cc-skills-golang
- Folder
skills/golang-code-style
Sources
Docs, issue trackers and discussions this page is built from.
Show all 6Hide
- cc-skills-golang · github.com
- cc-skills-golang README · github.com
- plugin.json · github.com
- skills CLI commands · github.com
- README.md#-how-to-use · github.com
- golang-code-style SKILL.md · github.com