Claude-skill-registry jsdoc
Guidelines for writing minimal, high-quality JSDoc comments in TypeScript.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/jsdoc-kubb-labs-fabric" ~/.claude/skills/majiayu000-claude-skill-registry-jsdoc && rm -rf "$T"
manifest:
skills/data/jsdoc-kubb-labs-fabric/SKILL.mdsource content
JSDoc Skill
This skill provides simple, focused guidelines for writing JSDoc comments in TypeScript codebases.
When to Use
- Documenting type properties and configuration options
- Adding context that TypeScript types don't convey
- Providing usage examples for complex APIs
- Writing inline documentation for generated docs
What It Does
- Defines simple JSDoc conventions for TypeScript
- Focuses on property-level documentation with inline comments
- Uses minimal tags for maximum clarity (
,@default
,@example
)@note - Avoids redundant tags that duplicate TypeScript type information
- Ensures consistent documentation style across the codebase
How to Use
Write inline JSDoc comments directly above properties, focusing on what the option does rather than repeating type information.
Basic Structure
export type Options = { /** * Brief description of what this property does. * @default 'defaultValue' */ propertyName?: string }
Common Tags
Use Frequently
| Tag | Purpose | Example |
|---|---|---|
| Default value | |
| Usage example | |
| Important caveat | |
| Mark as deprecated | |
Use Sparingly
| Tag | Purpose | Example |
|---|---|---|
| Reference docs | |
| Internal API | |
| Experimental | |
Avoid (TypeScript Provides)
- ❌
- Use TypeScript parameters@param - ❌
- Use TypeScript return type@returns - ❌
- Use TypeScript type annotation@type - ❌
- Use@typedef
ortypeinterface
Documentation Patterns
Simple Property
/** Output directory for generated files. */ outDir?: string
Property with Default
/** * Set a suffix for generated files. * @default 'generated' */ suffix?: string
Enum with Options
/** * Choose output format. * - 'type' generates type aliases * - 'interface' generates interfaces * @default 'type' */ format?: 'type' | 'interface'
Property with Example
/** * Server index to use. * @example * - `0` returns production URL * - `1` returns development URL */ serverIndex?: number
Nested Properties
transformers?: { /** Customize file names. */ name?: (name: string) => string /** Customize output paths. */ path?: (path: string) => string }
Function Documentation
Only add JSDoc when it adds value beyond the signature:
// ✅ No JSDoc needed - signature is clear function camelCase(str: string): string { return str.replace(/-./g, x => x[1].toUpperCase()) } // ✅ JSDoc adds value - explains behavior /** * Convert path to template string. * @example /api/{id} => `/api/${id}` */ function toTemplate(path: string): string { // implementation }
Guidelines
✅ DO:
- Document what the property does, not the type
- Include
for default values@default - Add
for complex or non-obvious usage@example - Use
for version info or important caveats@note - Keep descriptions concise and focused
❌ DON'T:
- Use
or@param
tags@returns - Repeat information from TypeScript types
- Over-document simple, self-explanatory properties
- Write redundant descriptions
Tag Order
For consistency, use this tag order:
- Description (required)
(if applicable)@default
(if helpful)@example
(if needed)@note
(if applicable)@deprecated
(if providing references)@see
Related Skills
| Skill | Use For |
|---|---|
| ../documentation/SKILL.md | Writing markdown documentation files |
| ../coding-style/SKILL.md | General coding conventions |