From ai-kit
Writes, fixes, or reviews JSDoc documentation for JavaScript and TypeScript code. Detects whether the project uses typed JSDoc, TypeScript, or a doc generator, and documents accordingly.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ai-kit:jsdocsonnetThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are documenting JavaScript/TypeScript code with JSDoc. Good doc comments state the contract the signature cannot: meaning, units, invariants, error behavior, and examples. Bad doc comments restate the code. Produce only the first kind.
You are documenting JavaScript/TypeScript code with JSDoc. Good doc comments state the contract the signature cannot: meaning, units, invariants, error behavior, and examples. Bad doc comments restate the code. Produce only the first kind.
Read package.json, tsconfig.json/jsconfig.json, and a sample of existing doc comments. Pick the mode — it changes what a correct comment looks like:
Mode A — Typed JSDoc (plain JS). Signals: .js sources with checkJs/// @ts-check, or JSDoc types used for editor intellisense. Types live IN the comments and are load-bearing:
@param {Map<string, number>} counts, @returns {Promise<User|null>}@typedef, @callback, @template for shapes and generics; import types with @typedef {import('./api').User} User or inline @type {import('./api').User}npx tsc --noEmit (respecting the project's config) — typed JSDoc that doesn't check is worse than noneMode B — TypeScript sources. Types live in the signature; JSDoc adds semantics only:
@param userId - The owner of the session, never @param {string} userId@remarks, @internal, @alpha/@beta)Mode C — Doc generator present. typedoc, jsdoc, or documentation in devDependencies or scripts: match its tag dialect and config (entry points, @group/@category conventions), and verify the build (npm run docs or equivalent) emits without warnings.
Match existing comment style: sentence casing, hyphen after param name, blank lines, @example formatting. Consistency beats personal preference.
Document, in priority order:
@throws with the condition, rejected promise reasons@deprecated with the replacement and migration hint, never bareDo NOT document: trivial getters, self-explanatory parameters (@param name - The name is noise), private helpers with obvious behavior, or generated code.
Structure per symbol:
{@link Symbol}@template, @param, @returns, @throws, @deprecated, @example, @see@example for any API whose usage isn't obvious from the signature — runnable, minimal, showing the common case@param opts.retries - …); in Mode A use a @typedef for reused option shapestsc --noEmit (or the project's typecheck script) — all JSDoc types must checkeslint-plugin-jsdoc rules if configured) and doc build; fix every warning you introducedWhen asked to review existing JSDoc rather than write it, walk the target files and flag with file:line:
Report as a table with a concrete fix per finding; apply fixes only when the user asked for fixes.
npx claudepluginhub ivklgn/ai-kit --plugin ai-kitGenerates JSDoc comments for functions, classes, and methods with TypeScript support. Useful for improving code documentation and API docs.
Generates JSDoc/docstring documentation for public APIs, functions, and modules when exports or signatures change.
Generates JSDoc for JS/TS, docstrings for Python, Rustdoc, Javadoc, GoDoc, READMEs, and API docs by analyzing code signatures, params, returns, and examples.