arabelatso/skills-4-se/api-documentation-generator
- community
Checking that the SKILL.md file is still in the repository.
Generate comprehensive API documentation from repository sources including OpenAPI specs, code comments, docstrings, and existing documentation. Use when documenting APIs, creating API reference guides, or summarizing API functionality from codebases. Extracts endpoint details, request/response schemas, authentication methods, and generates code examples. Triggers when users ask to document APIs, generate API docs, create API reference, or summarize API endpoints from a repository.
Install
npx vskill@latest install arabelatso/skills-4-se/api-documentation-generatorSKILL.md
API Documentation Generator
Overview
Analyze a repository to extract and generate comprehensive API documentation, including endpoints, request/response schemas, authentication, and usage examples organized in a clear, multi-file structure.
Workflow
1. Discover API Information Sources
Scan the repository to identify all sources of API information:
Primary sources (in priority order):
- OpenAPI/Swagger specifications (
.yaml,.yml,.json)
- Look in: root directory,
/docs,/api,/spec,/openapi - Files named:
openapi.yaml,swagger.json,api-spec.yaml, etc.
- Code files with docstrings/comments
- Python: Flask/FastAPI route decorators, docstrings
- JavaScript/TypeScript: Express routes, JSDoc comments
- Java: Spring annotations, Javadoc
- Go: HTTP handler comments
- Ruby: Rails routes, YARD comments
- Existing documentation
- Markdown files in
/docs,/documentation,/api-docs - README files with API sections
- Wiki pages or doc site content
- Configuration files
routes.rb,urls.py,routes.js- API gateway configurations
Discovery approach:
2. Extract API Information
Based on discovered sources, extract key information:
From OpenAPI Specs
Parse YAML/JSON to extract:
- Base URL and server information
- All paths and operations (GET, POST, PUT, PATCH, DELETE)
- Request parameters (path, query, header, body)
- Response schemas and status codes
- Authentication/security schemes
- Data models/schemas
- Tags and operation groupings
From Code Comments/Docstrings
Look for patterns like:
Python (FastAPI/Flask):
JavaScript (Express):
Extract:
- HTTP method and path
- Description from docstring/comment
- Parameters and types
- Return types
- Example usage if present
From Existing Documentation
Parse markdown files to extract:
- Endpoint descriptions
- Request/response examples
- Authentication details
- Rate limiting information
- Error codes
3. Organize Documentation Structure
Create a multi-file documentation structure organized by resource or API area:
Grouping strategy:
- Group by resource (users, products, orders)
- Group by OpenAPI tags if available
- Group by URL prefix if no tags
- Keep authentication, errors, and models separate
4. Generate Documentation Files
For each file, use the template from assets/api-doc-template.md as a guide.
README.md (Main Overview)
Endpoint Files (e.g., endpoints/users.md)
For each endpoint, document:
Endpoint header:
Request details:
{ "name": "John Doe", "email": "john@example.com", "role": "admin" }
Response details:
{ "id": 123, "name": "John Doe", "email": "john@example.com", "role": "admin", "created_at": "2024-01-15T10:30:00Z" }
Code examples:
curl -X POST "https://api.example.com/v1/users" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_TOKEN" \ -d '{ "name": "John Doe", "email": "john@example.com" }'
import requests
response = requests.post( "https://api.example.com/v1/users", headers={"Authorization": "Bearer YOUR_TOKEN"}, json={ "name": "John Doe", "email": "john@example.com" } )
user = response.json() print(f"Created user: {user['id']}")
Data Models File (models/schemas.md)
Document all data structures:
{ "id": 123, "name": "John Doe", "email": "john@example.com", "role": "user", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" }
Error Reference (errors.md)
{ "error": { "code": "ERROR_CODE", "message": "Human-readable message" } }
5. Include Code Examples
For major use cases, provide complete code examples:
curl -X POST "https://api.example.com/v1/users" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_TOKEN" \ -d '{"name": "John Doe", "email": "john@example.com"}'
import requests
Create user
response = requests.post( "https://api.example.com/v1/users", headers={"Authorization": "Bearer YOUR_TOKEN"}, json={"name": "John Doe", "email": "john@example.com"} )
user_id = response.json()["id"]
Get user details
response = requests.get( f"https://api.example.com/v1/users/{user_id}", headers={"Authorization": "Bearer YOUR_TOKEN"} )
user = response.json() print(f"User: {user['name']} ({user['email']})")
6. Handle Special Cases
No OpenAPI Spec Available
When no OpenAPI spec exists:
- Thoroughly scan code files for route definitions
- Extract information from docstrings and comments
- Infer request/response structure from code
- Note assumptions and recommend validation
Multiple API Versions
When multiple versions exist:
- Document each version separately
- Note differences between versions
- Indicate which version is recommended
- Document migration path if applicable
Incomplete Information
When information is missing:
- Document what's known
- Mark unknown sections with
[To be documented] - Provide best-effort inferences with
(inferred from code) - Suggest improvements to add missing details
GraphQL APIs
For GraphQL:
- Extract schema from
.graphqlfiles or introspection - Document queries, mutations, and subscriptions
- Include example queries with variables
- Document input types and return types
7. Quality Checks
Before finalizing documentation:
- ✅ All endpoints documented with HTTP method and path
- ✅ Request parameters clearly specified (type, required/optional)
- ✅ Response schemas documented with examples
- ✅ Authentication method explained
- ✅ Error responses documented
- ✅ Code examples provided for main operations
- ✅ Files organized logically by resource
- ✅ Links between files work correctly
- ✅ Consistent formatting throughout
- ✅ Base URL and versioning strategy documented
Example Workflows
Example 1: Repository with OpenAPI Spec
User request:
"Generate API documentation for this repository"
Response approach:
- Search for OpenAPI spec files
- Find
openapi.yamlin/docsdirectory - Parse the spec to extract all endpoints, schemas, and auth
- Organize by tags into separate files
- Generate README with overview and navigation
- Create endpoint files for each tag
- Create schemas.md with all data models
- Create errors.md with error codes
- Add code examples in curl and Python
Example 2: Flask API Without Spec
User request:
"Document the API endpoints in this Flask application"
Response approach:
- Search for Flask route decorators (
@app.route,@blueprint.route) - Extract endpoints from route definitions
- Parse docstrings for descriptions and parameter info
- Infer request/response types from function signatures and code
- Organize endpoints by blueprint or URL prefix
- Generate documentation files
- Note inferred information with disclaimers
- Suggest creating OpenAPI spec for better docs
Example 3: Multiple Sources
User request:
"Summarize the API documentation from all available sources"
Response approach:
- Find OpenAPI spec for base structure
- Find existing markdown docs for additional context
- Scan code for endpoints not in spec
- Merge information from all sources
- Prioritize OpenAPI spec for conflicts
- Add code-derived info where spec is incomplete
- Generate unified documentation
- Note sources for each piece of information
Tips for Effective Documentation
Be comprehensive but concise:
- Include all necessary details
- Avoid redundancy across files
- Use tables for structured data
- Use code blocks for examples
Use consistent formatting:
- Same structure for all endpoint docs
- Consistent naming (camelCase vs snake_case)
- Consistent status code documentation
- Consistent example format
Make it navigable:
- Clear table of contents in README
- Links between related sections
- Organized by resource or feature area
- Separate concerns (auth, errors, models)
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/api-documentation-generator/SKILL.md
Popularity
- Repository stars
- 63
- Repository forks
- 5
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 20 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/arabelatso/skills-4-se/api-documentation-generator)