route-to-openapi
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.
Install / Use
npx skills add zebbern/claude-code-guide --skill route-to-openapiInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AutomationSupported Platforms
Our assessment of route-to-openapi
route-to-openapi scores 89/100 on our quality scale, 807th of 2,035 Automation skills we index (top 40%).
Its SKILL.md is 4.5 KB long, well organised into 12 sections with 2 code examples: a solid amount of guidance for an agent.
With 4,638 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 2 days ago, so route-to-openapi is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
route-to-openapi compared with similar skills
All 4 of these similar skills score higher than route-to-openapi; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| route-to-openapi (this skill)by zebbern | 89 | 4.6k | 2d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 85.9k | 13d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.0k | 1d ago | CLAUDE.md |
| rufloby ruvnet | 100 | 73.4k | today | CLAUDE.md |
| crawl4aiby unclecode | 100 | 84.4k | 3d ago | MCP Server |
Frequently asked questions
- How do I install route-to-openapi?
- Run
npx skills add zebbern/claude-code-guide --skill route-to-openapi. The install tabs above show the steps for each supported agent. - Which AI agents does route-to-openapi work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is route-to-openapi safe to use?
- It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is route-to-openapi still maintained?
- The repository was last updated 2 days ago, so route-to-openapi is actively maintained.
Skill content
View source on GitHubname: route-to-openapi description: "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." license: MIT
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.
Quick Start
# 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
Supported Frameworks
| 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) |
Extraction Capabilities
The script automatically extracts the following information:
- HTTP Methods: GET / POST / PUT / DELETE / PATCH, etc.
- Route Paths: Automatically converts each framework's path parameter format to the OpenAPI
{param}format - Path Parameters: Extracted from route patterns (with type inference)
- Query Parameters: Extracted from function signatures (Python frameworks)
- Request Bodies: Inferred from type annotations and Pydantic models (FastAPI)
- Response Models: Extracted from the
response_modelparameter (FastAPI) - Endpoint Descriptions: Extracted from docstrings / JSDoc / inline comments
- Tag Grouping: Automatically grouped by source file module name
Path Parameter Format Conversion
| 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} |
Parameters
| 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 |
Output Example
{
"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" }
}
}
}
}
}
Prerequisites
- Python 3.8+
- No additional dependencies required — uses only the Python standard library
- The scanned project must use one of the supported web frameworks listed above
Related Skills
Agent-Reach
85.9kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
74.0kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ruflo
73.4k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
crawl4ai
84.4kOpen-source web crawler and scraper for LLMs and AI agents: any website into clean, LLM-ready Markdown. Run it yourself, or use Crawl4AI Cloud with one key.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
