mcpField
J
jsdoc-tsdoc

jsdoc-tsdoc

github.com/claude-dev-suiteDevelopment4647 installsUpdated 2d ago
Repository

About jsdoc-tsdoc

A documentation-writing skill for JavaScript and TypeScript developers. It covers JSDoc and TSDoc purposes, tags, and practices, along with troubleshooting guidance.

Key features

  1. 01Compares JSDoc and TSDoc
  2. 02Explains TSDoc tag categories
  3. 03Shows function and interface documentation patterns
  4. 04Lists documentation anti-patterns and remedies
  5. 05Covers comment and tooling troubleshooting

Use cases

  1. 01Document public TypeScript APIs
  2. 02Align a team on documentation tag usage
  3. 03Troubleshoot missing documentation in an IDE

MCP support

The README points to mcp__documentation__fetch_docs for a JSDoc tag reference; it does not describe how the skill itself connects to MCP.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/claude-dev-suite/claude-dev-suite --skill jsdoc-tsdoc

After installing, type/jsdoc-tsdocin Claude Code to confirm it loaded.

Bundled filesadvanced.md

Details

From the project README

JSDoc & TSDoc Documentation

Full Reference: See advanced.md for JSDoc type annotations in JavaScript, TypeDoc/API Extractor configuration, ESLint plugin setup, and README templates.

Deep Knowledge: Use mcp__documentation__fetch_docs with technology: jsdoc for comprehensive tag reference.

When NOT to Use This Skill

  • Plain JavaScript projects - Use the jsdoc skill for JavaScript-specific JSDoc patterns
  • Code comments (non-API) - TSDoc is for public API documentation, not inline code comments
  • Auto-generated docs from code - Use TypeDoc or API Extractor tools directly

TSDoc vs JSDoc

FeatureJSDocTSDoc
PurposeJS documentation + typesTS documentation only
Type annotations@type, @param {Type}Not needed (use TS types)
StandardizationDe factoFormal standard

Use TSDoc for TypeScript projects - types come from TypeScript, comments describe behavior.

Function Documentation

/**
 * Calculates the total price including tax.
 *
 * @remarks
 * This method uses the default tax rate unless overridden.
 * For international orders, use {@link calculateInternationalPrice} instead.
 *
 * @param basePrice - The pre-tax price in cents
 * @param taxRate - Tax rate as decimal (default: 0.1 for 10%)
 * @returns The total price including tax in cents
 *
 * @throws {@link InvalidPriceError}
 * Thrown if basePrice is negative
 *
 * @example
 * ```typescript
 * const total = calculateTotalPrice(1000, 0.08);
 * console.log(total); // 1080
 * ```
 *
 * @beta
 */
function calculateTotalPrice(basePrice: number, taxRate = 0.1): number {
  if (basePrice < 0) {
    throw new InvalidPriceError('Price cannot be negative');
  }
  return Math.round(basePrice * (1 + taxRate));
}

Interface Documentation

/**
 * Configuration options for the HTTP client.
 *
 * @remarks
 * All timeouts are in milliseconds.
 *
 * @public
 */
interface HttpClientOptions {
  /**
   * Base URL for all requests.
   * @example 'https://api.example.com/v1'
   */
  baseUrl: string;

  /**
   * Request timeout in milliseconds.
   * @defaultValue 30000
   */
  timeout?: number;

  /**
   * Maximum number of retry attempts for failed requests.
   * @defaultValue 3
   */
  maxRetries?: number;
}

All TSDoc Tags

Block Tags
TagUsage
@param name - descriptionParameter documentation
@returns descriptionReturn value description
@throws {Type} descriptionThrown exceptions
@exampleUsage examples (code block)
@remarksExtended description
@seeRelated references
@deprecated reasonMark as deprecated
@defaultValue valueDefault value
@typeParam T - descriptionGeneric type parameter
Modifier Tags
TagMeaning
@publicPart of public API
@internalInternal implementation
@alphaEarly preview, may change
@betaMaturing, API may change
@readonlyRead-only property
@overrideOverrides parent
Inline Tags
TagUsage
{@link Target}Link to symbol
{@link Target | text}Link with custom text
{@inheritDoc Parent.method}Inherit documentation

Anti-Patterns

Anti-PatternWhy It's WrongCorrect Approach
Documenting types in TypeScriptRedundant, types already in signatureDescribe behavior, not types
Copy-pasting function signatureAdds no value, desynchronizesExplain purpose, edge cases, examples
Missing @example for complex APIsUsers don't know how to use itAlways include usage examples
Using @deprecated without migrationUsers don't know what to use instead@deprecated Use {@link newFunction} instead
No @throws documentationUsers don't know what to catchDocument all thrown exceptions

Quick Troubleshooting

IssueDiagnosisSolution
VS Code not showing docs on hoverMalformed JSDoc commentEnsure /** start and proper tag syntax
eslint-plugin-tsdoc errorsInvalid TSDoc syntaxFix tag formatting per TSDoc spec
TypeDoc ignoring commentsWrong comment locationPlace JSDoc directly above declaration
{@link} not resolvingIncorrect symbol referenceUse fully qualified name or import path

Official References

ResourceURL
TSDochttps://tsdoc.org/
JSDochttps://jsdoc.app/
TypeDochttps://typedoc.org/
API Extractorhttps://api-extractor.com/

Comments

Markdown supported