JSDoc Generator for Openclaw

Automatically add JSDoc or TSDoc comments to your exported functions and classes using AI.

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 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 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 JSDoc Generator?

The JSDoc Generator is a zero-configuration CLI utility designed to solve the problem of undocumented codebases. By analyzing function signatures and logic, it automatically injects professional documentation comments without altering your actual code execution. It serves as an essential component of the Openclaw Skills ecosystem for maintaining clean, readable, and IDE-friendly projects.

Whether you are dealing with legacy code or preparing a library for public release, this tool streamlines the documentation process. It supports both standard JSDoc and TypeScript-focused TSDoc styles, ensuring your exports are well-described with parameters, return values, and exceptions for better team collaboration and onboarding.

JSDoc Generator Use Cases

  • Legacy codebases with zero documentation that need immediate onboarding support.
  • Preparing a private project for an open-source release or public consumption.
  • Improving IDE IntelliSense hints and developer experience for large engineering teams.
  • Standardizing documentation styles across a multi-repository environment using Openclaw Skills standards.

How JSDoc Generator Works

  1. The tool scans specified files, directories, or glob patterns to identify exported functions, classes, and types.
  2. It parses function signatures, identifying parameters, return types, and potential logic-driven exceptions.
  3. An AI engine analyzes the context of the code to infer the specific purpose and behavior of each export.
  4. Standardized JSDoc or TSDoc blocks are generated and injected directly into the source file above the relevant code.
  5. The original code logic and formatting remain entirely untouched throughout the process.

JSDoc Generator Setup

Ensure you have Node.js 18 or higher installed and an OpenAI API key available in your environment variables. You do not need to install the package globally; it can be run directly via npx.

# Set your API key
export OPENAI_API_KEY='your_api_key_here'

# Run a preview on your source directory
npx ai-docs src/ --style jsdoc

# Apply changes to files directly
npx ai-docs src/ --style tsdoc --write

JSDoc Generator Data Schema & Taxonomy

The JSDoc Generator organizes its output by injecting structured metadata directly into your source files. It follows the standard documentation taxonomy for JavaScript and TypeScript.

Attribute Description
Supported Formats JSDoc, TSDoc
Target Elements Exported functions, classes, interfaces, and methods
Metadata Tags @param, @returns, @throws, @example
File Extensions .js, .ts, .jsx, .tsx
Scope Analysis is restricted to exported members to minimize noise

JSDoc Generator Advanced Features

  • Dry-run mode allowed by default to preview documentation changes before writing to disk.
  • Robust support for complex glob patterns to target specific modules or exclude directories.
  • Intelligent parameter inference based on variable naming conventions and internal logic usage.
  • Seamless integration into automated developer workflows as part of the broader Openclaw Skills toolkit.
  • Zero-config architecture that requires no local configuration files to start generating docs.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*