Generates RESTful API documentation (OpenAPI 3.0 / Swagger spec) by scanning route definitions in code for Flask, FastAPI, Express, Gin, and other frameworks. Trigger when users ask about API documentation, OpenAPI, Swagger, endpoint docs, generating docs from code, or extracting endpoints.
npx skills add https://github.com/zebbern/claude-code-guide --skill route-to-openapi
Automatically scan route/endpoint definitions in source code and generate RESTful API documentation conforming to the OpenAPI 3.0.3 specification.
Supports major web frameworks with automatic framework detection. Extracts HTTP methods, paths, parameters, request bodies, response models, and doc comments, then outputs a standard OpenAPI spec file ready to import into Swagger UI or Redoc.
# Scan source directory, output OpenAPI spec in JSON format
python scripts/generate_api_doc.py ./src
# Specify output format and file
python scripts/generate_api_doc.py ./src --format yaml --output api-spec.yaml
# Specify framework and API metadata
python scripts/generate_api_doc.py ./app --framework flask --title "My API" --version 2.0.0
# Add server URLs
python scripts/generate_api_doc.py ./routes --server http://localhost:3000 --server https://api.example.com
| Language | Framework | Parsing Method |
|---|---|---|
| Python | Flask | AST parsing (decorators + type annotations + docstrings) |
| Python | FastAPI | AST parsing (decorators + Pydantic models + type annotations) |
| Python | Django REST Framework | AST parsing (@api_view decorators) |
| JavaScript/TypeScript | Express.js | Regex matching (app.get() / router.get() + JSDoc) |
| Go | Gin | Regex matching (r.GET() / group.GET() + comments) |
| Go | Echo | Regex matching (e.GET() + comments) |
The script automatically extracts the following information:
{param} formatresponse_model parameter (FastAPI)| Framework | Source Format | Converted Result |
|---|---|---|
| Flask | <int:user_id> | {user_id} (type: integer) |
| FastAPI | {user_id} | {user_id} (unchanged) |
| Express | :user_id | {user_id} |
| Gin/Echo | :user_id | {user_id} |
| Parameter | Description | Default |
|---|---|---|
| source_dir | Source directory to scan (required) | - |
| -f, --format | Output format: json or yaml | json |
| -o, --output | Output file path | stdout |
| --framework | Force a specific framework (skip auto-detection) | Auto-detect |
| --title | API documentation title | API Documentation |
| --version | API version number | 1.0.0 |
| --description | API description text | Empty |
| --server | Server URL (can be specified multiple times) | None |
{
"openapi": "3.0.3",
"info": {
"title": "My API",
"version": "1.0.0"
},
"paths": {
"/users": {
"get": {
"summary": "List all users",
"operationId": "list_users",
"tags": ["users"],
"parameters": [
{
"name": "limit",
"in": "query",
"required": false,
"schema": { "type": "integer" }
}
],
"responses": {
"200": { "description": "Successful response" }
}
}
},
"/users/{user_id}": {
"get": {
"summary": "Get user by ID",
"operationId": "get_user",
"tags": ["users"],
"parameters": [
{
"name": "user_id",
"in": "path",
"required": true,
"schema": { "type": "integer" }
}
],
"responses": {
"200": { "description": "Successful response" }
}
}
}
}
}
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
Take zebbern/route-to-openapi from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.