jsdoc

Generates and updates JSDoc comments for TypeScript functions following strict formatting rules.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/yamcodes/the-hat --skill jsdoc-yamcodes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: jsdoc
Source: https://github.com/yamcodes/the-hat/tree/main/skills/jsdoc
Command: npx skills add https://github.com/yamcodes/the-hat --skill jsdoc-yamcodes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing consistent JSDoc documentation across a TypeScript codebase is tedious and often inconsistent, with developers forgetting parameters, mixing type annotations into tags, or using inconsistent verb forms. This Skill automates the creation and maintenance of JSDoc comments while enforcing a uniform style. ## Core Features & Use Cases - Scoped Documentation: Add JSDoc to a single function, all functions in a file, or only functions changed in a pull request using the GitHub CLI. - Strict Style Enforcement: Applies imperative verb form, omits TypeScript type annotations in tags, documents @param, @returns, and @throws, and avoids trailing periods in tag descriptions. - Conservative Updates: Only modifies existing JSDoc when there is a typo or the comment no longer reflects the code's intent, avoiding redundant rewrites. - Use Case: Before merging a PR, ask the agent to document all newly added functions so the codebase stays documented without manual effort. ## Quick Start Add JSDoc to all new and changed functions in the current pull request following the project documentation rules.

Frequently Asked Questions about jsdoc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add JSDoc to all functions in a TypeScript file?▼

Ask the agent to update JSDoc for all functions in the target file. It processes every function but skips trivial, self-explanatory ones like simple getters, and writes comments using imperative verbs without type annotations.

How to document only functions changed in a pull request?▼

The Skill uses the GitHub CLI (gh pr diff) to identify functions added or modified in the current PR. It then adds or updates JSDoc only for those functions, leaving untouched code unchanged.

Should JSDoc include type annotations in TypeScript projects?▼

No. In TypeScript codebases, types are already declared in the function signature, so JSDoc tags should omit them. Use '@param id The user ID' instead of '@param {string} id The user ID'.

When should existing JSDoc comments be updated?▼

Existing JSDoc should only be updated when it contains a typo or no longer reflects the code's intent. Redundant rephrasings or meaningless sentence shifts should be avoided to keep diffs clean.

Does the JSDoc skill document thrown errors?▼

Yes. When a function explicitly throws an error, such as throw new Error(...), the Skill adds a @throws tag describing the error condition, alongside @param and @returns tags.