
Description
golang-structs-interfaces is an agent skill from the samber cc-skills-golang collection for designing structs and interfaces in Go. It covers composition, embedding, type assertions, type switches, interface segregation and dependency injection through interfaces. Its persona is a Go type system designer who favours small, composable interfaces and concrete return types, and who designs for testability and clarity rather than for abstraction's sake. Its main rule is that interfaces should have one to three methods, because small interfaces are easier to implement, mock and compose. The skill quotes the Go proverb that the bigger the interface, the weaker the abstraction, and says that when a larger contract is needed it should be built from small interfaces. It refers to the naming skill in the same collection for how interfaces should be named, following the method name with an er suffix and the canonical names. The skill is useful for developers who want to avoid large interface types that are hard to mock, and who want an agent to return concrete types from constructors, accept interfaces where a function needs behaviour, and use embedding carefully. It is listed on skills.sh, where the page shows install counts and GitHub stars for the collection. Its security audits all pass, including Gen Agent Trust Hub, Socket and Snyk. Install it with npx skills add https://github.com/samber/cc-skills-golang --skill golang-structs-interfaces.…
Highlights
- Small interfaces of one to three methods
- Composition and embedding
- Type assertions and type switches
- Interface segregation
- Concrete return types
- Installs from skills.sh
Ratings & Reviews
No ratings yet
Be the first to rate golang-structs-interfaces.
People also visit

golang-patterns
Idiomatic Go patterns, best practices, and conventions for building robust
golang-structs-interfaces FAQ
What does this skill cover?
Struct and interface design in Go: composition, embedding, type assertions, type switches, interface segregation and dependency injection.
How big should an interface be?
The skill says one to three methods, and to compose larger contracts from small interfaces.
What do I return from constructors?
Concrete types, according to the skill's design principles.
How do I install it?
Run npx skills add https://github.com/samber/cc-skills-golang --skill golang-structs-interfaces.
What are the security audit results?
skills.sh lists three audits: Gen Agent Trust Hub Pass, Socket Pass and Snyk Pass.
How popular is it?
The page shows about 38.0K installs, and the cc-skills-golang repository has 3.5K GitHub stars.
What are the best golang-structs-interfaces alternatives?
Popular alternatives to golang-structs-interfaces include golang-design-patterns, go-interfaces and golang-patterns. See all golang-structs-interfaces alternatives


