API Doc Gen for Openclaw

A developer-centric tool that generates consistent API documentation from code comments and type hints.

shenghoo123-png
v1.0.0
Apr 6, 2026
0
778
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install api-doc-gen

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install api-doc-gen using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is API Doc Gen?

API Doc Gen is an essential utility for modern developers who want to maintain high-quality documentation without the manual overhead. By integrating Openclaw Skills into your workflow, you can automatically extract API definitions from framework-specific code like FastAPI, Flask, or Django DRF. This tool solves the problem of documentation lag, ensuring that your API specifications are always an accurate reflection of your actual codebase while maintaining a professional and standardized style across all your projects.

API Doc Gen Use Cases

  • Generate Markdown documentation for non-technical stakeholders using Openclaw Skills to parse Python or JavaScript code.
  • Automatically create OpenAPI 3.0 (Swagger) specifications for backend services.
  • Synchronize your Postman Collections with your local development environment for rapid debugging.
  • Standardize API response structures across multiple microservices within a team.
  • Batch process entire project directories to create a central, unified API documentation portal.

How API Doc Gen Works

  1. Run the analyze command on your source files or code snippets via the CLI interface.
  2. The system employs Openclaw Skills to scan for route decorators and function signatures within the source code.
  3. Type hints and JSDoc annotations are parsed to determine parameter constraints, optionality, and data types.
  4. The tool applies built-in response templates for common HTTP scenarios like success, created, and authorization errors.
  5. Structured documentation is exported in your preferred format, such as Markdown, YAML, or JSON.

API Doc Gen Setup

To begin using this tool within your development environment, follow these steps:

# Install the necessary requirements
pip install -r requirements.txt

# Analyze a FastAPI project and output Markdown
api-doc-gen analyze main.py --framework fastapi --format markdown

# Generate a Postman collection for an Express.js project
api-doc-gen analyze routes.js --framework express --format postman

# Batch process a directory of API files
api-doc-gen batch ./api/ --framework fastapi --format openapi -o docs/

API Doc Gen Data Schema & Taxonomy

The tool organizes API data into a structured schema to ensure consistency across different output formats:

Data Type Inference Source Output Mapping
Parameter Types Python Type Hints / JSDoc string, integer, number, boolean, array, object
Requirement Status Default Values Required by default, optional if default exists
Endpoint Metadata Framework Decorators Path, HTTP Method, and Description
Response Models Predefined Templates Standardized Code, Data, and Message fields
Validation Formats Comment Keywords email, phone, url, date, datetime

API Doc Gen Advanced Features

  • Multi-format export support including OpenAPI 3.0 (JSON/YAML) and Postman Collections.
  • Deep integration with Openclaw Skills for intelligent parameter and response type inference.
  • Automated batch processing for large-scale API directories and microservice architectures.
  • Custom HTML documentation site generation with template support for team deployments.
  • Built-in standardized response templates for 200, 201, 400, 401, and 500 HTTP status codes.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*