jsdoc
Skill147 starsChanged 23 days agoMITView on GitHub
Use this skill to automatically write or fix JSDoc comments for JavaScript/TypeScript code. It handles requests to document code at any scope: a single function, all functions in a file, or just the new and changed functions in a pull request.
We split this skill into the rules it gives an agent
9 rules. 0 are common, 4 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Add JSDoc to functions UNLESS the code is entirely self-explanatory or the function is named so clearly that a comment would be redundant.
- Distinctive: line 15
If in doubt, lean towards adding JSDoc if the function has complex logic or multiple parameters, but skip it for simple getters/setters or …
- Distinctive: line 20
When generating JSDoc comments, you MUST strictly adhere to the following rules:
- Very specific: line 22
Follow JSDoc Specification: Use standard block comment format (/ ...
- Very specific: line 23
Document all inputs: Use the @param tag for every parameter.
- Very specific: line 24
Document the output: Use the @returns tag for the return value (unless the function returns void and it's obvious).
- Very specific: line 25
Document errors: If the function explicitly throws an error (e.g., throw new Error(...)), document it using the @throws tag.
- Distinctive: line 61
If the user asks to apply JSDoc to all functions in a file, process every function, but remember to skip those that are trivial and …
- Very specific: line 62
If the user asks to apply JSDoc to all changed files in a PR, use the GitHub CLI (gh pr diff or similar) to identify which functions were …
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Jsdoc generation skill
This skill guides the agent in adding or updating JSDoc comments for functions in TypeScript codebases.
When to add jsdoc
- Add JSDoc to functions UNLESS the code is entirely self-explanatory or the function is named so clearly that a comment would be redundant.
- If in doubt, lean towards adding JSDoc if the function has complex logic or multiple parameters, but skip it for simple getters/setters or obvious utilities.
- For existing functions that already have JSDoc, ONLY update the JSDoc if there is a typo or if it no longer reflects the code's intent. Do NOT make redundant rephrasings or meaningless sentence shifts.
Jsdoc requirements
When generating JSDoc comments, you MUST strictly adhere to the following rules:
- Follow JSDoc Specification: Use standard block comment format (
/** ... */). - Document all inputs: Use the
@paramtag for every parameter. - Document the output: Use the
@returnstag for the return value (unless the function returnsvoidand it's obvious). - Document errors: If the function explicitly throws an error (e.g.,
throw new Error(...)), document it using the@throwstag. - NO Type Tags: The codebase uses TypeScript, so do NOT include types in the JSDoc tags. For example, use
@param id The user IDinstead of@param {string} id The user ID. - Imperative Verb Form: The description MUST use the imperative verb form. For example, use "Create a user", "Add an item", "Calculate the total" instead of "Creates a user", "Adds an item", "Calculates the total".
- No Trailing Periods in Tags: Descriptions inside
@param,@returns, and@throwstags must NOT end with a period. The main function description may end with a period, but tag descriptions should remain concise and period-free.
Example
Input:
export function calculateDiscountedPrice(basePrice: number, discountPercentage: number, taxRate?: number): number {
if (basePrice < 0) throw new Error("Price cannot be negative");
// ...
}Output:
/**
* Calculate the final price after applying a discount and optional tax.
*
* @param basePrice The original price of the item
* @param discountPercentage The discount to apply as a percentage (e.g., 20 for 20%)
* @param taxRate The optional tax rate to apply after discount
* @returns The final calculated price
* @throws An error if the base price is negative
*/
export function calculateDiscountedPrice(basePrice: number, discountPercentage: number, taxRate?: number): number {
if (basePrice < 0) throw new Error("Price cannot be negative");
// ...
}Applying to multiple functions
- If the user asks to apply JSDoc to all functions in a file, process every function, but remember to skip those that are trivial and self-explanatory.
- If the user asks to apply JSDoc to all changed files in a PR, use the GitHub CLI (
gh pr diffor similar) to identify which functions were added or modified, and only update those functions.
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- ivklgn/ai-kit★ 12same name
- ivklgn/bag-of-skills★ 12same name
- stijnvanhulle/agents★ 1same name
- CorentinGC/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- skills/typescript/AGENTS.mdAGENTS.md
- .agents/platforms/copilot-instructions.mdCopilot instructions
- arkenvSkill
- bulletproof-reactSkill
- changesetSkill
- code-reviewSkill
- create-skillSkill
- diagnoseSkill
- docs-writerSkill
- excalidrawSkill
- forward-portSkill
- gh-cliSkill
- grill-meSkill
- grill-with-docsSkill
- groom-issueSkill
- hallmarkSkill
- hexagonal-architectureSkill
- improve-codebase-architectureSkill
- internalize-skillSkill
- modularizeSkill
- next-best-practicesSkill
- nuxtSkill
- pnpmSkill
- point-latest-at-rcSkill
- rename-skillSkill
- setup-matt-pocock-skillsSkill
- sync-mainSkill
- tackle-issueSkill
- tddSkill
- the-hatSkill
- the-voiceSkill
- to-prdSkill
- triageSkill
- turborepoSkill
- typescriptSkill
- write-a-skillSkill
- write-issueSkill
- zoom-outSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

