api-and-interface-design

Creates REST/GraphQL contracts with error semantics and validation for frontend-backend interoperability.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Design stable, well-documented interfaces that prevent misuse and accidental breaking changes by aligning contracts before implementation and clarifying public surfaces.

Core Features & Use Cases

  • Contract-first design: Define the interface before coding to ensure a shared understanding between teams.
  • Consistent error semantics: Apply uniform error shapes and status mappings across APIs.
  • Boundary validation: Validate inputs at the API boundary to prevent invalid data from entering the system.
  • Additive evolution: Extend APIs with new fields and endpoints without breaking existing consumers.
  • Naming conventions: Use consistent REST/GraphQL patterns and clear surface boundaries.
  • Use cases: Designing REST or GraphQL endpoints, module boundaries, and frontend-backend contracts across projects.

Quick Start

Define the API contract for your new service before implementing it, document input/output schemas, and establish error handling rules for all public surfaces.

Frequently Asked Questions about api-and-interface-design

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

FAQPage Schema
What is contract-first API design and why should I use it?

Contract-first API design defines interface schemas and error handling rules before coding. It ensures a shared understanding between teams, clarifies public surfaces, and prevents misuse or accidental breaking changes across REST or GraphQL endpoints.

How do I evolve REST and GraphQL APIs without breaking existing consumers?

Evolve REST and GraphQL APIs through additive evolution by extending schemas with new fields and endpoints rather than modifying existing ones. This approach prevents breaking changes while allowing frontend-backend contracts to grow safely.

What is the best way to handle API error handling and validation consistently?

Apply consistent error semantics by using uniform error shapes and status mappings across all APIs. Combine this with boundary validation to validate inputs at the API boundary, preventing invalid data from entering the system.

Can I use this approach for module boundaries and frontend-backend contracts?

Yes, this approach applies to designing module boundaries and frontend-backend contracts across software projects. It enforces clear surface boundaries, naming conventions, and contract-first design for any public interface beyond just REST or GraphQL endpoints.

How do I establish naming conventions for REST and GraphQL endpoints?

Establish naming conventions by using consistent REST and GraphQL patterns with clear surface boundaries. Defining these conventions early during contract-first design ensures interfaces remain stable, well-documented, and predictable for all consumers.

When should I not use contract-first interface design?

Contract-first interface design may not suit rapid prototyping or exploratory coding where public surfaces are still undefined. It is most effective when stabilizing module boundaries, REST or GraphQL endpoints, and frontend-backend contracts to prevent accidental breaking changes.