Agent skill · Backend & API

api-contract-generator

Generates OpenAPI/Swagger schemas for API endpoints. Creates comprehensive API contracts from endpoint implementations, ensuring consistency between code and documentation.

majiayu000github.com/majiayu000GitHub ↗
claude-codecan modify filesMIT
Install
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.

Facts
Files in the skill folder: 2
SKILL.md size: 4 KB
Bundled scripts: none
Allowed tools: readwritegrepcodebase_search
Path: skills/api/api-contract-generator/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. When to Use
  2. Instructions
  3. Step 1: Analyze Endpoint Implementation
  4. Step 2: Generate OpenAPI Schema
  5. Step 3: Validate Schema
  6. Step 4: Save Contract
  7. Supported Frameworks
  8. Example Output
  9. Related Documentation
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
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.

Keep going