api-and-interface-design

Designs stable REST APIs, TypeScript contracts, and module boundaries with consistent error semantics.

2|Updated Jul 6, 2026
One-click install
npx skills add https://github.com/NAMEWTA/learning-open-code --skill api-and-interface-design-namewta
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-and-interface-design
Source: https://github.com/NAMEWTA/learning-open-code/tree/main/translator/open-ai-skills/addyosmani-agent-skills/skills/api-and-interface-design
Command: npx skills add https://github.com/NAMEWTA/learning-open-code --skill api-and-interface-design-namewta

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Poorly designed interfaces create breaking changes, inconsistent error handling, and hidden dependencies that frustrate API consumers. This Skill guides the design of stable, well-documented interfaces that are hard to misuse, covering REST endpoints, GraphQL schemas, module boundaries, and component props. ## Core Features & Use Cases - Contract-First Design: Define typed interfaces before implementation, with input/output separation and branded ID types in TypeScript. - Consistent Error Semantics: Standardize error response structures, HTTP status code mapping, and boundary-only validation. - Backward-Compatible Evolution: Apply additive-only changes, pagination patterns, and predictable naming conventions to avoid breaking consumers. - Use Case: When designing a new tasks API, use this Skill to define the TaskAPI contract, set up paginated list endpoints with filtering, and establish a uniform error format before writing any implementation code. ## Quick Start Use the api-and-interface-design skill to design a REST API contract for a task management service with typed inputs, outputs, and error handling.

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 REST API that won't break existing consumers?▼

Design additive-only changes: add new optional fields instead of modifying or removing existing ones. Use contract-first development to define typed interfaces before implementation, and plan deprecation paths for anything consumers already depend on.

What is the best way to structure API error responses?▼

Use one consistent error format across all endpoints: a machine-readable code, a human-readable message, and optional details. Map errors to standard HTTP status codes like 400 for invalid data, 404 for missing resources, and 422 for validation failures.

Where should input validation happen in an API?▼

Validate only at system boundaries: API route handlers, form submissions, external service responses, and environment configuration. Internal functions that share typed contracts should trust already-validated data rather than re-validating.

Should I use PUT or PATCH for updating resources?▼

Use PATCH for partial updates where clients send only the fields that changed. PUT requires the complete object on every request, which is rarely what clients actually need and increases the risk of overwriting concurrent changes.

Why should I avoid trusting third-party API responses?▼

Third-party responses are untrusted data that may contain unexpected types, malicious content, or instruction-like text from compromised services. Always validate their structure and content before using them in logic, rendering, or decisions.