skillfed

jsdoc-typescript-docs

Add comprehensive JSDoc comments to TypeScript codebases to document functions, interfaces, types, and classes with parameters, return types, and usage examples. Includes patterns for async functions, generics, overloads, and class methods to support automated API documentation generation.

jsdoc-typescript-docs helps you document TypeScript functions and types with JSDoc comments for API documentation.

AI-generated summary based on this skill's SKILL.md

52 8 MIT updated by patricio0312rev

Install

patricio0312rev/skills/jsdoc-typescript-docs

git clone https://github.com/patricio0312rev/skills
cp -r skills/foundation/jsdoc-typescript-docs ~/.claude/skills/jsdoc-typescript-docs
npx skillfed install patricio0312rev/skills/jsdoc-typescript-docs

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I document TypeScript code with JSDoc?

jsdoc-typescript-docs helps you add comprehensive JSDoc comments to TypeScript functions, interfaces, types, and classes. Start by adding JSDoc blocks above declarations using /** */ syntax, documenting parameters with @param tags, return types with @return, and including usage examples. The skill covers patterns for async functions, generics, overloads, and class methods to ensure your documentation is complete and type-safe.

How can I generate API documentation from TypeScript?

jsdoc-typescript-docs integrates with TypeDoc to generate browsable API documentation automatically from your JSDoc comments. TypeDoc reads your annotated TypeScript source files and produces HTML documentation that reflects your function signatures, type definitions, and documented examples. You can configure TypeDoc to customize output format, styling, and which symbols to include in the generated docs.

What JSDoc comments should I use for TypeScript functions?

jsdoc-typescript-docs provides patterns for documenting TypeScript functions with @param tags for each parameter (including type and description), @return or @returns for the return type, @throws for exceptions, and @example for usage samples. For async functions, use @async; for generics, document type parameters with @template; for overloads, document each signature separately. This ensures type-safe inline documentation.

How do I set up TypeDoc configuration and automation?

jsdoc-typescript-docs covers TypeDoc setup through tsconfig.json integration and typedoc.json configuration files. You can automate documentation generation in CI/CD pipelines by running TypeDoc as a build step, enabling watch mode for development, and configuring output directories and plugins like the markdown plugin. This allows you to keep API docs synchronized with code changes automatically.

How should I document TypeScript interfaces and types?

jsdoc-typescript-docs shows how to document interfaces, type aliases, and enums with JSDoc blocks describing their purpose and usage. For interfaces, document each property with @property or inline comments; for type unions, explain each variant; for enums, describe member values. Include @example blocks showing how to use complex types, making your type definitions self-documenting and discoverable.

What are JSDoc best practices for TypeScript?

jsdoc-typescript-docs emphasizes keeping comments concise yet descriptive, using @param and @return consistently, providing @example blocks for complex logic, and validating JSDoc in CI pipelines. Document public APIs thoroughly while keeping internal comments focused. Use @deprecated for obsolete members, @internal for private details, and @see for related symbols to create maintainable, navigable documentation.

SKILL.md

rendered from the published skill — quoted content, verbatim

JSDoc TypeScript Documentation

Create comprehensive inline documentation for TypeScript codebases.

Core Workflow

  1. Document functions: Parameters, returns, examples
  2. Document types: Interfaces, types, enums
  3. Add descriptions: Purpose and usage
  4. Include examples: Code samples
  5. Generate docs: TypeDoc output
  6. Integrate CI: Automated doc generation

Function Documentation

Basic Function
/**
 * Calculates the total price including tax.
 *
 * @param price - The base price before tax
 * @param taxRate - The tax rate as a decimal (e.g., 0.08 for 8%)
 * @returns The total price including tax
 *
 * @example
 * ```typescript
 * const total = calculateTotal(100, 0.08);
 * console.log(total); // 108
 * ```
 */
export function calculateTotal(price: number, taxRate: number): number {
  return price * (1 + taxRate);
}
Async Function

```typescript /** *

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 1 file
foundation/jsdoc-typescript-docs/SKILL.md

Related skills

Tags

code-comments api-reference type-safety doc-generation developer-experience inline-docs markdown-output ci-integration code-examples documentation-automation