jsdoc-tsdoc

v2026.09.24

JSDoc and TSDoc documentation standards. Covers syntax, tags, TypeScript integration, documentation generation, and API documentation best practices. USE WHEN: user mentions "TSDoc", "TypeScript documentation", "API documentation", asks about "documenting TypeScript", "@param", "@returns", "TypeDoc", "API Extractor", "documentation tags" DO NOT USE FOR: JavaScript-only JSDoc - use `jsdoc` skill for plain JavaScript

GitHub
安装命令
npx skhub add claude-dev-suite/jsdoc-tsdoc
Markdown
SKILL.md

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/
发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.24

发布时间

Sep 24, 2026

分类

未分类

许可证

MIT

源路径

skills/documentation/jsdoc-tsdoc

默认分支

main

最新提交

9496306

Tree SHA

fe4e2f1