PlugWiki

golang-design-patterns Skill (samber): Idiomatic Go Patterns

Makes Claude choose idiomatic Go patterns, like functional options, graceful shutdown and the right architecture, and skip needless abstraction.

Installs
43K
on skills.sh
Stars
3.7K
on GitHub
Files
7
besides SKILL.md
Updated
Nov 2026
last repo commit

golang-design-patterns makes Claude act as a Go architect who applies a pattern only when it solves a real problem. It prefers functional options for constructors, avoids init() and mutable globals, starts enums at 1, adds a timeout to every external call and compiles regexps once.

It has a design mode, which asks you which architecture you prefer before proposing patterns, and a review mode that reports findings before suggesting refactors. Six reference guides cover clean architecture, hexagonal, DDD, data handling and resource management.

Good for

  • Go developers designing a new package or API
  • Teams choosing between clean, hexagonal, DDD or a flat layout
  • Reviewers looking for init() abuse, missing timeouts and unbounded resources

Install golang-design-patterns

Claude Code

  1. 1

    Copy this prompt.

    Install the golang-design-patterns 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

Idiomatic Golang design patterns — functional options, constructor APIs, `init()` and global-state avoidance, enums, panic vs error decisions, resource management and lifecycle, graceful shutdown, timeouts and retries, streaming and iterators, and architecture styles (clean, hexagonal, DDD, flat). Apply when choosing between architectural patterns, implementing functional options, designing constructor APIs, setting up graceful shutdown, applying resilience patterns, or asking which idiomatic Go pattern fits a specific problem. Not for wiring a DI container or comparing DI libraries (→ See `samber/cc-skills-golang@golang-dependency-injection` skill), nor for error wrapping, `errors.Is`/`As`, or logging mechanics (→ See `samber/cc-skills-golang@golang-error-handling` skill).

Sections in SKILL.md

  1. Best Practices Summary
  2. Constructor Patterns: Functional Options vs Builder
  3. Functional Options (Preferred)
  4. Constructors & Initialization
  5. Avoid init() and Mutable Globals
  6. Enums: Start at 1
  7. Compile Regexp Once
  8. Use //go:embed for Static Assets
  9. Compile-Time Interface Checks
  10. Error Flow Patterns
  11. When to Panic vs Return Error
  12. Data Handling
  13. string vs []byte vs []rune
  14. Iterators & Streaming for Large Data
  15. Resource Management
  16. Resilience & Limits

Key facts

Installs on skills.sh
42,997 (Nov 2, 2026)
License
MIT
Last commit
Nov 1, 2026
Skill version
1.2.1

What it includes

  • Asks your architecture preference, then proposes the smallest pattern that fits

    Choices include clean architecture, hexagonal, DDD or a flat layout. It does not impose a complex architecture on a small project.

    Design mode

  • Scans for init() abuse, unbounded resources, missing timeouts, hidden globals

    It reports findings before it suggests refactors.

    Read · Review mode

  • Functional options, no init(), enums from 1, timeouts, limits, crypto/rand

    Also: defer Close right after open, runtime.AddCleanup over finalizers, compile regexp once, compile-time interface checks.

    21 best practices

  • Timeout every external call; retries must check context cancellation

    Limit pool sizes, queue depths and buffers so nothing grows unbounded.

    Resilience and limits

  • string vs []byte vs []rune, iterators and streaming large transfers

    Reference file references/data-handling.md.

    Read · Data handling guide

  • Graceful shutdown, resource pools, runtime.AddCleanup

    Reference file references/resource-management.md.

    Read · Resource management guide

  • Architecture overview, clean architecture, hexagonal and domain-driven design

    Four reference files: architecture, clean-architecture, hexagonal-architecture and ddd.

    Read · Architecture guides

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

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-design-patterns?

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.

Which architecture will it pick for me?

None until you say. SKILL.md tells Claude to ask which architecture you prefer: clean, hexagonal, DDD or flat. It also says not to impose a complex architecture on a small project.

Does it need other skills?

It works on its own, but SKILL.md points to 11 other skills in the same repo: golang-code-style, golang-concurrency, golang-context, golang-data-structures, golang-database, golang-dependency-injection, golang-error-handling, golang-project-layout, golang-refactoring, golang-security, 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, ask you questions 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-design-patterns vs golang-dependency-injection?

SKILL.md says this skill is not for wiring a DI container or comparing DI libraries. That is the golang-dependency-injection skill. Error wrapping and logging belong to golang-error-handling.

Information

updated Nov 2, 2026

Folder
skills/golang-design-patterns

samber/cc-skills-golangskills.sh

Sources

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

Show all 9
  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-design-patterns SKILL.md · github.com
  7. data-handling.md · github.com
  8. resource-management.md · github.com
  9. architecture.md · github.com

Updated Nov 2, 2026.