What problem does it solve?
This Skill helps you choose idiomatic Go design patterns for production code so you avoid common pitfalls in constructors, error handling, resource lifecycle, graceful shutdown, resilience, dependency wiring, and streaming.
Core Features & Use Cases
- Functional options over builders: design evolving constructor APIs with validation and explicit defaults.
- Error flow and early returns: keep happy paths flat and handle failures first to improve clarity and reliability.
- Resource management and lifecycle: use correct cleanup patterns such as defer placement and runtime.AddCleanup, plus bounded resource limits and timeouts.
- Graceful shutdown and resilience: implement timeouts, retries with context cancellation checks, and safe shutdown sequencing.
- Architecture guidance: right-size architecture choices and apply dependency direction principles, including clean/hexagonal/DDD when appropriate.
Quick Start
Ask the agent to recommend the smallest idiomatic Go pattern that fits your specific scenario and constraints, for example: "Given this Go service skeleton and these requirements (timeouts, retries, constructor configuration growth, and shutdown behavior), which idiomatic patterns should I use and how should the package structure look?"