| name | jsdoc-tsdoc |
| description | JavaScript and TypeScript documentation generation using JSDoc and TSDoc. Parse source code, generate API documentation, validate coverage, and integrate with TypeDoc for comprehensive developer documentation. |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep |
| backlog-id | SK-014 |
| metadata | {"author":"babysitter-sdk","version":"1.0.0"} |
| graph | {"domains":["domain:software-engineering"],"specializations":["specialization:technical-documentation"],"skillAreas":["skill-area:api-doc-generation","skill-area:docs-as-code"],"roles":["role:technical-writer","role:documentation-engineer"]} |
JSDoc/TSDoc Skill
Generate and validate JavaScript and TypeScript documentation using industry-standard JSDoc and TSDoc conventions with TypeDoc integration.
Capabilities
- Parse JSDoc comments from JavaScript source code
- Parse TSDoc comments from TypeScript source code
- Generate API documentation with TypeDoc
- Validate documentation coverage and completeness
- Enforce documentation standards with ESLint plugins
- Support custom JSDoc/TSDoc tags
- Type inference and documentation alignment
- Generate multiple output formats (HTML, Markdown, JSON)
Usage
Invoke this skill when you need to:
- Document JavaScript/TypeScript libraries and APIs
- Generate API reference documentation
- Audit documentation coverage
- Set up automated documentation pipelines
- Validate doc comments match implementation
Inputs
| Parameter | Type | Required | Description |
|---|
| projectPath | string | Yes | Root path of the JS/TS project |
| entryPoints | array | No | Specific files/directories to document |
| outputDir | string | No | Documentation output directory (default: docs) |
| outputFormat | string | No | html, markdown, json (default: html) |
| includePrivate | boolean | No | Include private members (default: false) |
| coverageThreshold | number | No | Minimum documentation coverage % |
| customTags | array | No | Additional JSDoc/TSDoc tags to recognize |
Input Example
{
"projectPath": "./packages/babysitter-sdk",
"entryPoints": ["src/index.ts", "src/client.ts"],
"outputDir": "docs/api",
"outputFormat": "html",
"coverageThreshold": 80,
"customTags": ["@alpha", "@beta", "@experimental"]
}
Output Structure
docs/api/
├── index.html # Documentation home
├── modules.html # Module index
├── classes/
│ ├── Client.html # Class documentation
│ └── Config.html
├── interfaces/
│ ├── Options.html # Interface documentation
│ └── Response.html
├── functions/
│ └── helpers.html # Function documentation
├── types/
│ └── aliases.html # Type alias documentation
├── assets/
│ ├── main.js
│ └── style.css
└── coverage.json # Documentation coverage report
JSDoc Comment Patterns
Function Documentation
async function authenticate(username, password) {
}
Class Documentation
class ApiClient extends EventEmitter {
constructor(options) {
}
async get(path, options) {
}
}
TSDoc Comment Patterns
Package Documentation
Function with Overloads
export async function fetch<T>(url: string): Promise<T>;
export async function fetch<T>(url: string, options: FetchOptions): Promise<T>;
Interface Documentation
export interface ClientConfig {
baseUrl: string;
timeout?: number;
retries?: number;
headers?: Record<string, string>;
}
TypeDoc Configuration
typedoc.json
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": ["src/index.ts"],
"out": "docs/api",
"name": "My SDK",
"readme": "README.md",
"includeVersion": true,
"excludePrivate": true,
"excludeProtected": false,
"excludeInternal": true,
"excludeExternals": true,
"categorizeByGroup": true,
"categoryOrder": [
"Client",
"Configuration",
"Types",
"Utilities",
"*"
],
"navigation": {
"includeCategories": true,
"includeGroups": true
},
"plugin": [
"typedoc-plugin-markdown"
],
"theme": "default",
"validation": {
"notExported": true,
"invalidLink": true,
"notDocumented": false
}
}
ESLint Documentation Rules
{
"plugins": ["jsdoc"],
"extends": ["plugin:jsdoc/recommended-typescript"],
"rules": {
"jsdoc/require-jsdoc": ["warn", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true,
"ArrowFunctionExpression": false
},
"publicOnly": true
}],
"jsdoc/require-description": "warn",
"jsdoc/require-param-description": "warn",
"jsdoc/require-returns-description": "warn",
"jsdoc/check-tag-names": ["error", {
"definedTags": ["alpha", "beta", "experimental", "internal"]
}],
"jsdoc/check-types": "error",
"jsdoc/no-undefined-types": "error",
"jsdoc/valid-types": "error"
}
}
Coverage Analysis
Coverage Report Format
{
"summary": {
"documented": 145,
"undocumented": 23,
"total": 168,
"percentage": 86.31
},
"byKind": {
"class": { "documented": 12, "total": 14 },
"interface": { "documented": 28, "total": 30 },
"function": { "documented": 45, "total": 52 },
"method": { "documented": 60, "total": 72 }
},
"undocumented": [
{
"name": "internalHelper",
"kind": "function",
"file": "src/utils/helpers.ts",
"line": 42
}
],
"incomplete": [
{
"name": "processData",
"kind": "function",
"file": "src/core/processor.ts",
"issues": ["missing @returns", "missing @param for 'options'"]
}
]
}
Workflow
- Analyze project - Scan for TypeScript/JavaScript files
- Parse documentation - Extract JSDoc/TSDoc comments
- Validate coverage - Check against threshold
- Type alignment - Verify docs match TypeScript types
- Generate documentation - Run TypeDoc or JSDoc
- Create coverage report - Output coverage analysis
- Lint validation - Run ESLint documentation rules
Dependencies
{
"devDependencies": {
"typedoc": "^0.25.0",
"typedoc-plugin-markdown": "^4.0.0",
"eslint-plugin-jsdoc": "^48.0.0",
"@microsoft/tsdoc": "^0.14.0",
"@microsoft/tsdoc-config": "^0.16.0"
}
}
Best Practices Applied
- TSDoc for TypeScript, JSDoc for JavaScript
- Always document public API surface
- Include @example for complex functions
- Use @remarks for implementation notes
- Link related symbols with @see
- Mark experimental features with @alpha/@beta
- Validate types match documentation
References
Target Processes
- api-doc-generation.js
- sdk-doc-generation.js
- docs-audit.js
- docs-testing.js