api-and-interface-design

Establishes contract-first API and interface designs for REST, GraphQL, and internal modules.

4|Updated Jun 10, 2026
One-click install
npx skills add https://github.com/mymx2/foreman --skill api-and-interface-design-mymx2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-and-interface-design
Source: https://github.com/mymx2/foreman/tree/main/.agents/skills/api-and-interface-design
Command: npx skills add https://github.com/mymx2/foreman --skill api-and-interface-design-mymx2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the fragility of evolving software systems by enforcing strict contract-first design, preventing breaking changes, and ensuring consistent error handling across module boundaries.

Core Features & Use Cases

  • Contract-First Design: Enforces the definition of interfaces and types before implementation to ensure alignment and reduce coupling.
  • Standardized Error Semantics: Provides a unified pattern for API error responses, ensuring predictable behavior for consumers.
  • Boundary Validation: Implements robust input validation at system edges to protect internal logic from untrusted external data.

Quick Start

Analyze the current module interface and propose a contract-first schema that ensures backward compatibility and consistent 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 prevent breaking changes in a REST API?

To prevent breaking changes in a REST API, establish strict contract-first design patterns, apply boundary validation, and adhere to the One-Version Rule for all public-facing interfaces to minimize system coupling.

What is Hyrum's Law and how does it affect interface design?

Hyrum's Law in interface design states that all observable API behaviors become implicit contracts. You must enforce strict boundary validation and contract-first schemas to manage this implicit consumer coupling safely.

How do I implement contract-first design for TypeScript module boundaries?

Implement contract-first design for TypeScript module boundaries by defining interfaces and types before implementation, ensuring alignment and reducing coupling across distributed system components.

What is the best way to standardize API error responses?

The best way to standardize API error responses is to enforce unified error semantics, ensuring predictable behavior for consumers across all module boundaries and public-facing interface contracts.

Does contract-first design work for both REST endpoints and GraphQL schemas?

Contract-first design works for both REST endpoints and GraphQL schemas. It establishes stable interface patterns, applies boundary validation, and ensures consistent error handling across distributed systems.

Why do I need boundary validation at system edges?

Boundary validation at system edges is required to protect internal logic from untrusted external data. It implements robust input validation to prevent breaking changes and ensure consistent module behavior.