home / skills / jeremylongshore / claude-code-plugins-plus-skills / api-contract
This skill helps design and validate API contracts guiding backend and frontend teams through type-safe interfaces and endpoint schemas.
npx playbooks add skill jeremylongshore/claude-code-plugins-plus-skills --skill api-contractReview the files below or copy the command above to add this skill to your agents.
---
name: api-contract
description: |
Configure this skill should be used when the user asks about "API contract", "api-contract.md", "shared interface", "TypeScript interfaces", "request response schemas", "endpoint design", or needs guidance on designing contracts that coordinate backend and frontend agents. Use when building or modifying API endpoints. Trigger with phrases like 'create API', 'design endpoint', or 'API scaffold'.
allowed-tools: Read
version: 1.0.0
author: Damien Laine <[email protected]>
license: MIT
---
# Api Contract
## Overview
This skill provides automated assistance for the described functionality.
## Prerequisites
- Appropriate file access permissions
- Required dependencies installed
## Instructions
1. Invoke this skill when the trigger conditions are met
2. Provide necessary context and parameters
3. Review the generated output
4. Apply modifications as needed
## Output
The skill produces structured output relevant to the task.
## Error Handling
See `{baseDir}/references/errors.md` for comprehensive error handling.
## Examples
See `{baseDir}/references/examples.md` for detailed examples.
## Resources
- Project documentation
- Related skills and commands
This skill helps design and validate API contracts that coordinate backend and frontend agents. It guides creation of clear endpoint definitions, request/response schemas, and TypeScript interfaces. Use it to generate consistent, versioned contracts that reduce integration errors.
The skill inspects described endpoints, parameters, and data shapes to produce structured contract artifacts: OpenAPI snippets, JSON Schema, and TypeScript interfaces. It validates consistency across request and response models, flags breaking changes, and can suggest versioning or migration notes. Output is human-readable and machine-usable for scaffolding code or generating mocks.
Can this skill generate both OpenAPI and TypeScript output?
Yes. It can produce OpenAPI/JSON Schema snippets and corresponding TypeScript interfaces to keep runtime validation and client types synchronized.
How does it handle backward-incompatible changes?
It flags potential breaking changes, recommends version bumps or deprecation paths, and can generate migration notes and compatibility shims.
What inputs does it need to produce a contract?
Provide endpoint path, HTTP method, parameter descriptions, example payloads, and desired response shapes. Optionally include existing models or type hints for translation.