api-contract-designer

Enforce API-first design by requiring contracts before backend implementation.

Updated Nov 26, 2025
One-click install
npx skills add https://github.com/guiledo/dotfiles --skill api-contract-designer-guiledo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-contract-designer
Source: https://github.com/guiledo/dotfiles/tree/main/opencode/.config/opencode/skills/api-contract-designer
Command: npx skills add https://github.com/guiledo/dotfiles --skill api-contract-designer-guiledo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces API-First design principles to ensure backend implementations are driven by consumer contracts.

Core Features & Use Cases

  • Contract-first workflow: define OpenAPI/Swagger, GraphQL schema, or tRPC router inputs/outputs before coding.
  • Alignment checks: automatically verify that the implemented API adheres to the contract to prevent drift.
  • Validation & semantics: ensure the contract specifies input validation, error handling, and pagination semantics.

Quick Start

Draft the API contract using your preferred schema (OpenAPI, GraphQL, or tRPC) and implement the backend strictly against it.

Frequently Asked Questions about api-contract-designer

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

FAQPage Schema
How do I enforce API-first design before backend implementation?

To enforce API-first design, you must draft a formal API contract using OpenAPI, GraphQL schemas, or tRPC definitions before writing backend code, ensuring the implementation strictly adheres to the specified contract.

What is an API contract and what does it need to specify?

An API contract is a formal agreement defining API structure and semantics. It must specify input validation, error handling, pagination rules, and data schemas using OpenAPI, GraphQL, or tRPC formats to prevent scope drift.

Does this API-first design workflow support GraphQL and tRPC?

Yes, this API-first design workflow supports GraphQL and tRPC, alongside REST. It requires defining GraphQL schemas or tRPC router inputs and outputs upfront to verify alignment and prevent implementation drift across these protocols.

Why does my backend implementation drift from the OpenAPI specification?

Backend implementation drifts from the OpenAPI specification when coding occurs without strict contract enforcement. Defining the OpenAPI contract first and running alignment checks ensures the implemented API adheres to the specified validation and semantics.

What's the best way to prevent scope drift in REST API development?

The best way to prevent REST API scope drift is adopting a contract-first workflow. Define your OpenAPI or Swagger specification detailing pagination and validation rules before coding, then verify the backend implementation against this contract.