api-and-interface-design

Define REST and GraphQL API contracts with backward compatibility and boundary validation.

63|14|Updated Jun 6, 2026
One-click install
npx skills add https://github.com/HsienW/chat-gun-react-agent --skill api-and-interface-design-hsienw
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-and-interface-design
Source: https://github.com/HsienW/chat-gun-react-agent/tree/main/.agents/skills/api-and-interface-design
Command: npx skills add https://github.com/HsienW/chat-gun-react-agent --skill api-and-interface-design-hsienw

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill provides guidelines and best practices for designing APIs and interfaces, ensuring they are easy to use and maintain.

Core Features & Use Cases

  • Guidelines for API Design: Offers principles like "Contract First", "Hyrum's Law", and "One-Version Rule".
  • Error Semantics: Helps establish consistent error strategies.
  • Boundary Validation: Encourages validation at the edge of the system to protect internal logic.
  • Use Case: Use when defining REST or GraphQL endpoints, module boundaries, or any public interface.

Quick Start

Execute the "api-design-checklist" command to validate the design of your new REST API.

Frequently Asked Questions about api-and-interface-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What principles should I follow for REST API design to ensure long-term stability?

Effective REST API design relies on a contract-first approach, respecting Hyrum's Law and the one-version rule to maintain backward compatibility. This ensures your endpoints remain stable and predictable as your software architecture evolves over time.

How do I establish consistent error semantics for my GraphQL and REST interfaces?

Consistent error semantics involve defining clear contracts and standardized error strategies for your interfaces. By validating data at the system boundary, you protect internal logic and return predictable, structured errors to clients.

What is the best way to validate data at system boundaries in software architecture?

Boundary validation involves enforcing strict validation at the edge of your system before processing requests. This approach protects internal logic from malformed data and ensures your public interface maintains a clear, secure contract.

How do I maintain backward compatibility when modifying an existing public interface?

Maintaining backward compatibility requires applying the one-version rule and adhering to a contract-first design. By anticipating Hyrum's Law, you ensure that changes to your public interface do not break existing API consumers.

When should I use a contract-first approach for software interface design?

A contract-first approach is essential when designing REST or GraphQL APIs and defining module boundaries. It establishes a clear agreement upfront, preventing misalignment between systems and ensuring your interface design remains robust.

Does this approach work for both module boundaries and public REST API endpoints?

Yes, these interface design principles apply to both public REST API endpoints and internal module boundaries. Defining clear contracts and validating at boundaries ensures stability across your entire software architecture.