DevTools Logo

AI Documentation Generator

AI Documentation Generator

Cloud AI first with on-device WebLLM fallback

Source

Examples

Typed function

Input
export function parseDuration(input: string): number

A fully typed signature — the model documents the params and the return value.

Options object

Input
interface FetchOptions { retries?: number; timeoutMs?: number; signal?: AbortSignal }

Optional members become @property lines; verify any defaults it claims.

Class method

Input
class Cache { get(key: string): string | undefined { /* … */ } }

Method docs including the undefined-on-miss case.

About this tool

Cloud-generated JSDoc/TSDoc blocks with simple parameter names checked against the submitted source.

How to use this tool

  1. Paste typed source

    A function signature with parameter and return types gives the best docs.

  2. Review cloud processing

    Source is sent to the DevTools server and a selected cloud AI provider; remove secrets before generating.

  3. Generate

    Get a JSDoc/TSDoc block you can paste above the declaration.

  4. 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

JSDoc or TSDoc?

Output uses /** */ blocks with @param and @returns suitable for both JavaScript and TypeScript.

Should I paste docs verbatim?

Treat output as a draft — verify parameter names and types against your codebase.

References & standards