PlugWiki

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. 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. 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

  1. Line Length & Breaking
  2. Variable Declarations
  3. Slice & Map Initialization
  4. Composite Literals
  5. Control Flow
  6. Reduce Nesting
  7. Eliminate Unnecessary else
  8. Complex Conditions & Init Scope
  9. Switch Over If-Else Chains
  10. Function Design
  11. Prefer range for Iteration
  12. Value vs Pointer Arguments
  13. Code Organization Within Files
  14. String Handling
  15. Type Conversions
  16. Philosophy

Key facts

Installs on skills.sh
45,168 (Nov 2, 2026)
License
MIT
Last commit
Nov 1, 2026
Skill version
1.3.0

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 breaking

  • Use := 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 declarations

  • Early 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 flow

  • Short 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 design

  • Group 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 organisation

  • strconv for simple conversions, strings.Builder in loops, %q in errors

    Prefer generics over any when a concrete type will do.

    Strings and conversions

  • A 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.

    Philosophy

  • Up 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 review

  • gofmt, 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-onlyReview mode looks at a diff, but the skill's tool list includes Edit and Write.
Scopes
  • The SKILL.md header lists these tools: Read, Edit, Write, Glob, Grep, go, golangci-lint, git and sub-agents

  • Edits Go files in your project

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

Folder
skills/golang-code-style

samber/cc-skills-golangskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 6
  1. cc-skills-golang · github.com
  2. cc-skills-golang README · github.com
  3. plugin.json · github.com
  4. skills CLI commands · github.com
  5. README.md#-how-to-use · github.com
  6. golang-code-style SKILL.md · github.com

Updated Nov 2, 2026.