Generate comprehensive JSDoc documentation and inline comments for TypeScript/JavaScript code. Use when users need API documentation, function documentation, module headers, type definitions, or internal developer documentation. Covers TSDoc, JSDoc, and best practices for maintainable code comments.
/plugin marketplace add leobrival/topographic-studio-plugins/plugin install code-workflows@topographic-studio-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/comments/comment-patterns.tsassets/comments/section-markers.tsassets/comments/todo-format.tsassets/config/jsdoc.jsonassets/config/typedoc.jsonassets/jsdoc/class-template.tsassets/jsdoc/file-header.tsassets/jsdoc/function-template.tsassets/jsdoc/interface-template.tsreferences/comment-practices.mdreferences/doc-generation.mdreferences/jsdoc-guide.mdreferences/tsdoc-standard.mdComplete documentation toolkit for TypeScript/JavaScript projects: JSDoc, TSDoc, inline comments, and documentation generation.
User request → What type of documentation?
│
├─ Function/Method Documentation
│ ├─ JSDoc → Standard JavaScript documentation
│ ├─ TSDoc → TypeScript-enhanced documentation
│ └─ Inline comments → Logic explanation
│
├─ Module/File Documentation
│ ├─ File header → Purpose, author, license
│ ├─ Module overview → Architecture, exports
│ └─ Dependency notes → Why each import
│
├─ Type Documentation
│ ├─ Interface docs → Property descriptions
│ ├─ Type alias docs → Purpose and usage
│ └─ Enum docs → Value explanations
│
├─ Class Documentation
│ ├─ Class overview → Purpose, responsibilities
│ ├─ Constructor docs → Parameters, initialization
│ └─ Method docs → Behavior, side effects
│
└─ Code Comments
├─ TODO/FIXME → Task tracking
├─ HACK/WARNING → Technical debt
└─ Logic comments → Why, not what
/**
* Calculates the total price including tax and discounts.
*
* @description Applies discount first, then calculates tax on the discounted amount.
* Tax is calculated based on the user's billing address country.
*
* @param items - Array of cart items with quantity and unit price
* @param discount - Discount percentage (0-100)
* @param taxRate - Tax rate as decimal (e.g., 0.20 for 20%)
* @returns The final price rounded to 2 decimal places
*
* @throws {ValidationError} If discount is negative or greater than 100
* @throws {EmptyCartError} If items array is empty
*
* @example
* ```typescript
* const total = calculateTotal(
* [{ quantity: 2, unitPrice: 50 }],
* 10, // 10% discount
* 0.20 // 20% tax
* );
* // Returns: 108.00 (100 - 10% = 90, + 20% tax = 108)
* ```
*
* @see {@link applyDiscount} for discount logic
* @see {@link calculateTax} for tax calculation
*
* @since 1.2.0
* @category Pricing
*/
function calculateTotal(
items: CartItem[],
discount: number,
taxRate: number
): number {
// Implementation
}
/**
* Represents a user in the system.
*
* @description Contains all user profile information and authentication status.
* Used throughout the application for user-related operations.
*
* @example
* ```typescript
* const user: User = {
* id: "usr_123",
* email: "user@example.com",
* profile: { firstName: "John", lastName: "Doe" },
* createdAt: new Date(),
* };
* ```
*/
interface User {
/** Unique identifier (format: usr_xxxxx) */
id: string;
/** User's email address (validated, unique) */
email: string;
/** User profile information */
profile: {
/** User's first name */
firstName: string;
/** User's last name */
lastName: string;
/** Optional avatar URL */
avatarUrl?: string;
};
/** Account creation timestamp */
createdAt: Date;
/** Last login timestamp (null if never logged in) */
lastLoginAt?: Date | null;
}
/**
* @fileoverview User authentication service
*
* Handles all authentication flows including:
* - Email/password login
* - OAuth providers (Google, GitHub)
* - Session management
* - Token refresh
*
* @module services/auth
* @requires @/lib/prisma - Database client
* @requires @/lib/jwt - JWT utilities
*
* @example
* ```typescript
* import { AuthService } from "@/services/auth";
*
* const auth = new AuthService();
* const session = await auth.login(email, password);
* ```
*
* @author Development Team
* @since 1.0.0
* @license MIT
*/
// BAD: Describes what the code does (obvious)
// Loop through users and filter active ones
const activeUsers = users.filter((u) => u.isActive);
// GOOD: Explains why this approach was chosen
// Filter in memory instead of DB query because the user count
// is always < 100 and this avoids an additional round trip
const activeUsers = users.filter((u) => u.isActive);
// GOOD: Documents business logic
// Users inactive for 90+ days are considered churned per
// the retention policy defined in RETENTION.md
const churnedUsers = users.filter(
(u) => daysSinceLastLogin(u) > 90
);
// GOOD: Warns about non-obvious behavior
// WARNING: This mutates the original array for performance.
// Clone the array first if you need to preserve it.
sortInPlace(items);
// GOOD: Explains workaround
// HACK: Safari doesn't support requestIdleCallback, so we
// polyfill with setTimeout. Remove when Safari adds support.
// Tracking: https://bugs.webkit.org/show_bug.cgi?id=164193
const scheduleIdle = window.requestIdleCallback ?? ((cb) => setTimeout(cb, 1));
assets/
├─ jsdoc/
│ ├─ function-template.ts # Function documentation template
│ ├─ class-template.ts # Class documentation template
│ ├─ interface-template.ts # Interface/type documentation
│ └─ file-header.ts # File header template
├─ comments/
│ ├─ comment-patterns.ts # Standard comment patterns
│ ├─ todo-format.ts # TODO/FIXME conventions
│ └─ section-markers.ts # Code section markers
└─ config/
├─ jsdoc.json # JSDoc configuration
└─ typedoc.json # TypeDoc configuration
| Tag | Purpose | Example |
|---|---|---|
@param | Parameter description | @param name - User's name |
@returns | Return value description | @returns The calculated total |
@throws | Exception documentation | @throws {Error} If invalid |
@example | Usage example | @example \``ts code ```` |
@see | Cross-reference | @see {@link otherFunc} |
@since | Version introduced | @since 1.2.0 |
@deprecated | Deprecation notice | @deprecated Use newFunc instead |
@category | Group in docs | @category Utilities |
@internal | Internal API marker | @internal |
@alpha/@beta | Stability marker | @beta |
@readonly | Immutable property | @readonly |
@override | Method override | @override |
@virtual | Can be overridden | @virtual |
@sealed | Cannot be overridden | @sealed |
@typeParam | Generic parameter | @typeParam T - Item type |
@defaultValue | Default value | @defaultValue 100 |
@remarks | Additional notes | @remarks Thread-safe |
@privateRemarks | Internal notes | @privateRemarks TODO: optimize |
// TODO: Task to be completed
// TODO(username): Assigned task
// TODO(#123): Linked to issue
// FIXME: Known bug that needs fixing
// FIXME(urgent): High priority fix
// HACK: Temporary workaround
// HACK(browser): Browser-specific hack
// WARNING: Important caveat
// NOTE: Important information
// REVIEW: Needs code review
// OPTIMIZE: Performance improvement needed
// REFACTOR: Code quality improvement needed
// DEPRECATED: Will be removed
// @deprecated Use newFunction() instead
// ============================================================
// Public API
// ============================================================
// ------------------------------------------------------------
// Helper Functions
// ------------------------------------------------------------
// #region Authentication
// ... code ...
// #endregion
/* ************************************************************
* SECTION: Database Operations
* Description: All database-related functions
************************************************************ */
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.