api-contract

Verify API implementations against documented contracts and report mismatches.

Updated Jun 1, 2025
One-click install
npx skills add https://github.com/Yokhan/yokhanFitnessDocsWebsite --skill api-contract-yokhan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-contract
Source: https://github.com/Yokhan/yokhanFitnessDocsWebsite/tree/main/.claude/skills/api-contract
Command: npx skills add https://github.com/Yokhan/yokhanFitnessDocsWebsite --skill api-contract-yokhan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Validate API implementations against the documented contracts, preventing drift when contracts change and ensuring aligned behavior across code and docs.

Core Features & Use Cases

  • Load and parse endpoints from docs/API_CONTRACTS.md to establish a single source of truth.
  • Map each contract to its implementation, verifying request/response schemas, status codes, and type usage.
  • Auto-detect missing contracts and generate OpenAPI specifications when gaps exist to keep documentation in sync.

Quick Start

Verify your API implementations against the documented contracts to ensure alignment across the codebase.

Frequently Asked Questions about api-contract

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

FAQPage Schema
How do I validate API implementations against documented contracts?

Prevent API contract drift by mapping documented endpoints to codebase implementations, verifying request/response schemas, status codes, and types. Mismatches are reported with actionable guidance to update the contract or the code accordingly.

What is API contract drift and how do I detect it in my codebase?

API contract drift happens when code behavior diverges from documented endpoints. Detect drift by mapping docs/API_CONTRACTS.md endpoints to codebase implementations, verifying request/response schemas, status codes, and types, and flagging mismatches for contract or code updates.

Can I generate OpenAPI specifications from existing API endpoints automatically?

Yes, generate OpenAPI specifications automatically when missing contracts are detected during validation. This fills documentation gaps by creating specs directly from the existing codebase endpoints to keep records synchronized.

How do I check if my API status codes and response types match the documentation?

Check API status codes and response types by loading contracts from docs/API_CONTRACTS.md, mapping them to codebase endpoints, and verifying request/response schemas and status codes align. Mismatches are reported with guidance to update the contract or implementation.

Do I need an OpenAPI spec to verify my API endpoints against contracts?

No, an OpenAPI spec is not required to verify endpoints. The source of truth is docs/API_CONTRACTS.md. OpenAPI specifications are only optionally generated when missing contracts are detected during the validation process.

What should I do when my API implementation does not match the documented contract?

When an API implementation mismatches its documented contract, the validation report provides specific guidance to either update the contract to match the codebase or modify the implementation to align with the documented contract.