skills/contract-first-designer/SKILL.md
Writes OpenAPI/AsyncAPI specifications before writing any code. Determines provider-consumer contracts and endpoint definitions early.
npx skillsauth add fatih-developer/fth-skills contract-first-designerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill enforces API design before implementation. It breaks the habit of writing controller code and auto-generating the spec from it. By designing the OpenAPI/AsyncAPI contract first, backend and frontend teams can work in parallel.
Core assumption: Code is cheap, contracts are expensive to change. A well-designed API contract prevents endless integration meetings.
Analyze the business requirements to output a standard API documentation format.
GET, POST, etc.).200 OK, 201 Created, 400 Bad Request, 401 Unauthorized, 404 Not Found, 500 Internal Server Error).$ref components.limit, cursor/offset) for all collection endpoints.Instead of relying only on E2E tests, generate the scenarios required to prove the provider (backend) and consumer (frontend) honor the contract.
Required Outputs (Must write BOTH to docs/api-report/):
docs/api-report/contract-designer-report.md)### 📝 Contract-First Design
- **Protocol:** HTTP REST
- **Specification:** OpenAPI 3.1
- **Focus Area:** User Orders
#### 📑 OpenAPI Specification (Snippet)
```yaml
openapi: 3.1.0
info:
title: Order API
version: 1.0.0
paths:
/orders:
post:
summary: Create a new order
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/OrderCreatePayload'
responses:
'201':
description: Order created
# ...
POST /orders with valid payload.201 Created with order_id string.
2. **Machine-Readable JSON (`docs/api-report/contract-designer-output.json`)**
```json
{
"skill": "contract-first-designer",
"protocol": "REST",
"endpoints": [
{"method": "POST", "path": "/orders", "request_schema": "OrderCreatePayload", "responses": [201, 400, 401]}
],
"pact_states": ["User is authenticated and has $50 balance"]
}
Any or Object types in definitions. Require strict typing (e.g., string with format: uuid).Bearer, ApiKey) are explicitly defined in the spec components.If you are executing the OpenAPI-First Design Flow as defined in the API ECOSYSTEM guide, and the contract has been successfully generated, the next mandatory skill in the sequence is:
@api-mock-designer (to generate mock servers and fake data responses based on this contract)tools
Create, optimize, critique, and structure prompts for AI systems. Use this skill whenever the user is designing or improving a prompt, system prompt, coding prompt, image prompt, evaluation rubric, agent prompt, workflow prompt, or MCP-oriented prompt package. Also use it when the user asks to turn vague AI behavior into a precise instruction set, tool policy, agent spec, or prompt architecture.
testing
Assumption-first architecture review skill to stress-test project plans and expose hidden risks.
testing
Enforce and manage DESIGN.md specifications, extract design systems from URLs, and combine design reasoning with token roles to prevent drift.
testing
Forces the agent to act with a Claude-like product mindset, prioritizing user journey, UX states, and visual quality before coding.