api-and-interface-design

Define stable REST and GraphQL API contracts with boundary validation and naming conventions.

13|3|Updated May 12, 2026
One-click install
npx skills add https://github.com/kevinnft/ai-agent-skills --skill api-and-interface-design-kevinnft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-and-interface-design
Source: https://github.com/kevinnft/ai-agent-skills/tree/main/skills/addyosmani/api-and-interface-design
Command: npx skills add https://github.com/kevinnft/ai-agent-skills --skill api-and-interface-design-kevinnft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides organizations to create stable, well-documented interfaces that reduce misuse, miscommunication, and breaking changes across teams and systems. It covers API design for REST and GraphQL endpoints, module boundaries, and public surfaces where one component talks to another.

Core Features & Use Cases

  • Contract-first design: Define the interface before implementing it to establish a clear spec that teams can follow.
  • Consistent error semantics: Choose a single error strategy and apply it across endpoints to improve client predictability.
  • Boundary validation: Validate inputs at the API boundary to prevent untrusted data from propagating inward.
  • Evolution and naming: Add new fields and capabilities in a backward-compatible way and enforce consistent naming conventions across APIs.
  • Use Case: Design a REST API and GraphQL schema for a new service, then define types, endpoints, and error contracts before coding.

Quick Start

Draft a contract-first API specification for a new module, including endpoints and data models.

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 a stable REST API and prevent breaking changes?

To prevent breaking changes in a REST API, adopt a contract-first approach by defining interface specifications before implementation. Enforce additive evolution and consistent naming conventions to introduce new capabilities without disrupting existing client integrations.

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

Contract-first API design involves defining interface specifications and data models before writing implementation code. Use this approach when designing REST or GraphQL services to establish clear specs, reduce team miscommunication, and prevent module misuse before deployment.

How do I set up consistent error handling for GraphQL and REST endpoints?

Set up consistent error handling by choosing a single error strategy and applying it uniformly across all REST and GraphQL endpoints. This improves client predictability and ensures consistent error semantics when frontend and backend components interact across system boundaries.

How do I validate inputs at API boundaries to prevent untrusted data?

Validate inputs at API boundaries to prevent untrusted data from propagating inward into your system. Enforcing boundary validation rules on incoming REST and GraphQL requests ensures only properly formatted data reaches internal modules and backend components.

Can I use this approach to define module boundaries for frontend and backend components?

Yes, you can define module boundaries and public interfaces for both frontend and backend components. Establishing clear module contracts prevents misuse and ensures stable communication across different parts of the overall system architecture.

What is the best way to evolve an API schema without breaking existing clients?

The best way to evolve an API schema without breaking existing clients is through additive evolution. Add new fields and capabilities in a backward-compatible manner while enforcing consistent naming conventions across all REST and GraphQL endpoints.