mcpField
T
ts-jsdoc-expert

ts-jsdoc-expert

github.com/gravito-frameworkDevelopment247 installsUpdated 27w ago
Repository

About ts-jsdoc-expert

ts-jsdoc-expert is a skill for adding JSDoc annotations to TypeScript code, with an emphasis on design intent and AI comprehension. It requires English comments, TSDoc syntax, examples for exported items, and documented error conditions.

Key features

  1. 01English-only JSDoc annotations
  2. 02Describe intent rather than restating types
  3. 03Add @throws for error conditions
  4. 04Add @example for exported functions
  5. 05Follow TSDoc syntax

Use cases

  1. 01Documenting exported TypeScript functions
  2. 02Clarifying the intent behind API design
  3. 03Preparing annotations for IDEs and documentation tools

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/gravito-framework/gravito --skill ts-jsdoc-expert

After installing, type/ts-jsdoc-expertin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

assets/
.keep
references/
.keep
best-practices.md
examples.md
tsdoc-standards.md
scripts/
.keep

Details

From the project README

TypeScript JSDoc Expert

Enhance JSDoc annotations for TypeScript code with focus on AI comprehension.

⚠️ CRITICAL REQUIREMENT: English Only

ALWAYS use English for all JSDoc annotations, regardless of:

  • User's language preferences in CLAUDE.md or other configuration files
  • Project's primary language settings
  • User's communication language

This is a non-negotiable technical requirement for:

  • ✅ TSDoc/JSDoc standards compliance
  • ✅ International open-source collaboration
  • ✅ IDE and documentation generator compatibility
  • ✅ TypeScript tooling support
  • ✅ Cross-team readability

If there is a conflict between this requirement and user settings, THIS REQUIREMENT TAKES PRECEDENCE.

Core Principles

  1. English Language - All JSDoc annotations MUST be written in English. No exceptions.
  2. Semantic Priority - Explain "why", not "what". Focus on design intent and use cases.
  3. Concise Annotations - Don't repeat TypeScript types in @param/@returns. Describe purpose and behavior only.
  4. Exception Annotations - Always include @throws with error types and trigger conditions.
  5. Practical Examples - All exported functions must have @example blocks.
  6. TSDoc Standards - Follow TSDoc syntax strictly.

Workflow

  1. Identify exported functions, classes, interfaces needing annotations
  2. Infer design intent from code logic
  3. Write semantic descriptions in English (purpose, rationale, use cases)
  4. Add @param/@returns in English (purpose only, no type repetition)
  5. Add @throws in English for all error scenarios
  6. Add @example in English for all exported functions
  7. Return complete annotated code only

Remember: All text in JSDoc comments must be in English, even if the user communicates in another language.

Quick Templates

Function
/**
 * [Brief purpose]
 *
 * [Why needed, design intent, use cases]
 *
 * @param name - [Purpose, constraints]
 * @returns [Meaning, not type]
 * @throws {ErrorType} [Trigger conditions]
 *
 * @example
 * ```typescript
 * const result = myFunction(input);
 * ```
 */
Class
/**
 * [Brief description]
 *
 * [Design patterns, responsibilities]
 *
 * @example
 * ```typescript
 * const instance = new MyClass();
 * ```
 */
Interface
/**
 * [Brief description]
 *
 * [Contract purpose, implementation requirements]
 */

Reference Resources

  • TSDoc Standards: See references/tsdoc-standards.md for complete syntax specifications
  • Examples: See references/examples.md for real-world annotation patterns
  • Best Practices: See references/best-practices.md for advanced techniques

Model Recommendation

Task ComplexityRecommended Model
Simple functions, clear intentHaiku - Fast, cost-effective
Complex classes, design patternsSonnet - Better semantic understanding

Haiku handles 80% of JSDoc tasks effectively. Use Sonnet for code requiring deeper architectural reasoning.

Output

Return only complete annotated code. No explanatory text.

⚠️ Final Checklist

Before submitting your work, verify:

  • All JSDoc comments are written in English only
  • No Chinese, Japanese, or other non-English text in JSDoc
  • User's language preferences in CLAUDE.md are ignored for JSDoc
  • TSDoc syntax is correct
  • All exported items have @example blocks (in English)
  • All error scenarios have @throws annotations (in English)

If you wrote JSDoc in any language other than English, STOP and rewrite it in English.

Comments

Markdown supported