go-idiomatic-api-design
Installation
SKILL.md
Go Idiomatic API Design
Design from the caller's code inward. Prefer the smallest coherent public surface that preserves invariants and can evolve without needless interfaces.
Core Workflow
- Identify callers, supported operations, and compatibility constraints.
- Sketch realistic call sites before choosing exported names or types.
- Keep packages cohesive and names clear without package-name stutter.
- Prefer concrete provider APIs; define narrow interfaces at consumers.
- Decide zero-value, mutation, copying, concurrency, and error contracts.
- Review embedding, receiver method sets, typed nils, generics, and option conflicts.
- Integrate standard interfaces only when their semantics truly match.
- Prove the public surface with external tests and executable examples.
- Review the change for accidental compatibility commitments.