api-contract-generator
Generates OpenAPI/Swagger schemas for API endpoints. Creates comprehensive API contracts from endpoint implementations, ensuring consistency between code and documentation.
npx skills add majiayu000/claude-skill-registry --skill api-contract-generator --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# API Contract Generator Skill Generates OpenAPI/Swagger schemas for API endpoints, creating comprehensive API contracts from endpoint implementations. ## When to Use - After creating new API endpoints - When updating existing endpoints - To ensure API documentation matches implementation - To generate client SDKs from contracts ## Instructions ### Step 1: Analyze Endpoint Implementation 1. **Read endpoint code**: - Identify route handlers (Next.js App Router, FastAPI, Express, etc.) - Extract HTTP methods (GET, POST, PUT, DELETE, etc.) - Identify request/response types 2. **Extract route information**: - Path parameters (e.g., `/api/users/{id}`) - Query parameters (e.g., `?page=1&limit=10`) - Request body structure - Response structure 3. **Identify data models**: - Find TypeScript interfaces or Python Pydantic models - Extract field types and validation rules - Identify nested objects and arrays ### Step 2: Generate OpenAPI Schema 1. **Create OpenAPI 3.0 structure**: ```yaml openapi: 3.0.0 info: title: API Name version: 1.0.0 paths: /api/endpoint: get: summary: Endpoint description parameters: [...] responses: { ... } ``` 2. **Map request/response types**: - Convert TypeScript in
- When to Use
- Instructions
- Step 1: Analyze Endpoint Implementation
- Step 2: Generate OpenAPI Schema
- Step 3: Validate Schema
- Step 4: Save Contract
- Supported Frameworks
- Example Output
- Related Documentation
What does the api-contract-generator skill do?
Generates OpenAPI/Swagger schemas for API endpoints. Creates comprehensive API contracts from endpoint implementations, ensuring consistency between code and documentation.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill api-contract-generator --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
