Agent skill
go-interfaces
Go interface design patterns and best practices
Install this agent skill to your Project
npx add-skill https://github.com/JamesPrial/claudefiles/tree/main/skills/golang/interfaces
SKILL.md
Interface Design
Master Go's approach to interfaces: implicit satisfaction, consumer-driven design, and composition patterns.
Route by Concern
-
Accept/return patterns → see design/
- Accept interfaces, return structs principle
- When to deviate from the rule
-
Interface pollution → see pollution/
- Detecting unnecessary abstractions
- Premature interface creation
-
Embedding patterns → see embedding/
- Interface composition techniques
- Method set expansion
Quick Check
- Interface defined by consumer, not producer
- Keep interfaces small (<5 methods)
- Return concrete types from functions
- No interface{} unless truly necessary
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
plugin-packager
Package claudefiles components into a valid Claude Code plugin
plugin-packager-validation
Plugin validation errors and fixes
plugin-packager-subset
Package language-specific subsets of claudefiles
plugin-packager-hooks
Handle hook scripts and paths for plugin packaging
go-concurrency
Go concurrency patterns. Routes to specific patterns.
go-sync-primitives
sync.WaitGroup and sync.Mutex patterns
Didn't find tool you were looking for?