API and Interface Design guides an agent when it designs endpoints, module boundaries, component props or type contracts between frontend and backend. It centers on Hyrum’s Law, the One-Version Rule, contract-first design and validation at system edges.
The skill also covers REST resource patterns, pagination, TypeScript interface patterns and a detailed section on honouring an Idempotency-Key.
What You Get
- Six core principles: contract first, consistent error semantics, validation at boundaries, addition over modification, predictable naming and idempotency
- REST patterns for resources, pagination, filtering and partial updates
- TypeScript patterns: discriminated unions, input and output types, branded IDs
- A rationalizations table, red flags and a verification checklist
Common Use Cases
- Designing new API endpoints
- Defining contracts between modules or teams
- Changing a public interface without breaking consumers
- Making state-changing endpoints safe to retry
What Makes It Unique
Beyond the usual REST advice, the skill spends a full section on what it takes to honour an Idempotency-Key: intent-derived keys, atomic claiming, payload hashing, in-flight duplicate strategy and the unknown outcome of a timeout. It also treats third-party API responses as untrusted data to validate before use.
Under The Hood
The skill is a single SKILL.md of instructions with code examples in TypeScript. It loads when an interface is being designed and does not run scripts or reach any service. It points to the deprecation-and-migration skill for removing behavior that users depend on.