What problem does it solve?
This Skill helps you design clean, maintainable Go types by choosing the right balance between structs and interfaces. It reduces coupling, avoids premature abstraction, and prevents common mistakes that make Go code harder to test, evolve, or reason about.
Core Features & Use Cases
- Interface placement: Define interfaces where they are consumed, not where they are implemented.
- Constructor design: Prefer accepting interfaces while returning concrete structs for clarity and flexibility.
- Type safety patterns: Use safe type assertions, optional capability checks, and compile-time interface verification.
- Struct design: Improve zero-value usability, choose pointer versus value receivers consistently, and use embedding intentionally.
- Practical Go patterns: Apply no-copy sentinels, field tags, and generics instead of empty interface types when possible.
- Use case: Review a service layer, then rewrite its contracts so dependencies are testable, APIs stay concrete, and runtime panics are avoided.
Quick Start
Use this skill to review a Go package and rewrite its structs, interfaces, constructors, and receiver choices according to the listed design rules.