addy-api-and-interface-design

Guides design of stable REST APIs, TypeScript interfaces, and module contracts.

Updated Aug 21, 2026
One-click install
npx skills add https://github.com/TylerSimons1127/vibe --skill addy-api-and-interface-design-tylersimons1127
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: addy-api-and-interface-design
Source: https://github.com/TylerSimons1127/vibe/tree/main/skills/addy-api-and-interface-design
Command: npx skills add https://github.com/TylerSimons1127/vibe --skill addy-api-and-interface-design-tylersimons1127

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Poorly designed APIs and interfaces create breaking changes, inconsistent error handling, and hidden dependencies that frustrate consumers and multiply maintenance cost. This Skill provides concrete principles and patterns for designing interfaces that are hard to misuse and safe to evolve. ## Core Features & Use Cases - Contract-First Design: Define typed input/output schemas, discriminated unions, and branded ID types before implementation. - Consistent Error Semantics: Standardize HTTP status codes and structured error bodies across all endpoints. - Idempotency Key Handling: Implement atomic key claiming, payload guards, and retention policies for safe retries on state-changing endpoints. - Use Case: When creating a new REST endpoint for task management, use this Skill to define the TaskAPI contract, pagination scheme, PATCH semantics, and idempotency strategy before writing any handler code. ## Quick Start Use the API design skill to review my planned REST endpoints for a task management service and define the TypeScript contracts, error format, and pagination scheme.

Frequently Asked Questions about addy-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?▼

Prefer addition over modification: add new fields as optional and never change or remove existing field types. Define the contract first with typed input and output schemas, and plan for deprecation at design time since Hyrum's Law means users depend on every observable behavior.

How to implement idempotency keys for payment or state-changing endpoints?▼

Accept a client-generated Idempotency-Key and claim it atomically using a database unique constraint, not a check-then-insert which races. Reject the same key with a different payload, decide how in-flight duplicates are handled (409, wait, or 202), and retain keys longer than the longest retry path.

Where should input validation happen in an API?▼

Validate only at system boundaries: API route handlers, form submissions, third-party API responses, and environment variable loading. Internal functions that share type contracts should trust already-validated data rather than re-validating throughout the codebase.

Should I use PUT or PATCH for updating resources?▼

Use PATCH for partial updates where only provided fields change, which is what clients actually want. PUT requires sending the full object every time, making it fragile for consumers and prone to overwriting fields unintentionally.

What are common API design mistakes to avoid?▼

Red flags include verbs in URLs like /api/createTask, inconsistent error formats across endpoints, list endpoints without pagination, breaking changes to existing fields, and using third-party API responses without validation. Also avoid idempotency keys derived from UUIDs or timestamps regenerated per attempt.