jsdoc-gen
Add JSDoc or TSDoc comments to your code. Use when documentation is missing.
Why use this skill?
Automatically add JSDoc and TSDoc to your exported functions. Improve code readability and IDE support with zero config using this OpenClaw AI tool.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/lxgicstudios/docs-genWhat This Skill Does
The jsdoc-gen skill acts as an automated documentation assistant for your codebase. It scans your files for exported functions, classes, and types, then injects professionally formatted JSDoc or TSDoc comments directly into the source code. Unlike manual documentation, this skill leverages AI to understand the logic and inferred types of your functions, ensuring that parameter descriptions, return values, and potential exceptions are documented accurately without requiring you to write a single line of boilerplate documentation yourself.
Installation
You can integrate this skill into your workflow via the OpenClaw CLI using the following command:
clawhub install openclaw/skills/skills/lxgicstudios/docs-gen
No heavy local installation is required, as the tool functions via npx and a valid OPENAI_API_KEY, making it a lightweight addition to any Node.js environment (Node 18+ recommended).
Use Cases
- Legacy Codebase Revitalization: Perfect for documenting large, undocumented projects where developers have left without leaving behind clear interface definitions.
- Open Source Readiness: Quickly bring your public-facing APIs up to standard before a major release to help external contributors understand your code.
- IDE Efficiency: Ensure that your IDE's IntelliSense provides meaningful hover-over hints for your teammates by providing clear JSDoc descriptions.
- Onboarding Automation: Help new developers understand what specific utility functions do without interrupting senior team members with constant clarification requests.
Example Prompts
- "OpenClaw, use jsdoc-gen on the /src/utils folder and preview the changes in JSDoc style so I can review them before applying."
- "Please run the jsdoc-gen tool on 'api/auth.ts' using TSDoc formatting and write the changes directly to the file."
- "Can you document the entire 'src/services' directory using jsdoc-gen to improve our team's documentation coverage?"
Tips & Limitations
- Review before writing: Always use the
--writeflag only after you have confirmed the preview looks accurate. AI-generated comments are context-aware, but complex business logic might require a quick manual sanity check. - Focus on exports: The tool is designed to prioritize public interfaces. If you have thousands of internal helper functions, consider filtering your execution to keep the codebase clean.
- Environment Variables: Remember to export your
OPENAI_API_KEYin your terminal session, as the tool relies on external AI models to infer the function meanings. - Version Control: It is recommended to run this tool on a clean Git branch so you can easily compare changes using
git diff.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-lxgicstudios-docs-gen": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, external-api
Related Skills
script-gen
Generate package.json scripts with AI. Use when setting up npm scripts.
email-template-gen
Generate responsive email templates. Use when building transactional emails.
branch-namer
Generate descriptive git branch names from plain English. Use when you need a branch name that follows conventions.
cloudflare-gen
Generate Cloudflare Workers configuration and code. Use when building on the edge.
adr-writer
Generate Architecture Decision Records with AI. Use when documenting technical decisions.