jsdoc

Standardize JSDoc documentation for Shift APIs with YAML frontmatter and verb-phrase summaries.

217|7|Updated Dec 9, 2024
One-click install
npx skills add https://github.com/shift-editor/shift --skill jsdoc-shift-editor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jsdoc
Source: https://github.com/shift-editor/shift/tree/main/.claude/skills/jsdoc
Command: npx skills add https://github.com/shift-editor/shift --skill jsdoc-shift-editor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps prevent unclear or misleading API documentation by turning the real calling contract (ownership, side effects, lifetimes, nullability, and failure modes) into consistently high-signal JSDoc.

Core Features & Use Cases

  • Precise API contracts: Writes one-line, verb-phrase hover summaries that state stable behavior without implementation trivia.
  • Caller-oriented detail: Documents what TypeScript cannot express, including ownership transfer, reactive mutation, JS-only vs NAPI behavior, nullability meaning, ordering, and concurrency context.
  • Tooling-friendly conventions: Enforces correct placement (/** ... */ immediately before the symbol) and standardized tags aligned to jsdoc.app for TypeScript sources.
  • Quality-focused runbook: Provides a structured checklist for audience selection (caller vs renderer vs tool author) and for choosing the minimal necessary dimensions to document.

Quick Start

Ask the assistant to generate or revise JSDoc for a specific exported Shift API so that the hover summary is a single contract sentence and the long details (if needed) go under @remarks.

Frequently Asked Questions about jsdoc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write JSDoc for TypeScript APIs to document side effects and ownership transfer?

To document side effects and ownership transfer in JSDoc, use standardized tags like @remarks and @throws to capture behavioral contracts that TypeScript types cannot express, placing a single verb-phrase summary sentence directly above the exported symbol.

What is the best way to format JSDoc comments for reactive state and nullability in API documentation?

The best way to format JSDoc for reactive state and nullability is enforcing a one-line verb-phrase summary followed by structured tags such as @param, @returns, and @remarks, aligning with jsdoc.app conventions to clarify caller intent and mutation behavior.

How do I document constructor behavior and failure modes in JSDoc for exported classes?

Document constructor behavior and failure modes in JSDoc by placing a /** ... */ block immediately before the class constructor, using a one-line summary and @throws tags to detail explicit error semantics and lifetime expectations for callers.

Do I need JSDoc if my TypeScript API already has strict type definitions for parameters and returns?

You need JSDoc alongside strict TypeScript types because types cannot express caller intent, ordering, concurrency context, or JS-only versus NAPI behavior, requiring structured JSDoc tags like @remarks and @example to fill these specific behavioral contract gaps.

When should I include a runnable @example tag in my API documentation JSDoc?

Include a runnable @example tag in JSDoc when the API involves complex reactive state, domain data structures, or error semantics where a literal code snippet is necessary to demonstrate stable behavior and prevent caller misunderstanding.

Can I use standard JSDoc tags to document ordering and concurrency context for developer tooling?

Yes, you can use standard JSDoc tags to document ordering and concurrency context for developer tooling by applying @remarks to detail the specific execution sequence and concurrency expectations that TypeScript signatures fail to capture.