api-and-interface-design

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

Updated Apr 28, 2026
One-click install
npx skills add https://github.com/JacobThree/zero-bloat-mcp-stack --skill api-and-interface-design-jacobthree
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-and-interface-design
Source: https://github.com/JacobThree/zero-bloat-mcp-stack/tree/main/ai_blueprints/agent-skills/skills/api-and-interface-design
Command: npx skills add https://github.com/JacobThree/zero-bloat-mcp-stack --skill api-and-interface-design-jacobthree

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Poorly designed interfaces create breaking changes, inconsistent error handling, and hidden dependencies that break consumers. This Skill guides the design of stable, hard-to-misuse APIs and module boundaries before implementation begins. ## Core Features & Use Cases - Contract-First Design: Define TypeScript interfaces, REST endpoints, and error schemas before writing implementation code. - Consistent Error Semantics: Enforce a single error format with structured codes, HTTP status mapping, and boundary-only validation. - Backward-Compatible Evolution: Apply additive-only changes, pagination from day one, and predictable naming conventions across endpoints. - Use Case: When creating a new REST endpoint for a task management feature, use this Skill to define the typed input/output contracts, pagination shape, and error responses so frontend and backend teams can work in parallel without integration surprises. ## Quick Start Ask the AI to design a REST API contract for a new resource, including typed inputs, outputs, error format, and pagination.

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 REST APIs for extension rather than modification: add only optional fields, never change existing field types or remove fields, and paginate list endpoints from the start. Define the contract in TypeScript before implementing so the types serve as documentation.

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 where external input enters: API route handlers, form submissions, third-party API responses, and environment variables. Internal functions that share type contracts should trust already-validated data instead of re-validating.

Should I use PATCH or PUT for updating resources?▼

Use PATCH for partial updates where only provided fields change, which matches what clients actually need. PUT requires sending the full object every time and increases the risk of accidentally overwriting fields.

What is Hyrum's Law and why does it matter for API design?▼

Hyrum's Law states that all observable behaviors of an API will be depended on by someone, regardless of the documented contract. This means every public behavior is a commitment, so avoid leaking implementation details and plan for deprecation at design time.