api-documentor
Generates OpenAPI/Swagger/GraphQL documentation and SDKs from code
Best use case
api-documentor is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Generates OpenAPI/Swagger/GraphQL documentation and SDKs from code
Teams using api-documentor should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/api-documentor/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How api-documentor Compares
| Feature / Agent | api-documentor | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Generates OpenAPI/Swagger/GraphQL documentation and SDKs from code
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# API Documentor Skill
## Purpose
The API Documentor Skill automatically generates comprehensive API documentation from code, including OpenAPI/Swagger specs, GraphQL schemas, and client SDKs. It eliminates manual documentation efforts and ensures API docs stay synchronized with implementation.
**Key Capabilities:**
- Generate OpenAPI 3.0 specifications from REST APIs
- Create GraphQL schema documentation
- Auto-generate client SDKs (Python, JavaScript, Go, Java)
- Generate API reference documentation
- Create interactive API explorers
- Validate API implementations against specs
**Target Token Savings:** 80% (from ~3000 tokens to ~600 tokens)
## When to Use
Use the API Documentor Skill when:
- Building or updating REST APIs
- Creating GraphQL services
- Generating client SDKs
- Publishing API documentation
- Validating API implementations
- Creating API mock servers
- Onboarding API consumers
- Versioning APIs
**Trigger Phrases:**
- "Generate OpenAPI spec"
- "Create API documentation"
- "Generate client SDK"
- "Document GraphQL schema"
- "Create Swagger docs"
- "Generate API reference"
## Operations
### 1. generate-openapi
Generates OpenAPI 3.0 specification from REST API code.
**Features:**
- Automatic endpoint detection
- Request/response schema extraction
- Authentication documentation
- Error code documentation
- Example request/responses
### 2. generate-graphql
Creates GraphQL schema documentation from resolvers.
**Features:**
- Type definitions
- Query documentation
- Mutation documentation
- Subscription support
- Directive documentation
### 3. generate-sdk
Auto-generates client SDKs in multiple languages.
**Languages:**
- Python (requests-based)
- JavaScript/TypeScript
- Go
- Java
- Ruby
### 4. generate-docs
Creates human-readable API reference documentation.
**Formats:**
- HTML
- Markdown
- PDF
### 5. validate-api
Validates API implementation against OpenAPI spec.
**Checks:**
- Endpoint availability
- Request/response schemas
- Authentication requirements
- Error responses
### 6. create-mock
Generates API mock server from specification.
**Features:**
- Example-based responses
- Schema-based response generation
- Delayed responses
- Error simulation
## Scripts
### Generate OpenAPI Specification
```bash
# Generate from Flask/FastAPI application
python ~/.claude/skills/api-documentor/scripts/main.py \
--operation generate-openapi \
--app-file app.py \
--output openapi.yaml
# Generate with custom info
python ~/.claude/skills/api-documentor/scripts/main.py \
--operation generate-openapi \
--app-file app.py \
--title "My API" \
--version "1.0.0" \
--output openapi.yaml
```
### Generate GraphQL Documentation
```bash
# Generate from GraphQL schema
python ~/.claude/skills/api-documentor/scripts/main.py \
--operation generate-graphql \
--schema-file schema.graphql \
--output graphql-docs.html
```
### Generate Client SDK
```bash
# Generate Python SDK
python ~/.claude/skills/api-documentor/scripts/main.py \
--operation generate-sdk \
--spec openapi.yaml \
--language python \
--output-dir ./sdks/python
# Generate TypeScript SDK
python ~/.claude/skills/api-documentor/scripts/main.py \
--operation generate-sdk \
--spec openapi.yaml \
--language typescript \
--output-dir ./sdks/typescript
```
### Generate Documentation
```bash
# Generate HTML docs
python ~/.claude/skills/api-documentor/scripts/main.py \
--operation generate-docs \
--spec openapi.yaml \
--format html \
--output api-docs.html
```
## Configuration
```json
{
"api-documentor": {
"openapi": {
"version": "3.0.0",
"title": "API Documentation",
"description": "Auto-generated API documentation",
"contact": {
"name": "API Team",
"email": "api@example.com"
},
"servers": [
{"url": "https://api.example.com", "description": "Production"},
{"url": "https://api-staging.example.com", "description": "Staging"}
]
},
"sdk": {
"languages": ["python", "javascript", "typescript", "go"],
"package_name": "api-client",
"include_examples": true
},
"output": {
"format": "yaml",
"pretty_print": true
}
}
}
```
## Examples
### Example 1: Generate OpenAPI from Flask App
```bash
python ~/.claude/skills/api-documentor/scripts/main.py \
--operation generate-openapi \
--app-file app.py
```
**Output:**
```yaml
openapi: 3.0.0
info:
title: User API
version: 1.0.0
paths:
/users:
get:
summary: List users
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
```
### Example 2: Generate Python SDK
```bash
python ~/.claude/skills/api-documentor/scripts/main.py \
--operation generate-sdk \
--spec openapi.yaml \
--language python
```
**Output:** Complete Python SDK with methods for all API endpoints
## Token Economics
**Without Skill:** ~3000 tokens (manual documentation)
**With Skill:** ~600 tokens (80% savings)
## Success Metrics
- Execution time: <500ms for OpenAPI generation
- SDK generation: <2s for full client
- Accuracy: 100% spec compliance
- Token savings: 80%
---
**API Documentor Skill v1.0.0** - Automated API documentation generationRelated Skills
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.
Prompt Engineering Skill
Craft effective prompts that get the best results from language models.
prompt-engineering-openai-api-f7c24501
Log in [Sign up](https://platform.openai.com/signup)
prompt-engineer-llm
World-class expert in prompt engineering, LLM fine-tuning, RAG systems, and AI/ML workflows. Use when crafting prompts, designing AI agents, building knowledge bases, implementing retrieval systems, or optimizing LLM performance at production scale.
project-spec
Create a project spec for AI agents to work from autonomously.
project-orchestrator
Master coordinator for complete project setup from ideation to ready-to-code. Manages workflow through ideation, research, tech stack selection, documentation, and project initialization to deliver working projects in minutes.
project-domain
Capture subject matter expertise and domain knowledge that will inform all product decisions - the ubiquitous language, domain rules, and principles from the field
project-bootstrap
Bootstrap a new or existing project with stack detection and project.json generation. Use when adding a new project, setting up agent system, or generating project manifest. Triggers on: add project, new project, bootstrap project, setup project, detect stack.
projecoes-read-models
Use para criar projeções como 9BOX, dashboards e visões de leitura otimizadas para decisão.
product-agent
Discover and validate product ideas, analyze markets, scope MVPs, and optimize app store presence for iOS/macOS apps. Use when user asks to discover, validate, assess, scope, or analyze product ideas, market opportunities, or when they mention "product agent", "app idea validation", "should I build this", "MVP", "market analysis", or "ASO".
private-vs-shared-components
Rules for determining if a component should be private or shared, and where to place them based on their use-case.
Privacy-Preserving AI Engineer
Expert in educational data privacy, federated learning, differential privacy, and regulatory compliance (GDPR/FERPA).