api-and-interface-design

Designs REST/GraphQL contracts with typed I/O, error semantics, and backward compatibility.

42|3|Updated May 8, 2026
One-click install
npx skills add https://github.com/KevinKE93/Dev_Agent_OPC --skill api-and-interface-design-kevinke93
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-and-interface-design
Source: https://github.com/KevinKE93/Dev_Agent_OPC/tree/main/dev-agent/skills/api-and-interface-design
Command: npx skills add https://github.com/KevinKE93/Dev_Agent_OPC --skill api-and-interface-design-kevinke93

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design APIs and module boundaries that stay predictable over time, reducing integration breakages caused by inconsistent contracts, unclear error behavior, and accidental exposure of implementation details.

Core Features & Use Cases

  • Contract-first interface design: Define typed inputs/outputs and behavior before implementing, so consumers and producers agree on the contract.
  • Consistent error semantics: Establish a single error strategy across endpoints (e.g., status-code mapping plus a uniform structured error body).
  • Boundary validation and safety: Validate untrusted data at system edges (user input, external service responses, configuration) and avoid scattered validation that hides contract behavior.
  • Backward-compatible evolution: Prefer additive, optional fields and safe extension patterns over breaking changes to existing types.
  • Stability conventions: Apply consistent naming, REST resource patterns, pagination, filtering, PATCH partial updates, and TypeScript interface patterns (including discriminated unions and branded IDs).

Use it when designing new REST/GraphQL endpoints, defining frontend-backend contracts, setting module boundaries across teams, or planning safe changes to public interfaces.

Quick Start

Use the api-and-interface-design Skill to turn your endpoint or module contract requirements into a consistent, validated, version-stable interface spec by asking it to produce typed input/output schemas, a uniform error model, and backward-compatible evolution guidance for your proposed API.

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 API contracts that maintain backward compatibility when evolving types?

To design backward-compatible REST API contracts, prefer additive, optional fields and safe extension patterns over breaking changes to existing types. This approach ensures predictable consumer integration and prevents accidental breakages when modifying public-facing type contracts across services.

What is the best way to structure consistent error semantics across API endpoints?

Consistent error semantics across API endpoints require establishing a single error strategy, combining status-code mapping with a uniform structured error body. This ensures consumers receive predictable error behavior and clear contract definitions across all REST or GraphQL services.

Where should I validate untrusted data in a frontend-backend boundary definition?

Validate untrusted data at system edges, specifically user input, external service responses, and configuration, to establish safe frontend-backend boundaries. Avoid scattered validation that hides contract behavior, ensuring boundary-only validation protects internal module operations.

How do I define TypeScript interface patterns for stable API module boundaries?

Define TypeScript interface patterns for stable module boundaries using discriminated unions and branded IDs to create predictable contracts. Contract-first specification ensures consumers and producers agree on typed inputs and outputs before implementation begins.

What conventions should I apply for REST resource pagination and partial updates?

For REST resource pagination and partial updates, apply consistent naming conventions, standard pagination and filtering patterns, and PATCH partial update mechanisms. These stability conventions ensure interfaces remain predictable and difficult to misuse across endpoint designs.

Can I use contract-first interface design for both REST and GraphQL endpoint planning?

Yes, contract-first interface design applies to both REST and GraphQL endpoint planning, defining typed inputs, outputs, and behavior before implementation. This ensures consumers and producers agree on the contract, reducing integration breakages across frontend-backend boundaries.