api-and-interface-design

Design REST API and TypeScript interface contracts with consistent error semantics.

84.9k|9.1k|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/addyosmani/agent-skills --skill api-and-interface-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-and-interface-design
Source: https://github.com/addyosmani/agent-skills/tree/main/skills/api-and-interface-design
Command: npx skills add https://github.com/addyosmani/agent-skills --skill api-and-interface-design

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design stable, well-documented interfaces that are hard to misuse, making the right thing easy and the wrong thing hard.

Core Features & Use Cases

  • Contract-First Design: Define interfaces before implementation.
  • Consistent Error Handling: Establish predictable error semantics across your API.
  • Boundary Validation: Ensure data integrity by validating at system edges.
  • Use Case: When designing a new REST API for a task management system, use this skill to define the TaskAPI contract, including endpoints for creating, listing, and updating tasks, along with a consistent error response format.

Quick Start

Use the api-and-interface-design skill to define a TypeScript interface for a new user profile 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 a REST API contract before implementation?

Designing a REST API contract-first involves defining stable endpoints, predictable naming conventions, and consistent error semantics before writing logic. This approach makes APIs maintainable, well-documented, and hard to misuse.

What's the best way to define TypeScript interfaces for module boundaries?

Defining TypeScript interfaces for module boundaries requires establishing predictable public contracts and validating data at system edges. This ensures data integrity and makes the right usage patterns easy while preventing incorrect implementations.

How do you handle API error handling and validation at boundaries?

API error handling and boundary validation require establishing predictable error semantics across all endpoints and validating data integrity at system edges. This creates consistent contracts that prevent invalid data from entering internal module logic.

When do I need contract-first API design for a new task management system?

You need contract-first API design when building new systems like a task management API to define stable contracts for creating, listing, and updating resources. It establishes consistent error response formats before implementation begins.

Does contract-first API design work with TypeScript?

Contract-first API design works directly with TypeScript by defining stable interfaces and module boundaries before implementation. It focuses on predictable naming conventions and boundary validation to ensure robust public interfaces.

Why does my REST API have inconsistent error response formats?

Inconsistent REST API error response formats occur when contracts lack established error semantics. Applying contract-first design with consistent boundary validation and predictable naming conventions solves this by enforcing stable, documented interfaces.