What problem does it solve?
Undocumented or poorly documented code makes onboarding new developers difficult, increases maintenance costs, and hinders collaboration. This Skill guides the generation of high-quality JSDoc comments for ES6 modules, ensuring functions, classes, and exports are clearly explained and easy to understand.
Core Features & Use Cases
- Standardized JSDoc Format: Provides templates and best practices for
@param, @returns, @throws, and @example tags to ensure consistent documentation.
- Automated Analysis: Uses
npm run analyze:jsdoc to identify missing documentation and npm run improve:jsdoc for automatic enhancements, saving manual effort.
- Prioritization Guidance: Helps determine which parts of the codebase (public APIs, complex functions) require the most detailed documentation, focusing your efforts.
- Use Case: After refactoring a complex utility function, activate this Skill to add or update its JSDoc comments. This ensures future developers can quickly understand its purpose, parameters, return values, and potential errors without diving deep into the implementation.
Quick Start
1. Analyze existing JSDoc coverage:
npm run analyze:jsdoc
2. Add JSDoc comments to your function:
/**
- Calculates the sum of two numbers.
- @param {number} a - The first number.
- @param {number} b - The second number.
- @returns {number} The sum of a and b.
- @example
- sum(5, 3); // → 8
*/
function sum(a, b) {
return a + b;
}