AI Documentation Generator
JSDoc/TSDoc from code — on-device WebLLM
Source
Examples
Typed function
export function parseDuration(input: string): numberA fully typed signature — the model documents the params and the return value.
Options object
interface FetchOptions { retries?: number; timeoutMs?: number; signal?: AbortSignal }Optional members become @property lines; verify any defaults it claims.
Class method
class Cache { get(key: string): string | undefined { /* … */ } }Method docs including the undefined-on-miss case.
About this tool
JSDoc/TSDoc blocks from source code — on-device WebLLM.
How to use
Paste typed source
A function signature with parameter and return types gives the best docs.
Pick a model
Quality (1.5B) keeps @param names aligned with the signature.
Generate
Get a JSDoc/TSDoc block you can paste above the declaration.
Edit descriptions
Adjust wording and add @defaultValue or @throws only where you verified them.
Use cases
Backfilling docs
Generate first-pass JSDoc for legacy helpers that never got documented.
Consistent style
Uniform @param/@returns blocks across a team's codebase.
Public API docs
TSDoc comments for library entry points, drafted in seconds.
Common mistakes
Mistake:Documenting untyped code and expecting precise types.
Fix:Add TypeScript types (or JSDoc types) to the input first — the model mirrors what it sees.
Mistake:Accepting hallucinated defaults and throws.
Fix:Check every @defaultValue and @throws against the implementation.
Mistake:Docs that restate the implementation.
Fix:Edit toward the contract — what it does and when to call it, not a line-by-line narration.
Frequently asked questions
References & standards
Related tools
AI Code Explainer
Explain code snippets with on-device WebLLM
AI Commit Message Generator
Suggest Conventional Commits messages from a git diff using on-device WebLLM
AI Regex Generator
Turn natural language into a regex pattern with on-device WebLLM
AI SQL Query Generator
Generate SQL from natural language with on-device WebLLM and sql-formatter output
Context Assembler
Combine files and folders into one LLM-ready context block with XML tags, a project tree, ignore filters and a token estimate — like repomix or files-to-prompt, in your browser.
LLM Token Counter
Visualize BPE tokens with color blocks, model selector, and per-request cost estimate