OpenAPI Spec Generator for Openclaw

An automated tool that turns raw API code, HAR traffic logs, and packet captures into production-ready, validated OpenAPI 3.x specifications.

harrylabsj
v1.0.0
Jun 18, 2026
0
412
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install openapi-spec-generator

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 openapi-spec-generator 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 OpenAPI Spec Generator?

The OpenAPI Spec Generator is a sophisticated tool designed to bridge the gap between running APIs and their documentation. This skill analyzes multiple input sources—ranging from backend source code (Go, Java, Python, Node.js) to traffic captures like HAR files, Charles Proxy logs, and PCAP data—to automatically reverse-engineer and structure comprehensive OpenAPI 3.x specifications. By automating endpoint discovery, parameter classification, schema inference, and authentication extraction, it eliminates hours of tedious manual drafting.

As part of the expanding library of Openclaw Skills, this tool integrates seamless interactive refinement, allowing developers to review, validate, and polish their API specifications recursively. Whether you are documenting legacy systems, standardizing microservice architectures, or reverse-engineering third-party integrations, it provides a secure, local-first workflow that ensures structural validity and strict compliance with best practices.

OpenAPI Spec Generator Use Cases

  • Documenting undocumented legacy code bases by extracting routes from Gin, Spring, FastAPI, or Express.
  • Reverse-engineering undocumented third-party APIs using captured browser HAR files or Charles Proxy logs.
  • Standardizing API design across distributed microservices by identifying naming and structural inconsistencies.
  • Generating mock servers using Prism configurations for rapid parallel frontend development and immediate API simulation.
  • Validating existing OpenAPI specs against official specifications and best-practice rules.

How OpenAPI Spec Generator Works

  1. Source Ingestion: The skill accepts local code repositories, HAR network logs, Charles Proxy logs, Wireshark PCAP files, or natural language descriptions.
  2. Endpoint Discovery: It scans frameworks for route patterns and clusters matching structures to abstract paths into parameterized templates (e.g., grouping /users/1 and /users/2 into /users/{id}).
  3. Schema & Auth Inference: Automatically extracts request/response payloads, infers JSON Schemas (detecting types, nullables, enums, formats), and identifies authentication schemes (Bearer JWT, API Key, Basic Auth, etc.).
  4. Interactive Refinement: Generates a draft spec and guides the developer through a refinement loop to confirm types, add descriptions, override parameters, and resolve warnings.
  5. Validation & Export: Runs the spec through an official OpenAPI validator, evaluates design best practices, and exports a finalized YAML/JSON spec along with optional mock server configurations.

OpenAPI Spec Generator Setup

To start using this skill within your Openclaw Skills workspace, follow these basic CLI steps. Ensure you have the required parser dependencies installed locally.

# Step 1: Install the OpenAPI Spec Generator package or CLI helper
npm install -g @openclaw/openapi-spec-generator-cli

# Step 2: Scan your target API codebase to discover endpoints
openapi-gen.sh scan ~/projects/user-service/

# Step 3: Infer schema structures and compile configuration
openapi-gen.sh infer ~/projects/user-service/

# Step 4: Generate the validated OpenAPI 3.x specification file
openapi-gen.sh generate ~/projects/user-service/ --output openapi.yaml

OpenAPI Spec Generator Data Schema & Taxonomy

The generator organizes schemas and exports clean OpenAPI standard documents alongside diagnostic outputs:

File / Directory Format Description
openapi.yaml / openapi.json YAML / JSON The primary validated OpenAPI 3.0.3 spec document, fully structured with path methods, schemas, parameters, and auth mechanisms.
prism-config.yml YAML Optional configurations for running immediate API simulation servers based on the generated spec.
docker-compose.yml YAML Optional containerized setup to launch a local mock server using the generated specification.
.openapi-gen-cache/ Local Directory Local temporary folder used to store intermediary AST analysis and sanitized traffic data during schema inference.

OpenAPI Spec Generator Advanced Features

  • AST-Based Fallback Scanning: Analyzes Abstract Syntax Trees for route discovery when non-standard or custom frameworks are used.
  • Automatic Secrets Redaction: Scrubs sensitive tokens, passwords, and API keys, replacing them with safe placeholders during traffic log parsing.
  • Local-First Architecture: Guarantees total data privacy by executing all code parsing, HAR analysis, and schema compilation strictly on the host system.
  • Automated Mock Server Bootstrapping: Generates instant Prism configurations and docker-compose configurations to accelerate frontend and backend integration tasks.
  • Cross-Service Standardization: Integrates multi-service comparison options to catch casing differences, missing health checks, or inconsistent response pagination styles.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*