
Description
golang-design-patterns is an agent skill from the samber cc-skills-golang collection that guides a coding agent to idiomatic Go design. It covers functional options, constructor APIs, avoiding init functions and global state, enums, the choice between panic and error, and resource management. Its persona is a Go architect who values simplicity and explicitness, and it applies patterns only when they solve a real problem, pushing back on premature abstraction. It has two modes. Design mode is for new APIs, packages or application structure, and it asks about the developer's architecture preference before proposing patterns, favouring the smallest pattern that meets the requirement. Review mode audits existing code for design problems, such as init abuse, unbounded resources, missing timeouts and implicit global state, and reports findings before suggesting refactors. For error handling details, the skill points to the golang-error-handling skill, for context propagation to golang-context, and for struct and interface design to golang-structs-interfaces, all in the same collection. It is listed on skills.sh, where the page shows install counts, GitHub stars and security audit results. Install it with npx skills add https://github.com/samber/cc-skills-golang --skill golang-design-patterns.…
Highlights
- Functional options and constructor APIs
- Avoiding init() and global state
- Panic versus error decisions
- Design and review modes
- Points to related Go skills
- Installs from skills.sh
Ratings & Reviews
No ratings yet
Be the first to rate golang-design-patterns.
People also visit

python-design-patterns
Fundamental design principles for writing maintainable, testable Python code
golang-design-patterns FAQ
What does this skill cover?
Idiomatic Go design: functional options, constructor APIs, avoiding init and global state, enums, panic versus error, and resource management.
What are the two modes?
Design mode for new APIs, packages and structure, which asks about your architecture preference first, and review mode for auditing existing code.
What does review mode look for?
init abuse, unbounded resources, missing timeouts and implicit global state. It reports findings before suggesting refactors.
Does it cover error handling?
Only at the design level. Detailed error handling is in the separate golang-error-handling skill in the same collection.
How do I install it?
Run npx skills add https://github.com/samber/cc-skills-golang --skill golang-design-patterns.
What are the security audit results?
skills.sh lists three audits: Gen Agent Trust Hub Pass, Socket Pass and Snyk Pass.
What are the best golang-design-patterns alternatives?
Popular alternatives to golang-design-patterns include python-design-patterns, golang-code-style and golang-error-handling. See all golang-design-patterns alternatives



