tsdoc-jsdoc-authoring

Write and review API documentation comments using TSDoc and JSDoc best practices. Use when the user asks for docs, doc comments, TSDoc, JSDoc, @param/@returns help, or documentation quality improvements in JavaScript or TypeScript code.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "tsdoc-jsdoc-authoring" with this command: npx skills add consentdotio/agent-skills/consentdotio-agent-skills-tsdoc-jsdoc-authoring

TSDoc and JSDoc Authoring

Create high-quality documentation comments for functions, classes, interfaces, types, modules, and exported APIs.

When to Apply

Use this skill when the user asks to:

  • add or improve code comments/docs
  • write TSDoc or JSDoc
  • document params, return values, thrown errors, or examples
  • standardize documentation style across files

Routing (Read This First)

Choose one focused index before loading rule files:

  • TypeScript APIs and typed exports: indexes/tsdoc-index.md
  • JavaScript authoring and shape docs: indexes/jsdoc-authoring-index.md
  • Strict consistency/lint-safe output standards: indexes/jsdoc-consistency-index.md

Rule 1: Choose the Correct Standard

  • Use TSDoc for TypeScript code and typed public APIs.
  • Use JSDoc for JavaScript code or projects using JSDoc tooling.
  • Do not mix tag syntaxes from both standards in one comment block.

Workflow

  1. Read the target file and identify the symbol's purpose and side effects.
  2. Prefer documenting exported/public APIs first.
  3. Write a one-line summary in plain language.
  4. Add only meaningful tags (no empty or redundant tags).
  5. Validate tag names and formatting against the relevant standard.
  6. Ensure comments match actual behavior (inputs, outputs, errors, async behavior).

Authoring Rules (Both Standards)

  • Describe intent and behavior, not obvious implementation details.
  • Keep summaries concise and action-oriented ("Returns...", "Creates...", "Parses...").
  • Document every parameter and explain what each parameter does.
  • If a parameter is an object, document each object property and what it does.
  • Use imperative, consistent phrasing for @param descriptions.
  • Document thrown errors with @throws when behavior depends on error handling.
  • Add @example only when it clarifies non-obvious usage.
  • Do not restate TypeScript types in prose unless it adds semantic meaning.

TSDoc Rules

Use these tags by default when relevant:

  • @param for each function argument
  • @typeParam for generic parameters
  • @returns for return semantics
  • @remarks for longer contextual details
  • @throws for exceptional behavior
  • @example for practical usage
  • @deprecated for migration guidance

TSDoc formatting reminders:

  • Use @param name - Description with a hyphen separator.
  • Prefer inline links with {@link SymbolName}.
  • Keep release tags (@alpha, @beta, @public, @internal) aligned with project policy.
  • For object parameters in TypeScript, prefer a named type or interface and add /** ... */ comments on each property so VS Code hovers/autocomplete show per-property docs.

JSDoc Rules

Use these tags by default when relevant:

  • @param {Type} name (with optional/default forms when needed)
  • @returns {Type} (or @return)
  • @throws {Type} when known
  • @typedef and @property for reusable object shapes
  • @example for usage snippets
  • @async and @yields for async/generator behavior when needed

JSDoc formatting reminders:

  • Optional params: @param {string} [name]
  • Optional with default: @param {string} [name=John Doe]
  • Nested object props: @param {Object} options and @param {string} options.mode

JSDoc Consistency Standard

Apply these rules by default in all JavaScript documentation, regardless of lint setup.

  • Keep @access usage consistent per block (@access <level> or one shorthand access tag).
  • Use @implements only on classes/constructors.
  • Prefer rule-specific guidance from the rules/jsdoc/** files when there is a conflict.

Output Expectations

When updating comments:

  • keep existing project conventions unless user requests a migration
  • preserve behavior accuracy over verbosity
  • avoid adding comments to private/internal symbols unless requested

Additional Reference

For templates and tag cheat sheets, see reference.md.

Rule Files

Use focused indexes to avoid loading unrelated rules:

  • TSDoc index: indexes/tsdoc-index.md
  • JSDoc authoring index: indexes/jsdoc-authoring-index.md
  • JSDoc consistency index: indexes/jsdoc-consistency-index.md

Full Compiled Document

For the full rule index and category guide: AGENTS.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

Repository Source
213.4K23Kvercel
Coding

svelte5-best-practices

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

apify-actor-development

No summary provided by upstream source.

Repository SourceNeeds Review
2.1K-apify
Coding

code-simplifier

No summary provided by upstream source.

Repository SourceNeeds Review