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
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
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
- Best Practices Summary
- Constructor Patterns: Functional Options vs Builder
- Functional Options (Preferred)
- Constructors & Initialization
- Avoid init() and Mutable Globals
- Enums: Start at 1
- Compile Regexp Once
- Use //go:embed for Static Assets
- Compile-Time Interface Checks
- Error Flow Patterns
- When to Panic vs Return Error
- Data Handling
- string vs []byte vs []rune
- Iterators & Streaming for Large Data
- Resource Management
- Resilience & Limits
Key facts
- Installs on skills.sh
- 42,997 (Nov 2, 2026)
- GitHub stars
- 3,749 (Nov 2, 2026)
- License
- MIT
- Last commit
- Nov 1, 2026
- Skill version
- 1.2.1
- 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
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 modeScans for init() abuse, unbounded resources, missing timeouts, hidden globals
It reports findings before it suggests refactors.
Read ·
Review modeFunctional 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 practicesTimeout every external call; retries must check context cancellation
Limit pool sizes, queue depths and buffers so nothing grows unbounded.
Resilience and limitsstring vs []byte vs []rune, iterators and streaming large transfers
Reference file references/data-handling.md.
Read ·
Data handling guideGraceful shutdown, resource pools, runtime.AddCleanup
Reference file references/resource-management.md.
Read ·
Resource management guideArchitecture 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-only | Review mode looks at a diff, but the skill's tool list includes Edit and Write. |
|---|---|
| Scopes |
|
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
- Repository
- samber/cc-skills-golang
- Folder
skills/golang-design-patterns
Sources
Docs, issue trackers and discussions this page is built from.
Show all 9Hide
- 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-design-patterns SKILL.md · github.com
- data-handling.md · github.com
- resource-management.md · github.com
- architecture.md · github.com