api-and-interface-design

Design stable REST and GraphQL APIs with contract-first specifications.

9|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/klh/speedy-claude --skill api-and-interface-design-klh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-and-interface-design
Source: https://github.com/klh/speedy-claude/tree/main/skills/api-and-interface-design
Command: npx skills add https://github.com/klh/speedy-claude --skill api-and-interface-design-klh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

APIs, module boundaries, and public interfaces often break consumers when terminology, error formats, or observable behaviors change unexpectedly; this guidance helps teams design interfaces that minimize accidental breakage, ambiguity, and implementation leakage. The Skill emphasizes intentional surface design, deprecation planning, and validation at boundaries so interfaces remain predictable and maintainable as systems evolve.

Core Features & Use Cases

  • Contract-first design: Define typed input and output contracts before implementation to make types the source of truth.
  • Consistent error semantics: Use a single, structured error shape and stable status code mapping across endpoints.
  • Boundary validation: Validate all external inputs and third-party responses at the system edge while trusting internal contracts.
  • Backward-compatible evolution: Prefer additive changes, optional fields, and principled deprecation with migration paths.
  • Predictable naming and patterns: RESTful resource conventions, pagination, filtering, and partial updates (PATCH) for list and CRUD operations.
  • Type-system patterns: Discriminated unions, input/output separation, and branded ID types to prevent misuse and improve developer ergonomics.

Quick Start

Audit each endpoint by listing its contract (inputs and outputs), standardizing the error format, and ensuring pagination or a migration plan is defined for any breaking change.

Frequently Asked Questions about api-and-interface-design

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

FAQPage Schema
How do I design REST APIs that prevent accidental breaking changes?

Consistent API error handling uses a single structured error shape and stable status code mapping across endpoints. This ensures predictable error semantics, preventing ambiguity when consumers handle failed requests.

What is contract-first API design and when should I use it?

API deprecation planning requires principled migration paths and additive schema changes. By defining backward-compatible evolution strategies and stable contracts upfront, you prevent breaking consumers when terminology or behaviors change.

Does this API design approach work for GraphQL endpoints and module boundaries?

Yes, this interface design approach applies to REST, GraphQL endpoints, module boundaries, and component props. It enforces boundary validation, predictable naming, and type-system patterns like discriminated unions across various backend-frontend contracts.

How do I validate external inputs at the system edge without breaking internal contracts?

Boundary validation validates all external inputs and third-party responses at the system edge while trusting internal contracts. This separation maintains predictable interfaces and prevents implementation leakage as systems evolve.