api-design

Define contract-first REST/GraphQL APIs with versioning, error semantics, and pagination.

4|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/rbaumier/skills --skill api-design-rbaumier
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/rbaumier/skills/tree/main/api-design
Command: npx skills add https://github.com/rbaumier/skills --skill api-design-rbaumier

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Establishes robust API design governance to ensure stable contracts, predictable error semantics, and safe evolution of public surfaces across distributed systems.

Core Features & Use Cases

  • Contract-first: define inputs and outputs before implementation to prevent drift and ensure clear boundaries.
  • Consistent error semantics: unify error shapes and status codes to simplify client integration.
  • API versioning & deprecation: choose between URL or header versioning with explicit deprecation protocols.
  • Pagination decisions: establish cursor-based vs offset-based pagination for predictable data access.
  • Interface stability: enforce additive changes, avoid breaking field types, and use discriminated unions for variants.

Quick Start

Draft a contract-first API spec for a new REST or GraphQL surface and apply uniform error handling, versioning, and pagination across endpoints.

Frequently Asked Questions about api-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a contract-first API to prevent breaking changes?

Contract-first API design defines inputs, outputs, and boundaries before implementation to prevent drift. This approach ensures stable contracts and predictable consumer integration across REST or GraphQL surfaces by enforcing additive changes and strong validation.

What is Hyrum's Law and how does it affect interface stability?

Hyrum's Law states that all observable behaviors of an API will be depended upon by consumers. Interface stability mitigates this by enforcing additive changes, avoiding breaking field types, and using discriminated unions for variants to protect public surfaces.

How do I choose between cursor-based and offset-based pagination for REST endpoints?

Pagination decisions depend on data access patterns: cursor-based pagination provides predictable access for large, dynamic datasets, while offset-based pagination suits smaller, static collections. Consistent pagination across endpoints simplifies client integration.

Should I use URL or header versioning for API deprecation protocols?

URL and header versioning both support explicit deprecation protocols for API evolution. URL versioning offers transparent routing, while header versioning keeps endpoints clean; choose based on your routing infrastructure and consumer integration requirements.

How do I unify error semantics and status codes across distributed systems?

Consistent error semantics unify error shapes and status codes to simplify client integration across distributed systems. Defining standard error payloads and response codes ensures predictable failure handling across all REST and GraphQL endpoints.

How do I safely deprecate API fields without breaking existing consumers?

Safe API deprecation requires explicit protocols that protect consumers during evolution. Use additive changes, avoid breaking field types, and provide clear deprecation timelines to ensure interface stability while clients migrate to new versions.