API Docs Generator for Openclaw

A powerful CLI tool that automatically generates clean markdown documentation and OpenAPI specifications by scanning your project route files.

lxgicstudios
v1.0.1
Jan 29, 2026
0
0
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install api-docs-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-docs-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 Docs Generator?

The API Docs Generator is a streamlined utility designed to eliminate the manual labor of documenting APIs. By analyzing your source code route files, it identifies endpoints, HTTP methods, and data shapes to produce human-readable markdown or machine-readable OpenAPI 3.0 specs. This tool is a standout addition to the Openclaw Skills library, helping developers bridge the gap between code and documentation instantly without manual configuration.

It serves as a developer-first solution for maintaining accurate references without the overhead of manual writing. Whether you are dealing with a massive legacy system or a rapidly evolving MVP, this tool ensures your documentation stays in sync with your actual implementation logic.

API Docs Generator Use Cases

  • Documenting inherited legacy codebases that lack existing API specifications.
  • Rapidly generating Swagger UI documentation for MVP projects where speed is critical.
  • Automating documentation updates within CI/CD pipelines to ensure parity with recent code changes.
  • Simplifying the onboarding process for new team members by providing instant, accurate API references.
  • Converting internal route logic into standardized OpenAPI formats for external integration partners.

How API Docs Generator Works

  1. The tool parses the specified directory to locate and read route and handler files.
  2. It extracts structural information including paths, HTTP methods, and relevant handler logic from the source.
  3. Using GPT-4o-mini inference, it determines request and response schemas, parameters, and descriptions based on the code context.
  4. The processed data is formatted into either a Markdown file (API_DOCS.md) or an OpenAPI 3.0 YAML/JSON file.
  5. The final documentation is saved to the designated output path for immediate use in your project.

API Docs Generator Setup

To get started with this skill from the Openclaw Skills ecosystem, ensure you have Node.js 18+ installed. You will also need an OPENAI_API_KEY set in your environment variables.

# Set your API key
export OPENAI_API_KEY='your_api_key_here'

# Run the generator on your routes folder without installation
npx ai-api-docs ./src/routes/

# Generate a specific OpenAPI spec file
npx ai-api-docs ./src/routes/ --format openapi -o spec.yaml

API Docs Generator Data Schema & Taxonomy

The API Docs Generator creates structured files based on your input parameters and code analysis. It maps code structures to documentation schemas as follows:

Component Description
Endpoints Automatically mapped from file paths and route definitions.
HTTP Methods Identified via code analysis (GET, POST, PUT, DELETE, etc.).
Request Shapes Inferred from request body parsing, query params, or TypeScript interfaces.
Response Shapes Extracted from return statements or response helper calls.
Metadata Includes descriptions and summaries generated via AI context analysis.

All generated files follow either standard GitHub-flavored Markdown or the official OpenAPI 3.0 specification.

API Docs Generator Advanced Features

  • Multi-directory scanning to aggregate documentation from complex or distributed project structures.
  • Seamless TypeScript integration to leverage type definitions for higher-fidelity schema extraction.
  • Custom output flags to direct documentation into specific documentation portals or static site folders.
  • Zero-config execution via npx, making it ideal for temporary environments and ephemeral build runners.
  • Intelligent inference of parameter descriptions, providing context that goes beyond basic code comments.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*