npx claudepluginhub jamesprial/prial-plugins --plugin golang-workflowThis skill uses the workspace's default tool permissions.
Interface pollution occurs when interfaces are created before they're needed. Define interfaces at consumption point, not production.
Guides Go interface design patterns: consumer-side definition, accept-interfaces-return-structs, composition, implicit satisfaction, and pitfalls. For decoupling packages, defining contracts, reviewing usage, refactoring for testability.
Designs, reviews, and audits Go interfaces using discovery-over-design principles. Flags oversized interfaces, wrong definition sites, premature abstractions, and usage smells.
Guides Go interface usage: defining/implementing, abstractions, mockable testing boundaries, embedding, accepting interfaces vs concrete returns, type assertions/switches. Includes compliance check script.
Share bugs, ideas, or general feedback.
Interface pollution occurs when interfaces are created before they're needed. Define interfaces at consumption point, not production.
WRONG - Producer defines interface prematurely
// In package "storage"
type UserRepository interface {
GetUser(id int) (*User, error)
SaveUser(u *User) error
}
type PostgresRepo struct{}
func (p *PostgresRepo) GetUser(id int) (*User, error) { ... }
func (p *PostgresRepo) SaveUser(u *User) error { ... }
CORRECT - Consumer defines minimal interface
// In package "handler"
type UserGetter interface {
GetUser(id int) (*User, error)
}
func HandleRequest(repo UserGetter) http.Handler {
// Only needs GetUser, not entire repository
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
user, _ := repo.GetUser(123)
// ...
})
}
// Concrete type lives in storage package
// Handler depends on small interface, not full implementation
You have interface pollution if:
Before:
type DataService interface {
Read() error
Write() error
Validate() error
Transform() error
}
After:
// Split by actual usage
type Reader interface { Read() error }
type Writer interface { Write() error }
// Compose where needed
type ReadWriter interface {
Reader
Writer
}