api-design-patterns
Installation
SKILL.md
api-design-patterns
REST and GraphQL API design patterns.
Mandatory Rules (Blocking — violating any is an error)
- Every endpoint MUST return a consistent error envelope:
{ "error": { "code": "...", "message": "...", "details": [...] } } - Never expose internal IDs in URLs without validation — all path params must be validated (UUID format, existence check)
- Never return 200 for errors — use proper 4xx/5xx status codes
- Every collection endpoint MUST support pagination — no unbounded lists
- Every mutating endpoint MUST be idempotent or document why not — include Idempotency-Key header support for POST
- Never break backwards compatibility — additive changes only without version bump
- Every endpoint MUST have rate limiting — return 429 with Retry-After header
- No sensitive data in URLs — tokens, passwords, PII go in headers or body, never query params
- All responses MUST include request-id header — for tracing and debugging
- OpenAPI spec MUST exist — no endpoint without a spec entry