method-shorthand-jsdoc
Uses method shorthand in return objects to ensure JSDoc comments remain visible when consumers hover over methods.
Install
mkdir -p .claude/skills/method-shorthand-jsdoc && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4061" && unzip -o skill.zip -d .claude/skills/method-shorthand-jsdoc && rm skill.zipInstalls to .claude/skills/method-shorthand-jsdoc
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Method shorthand in return objects for JSDoc preservation. Use when factory functions have internal helpers that should expose docs, or hovering over returned methods shows no JSDoc.Key capabilities
- →Preserve JSDoc comments on factory methods
- →Expose documentation through shorthand syntax
- →Improve IDE hover visibility for factory outputs
- →Restructure internal helper functions
- →Ensure consumer-facing documentation accuracy
How it works
It refactors factory pattern code by migrating internal helper functions directly into the returned object property definitions.
Inputs & outputs
When to use method-shorthand-jsdoc
- →Refactor factory functions for JSDoc visibility
- →Document internal helpers in returned objects
- →Fix missing documentation on factory method calls
- →Improve developer experience with IDE hover documentation
About method-shorthand-jsdoc
Guides developers in restructuring factory functions. By moving helper functions into the return object using shorthand syntax, it ensures that JSDoc documentation is properly captured by IDEs.
Move helper functions into return objects using method shorthand for proper JSDoc preservation. Use when factory functions have internal helpers that should expose documentation to consumers, or when hovering over returned methods shows no JSDoc.
When not to use it
- →Simple functions without JSDoc
- →Performance-critical loops where object creation overhead matters
Limitations
- →Requires minor refactoring of legacy code
- →Limited by how specific IDEs parse shorthand methods
- →Requires explicit JSDoc tags to be effective
How it compares
Focuses on IDE documentation preservation, not just functionality or pattern optimization.
Compared to similar skills
method-shorthand-jsdoc side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| method-shorthand-jsdoc (this skill) | 1 | 5mo | No flags | Intermediate |
| schema-markup | 10 | 10mo | No flags | Intermediate |
| coding-standards | 7 | 5mo | Review | Intermediate |
| antfu | 6 | 6mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by EpicenterHQ
View all by EpicenterHQ →You might also like
schema-markup
davila7
When the user wants to add, fix, or optimize schema markup and structured data on their site. Also use when the user mentions "schema markup," "structured data," "JSON-LD," "rich snippets," "schema.org," "FAQ schema," "product schema," "review schema," or "breadcrumb schema." For broader SEO issues, see seo-audit.
coding-standards
affaan-m
适用于TypeScript、JavaScript、React和Node.js开发的通用编码标准、最佳实践和模式。
antfu
antfu
Anthony Fu's opinionated tooling and conventions for JavaScript/TypeScript projects. Use when setting up new projects, configuring ESLint/Prettier alternatives, monorepos, library publishing, or when the user mentions Anthony Fu's preferences.
explain-code
AgnosticUI
Explain what code does in plain English
formatting-standards
crmagz
Formatting and linting standards using GTS, ESLint, and Prettier. Use when writing or formatting TypeScript code in this project.
jsdoc
shift-editor
Add or revise source-level JSDoc for Shift APIs. Use this skill before writing or editing documentation comments for exported classes, methods, constructors, domain data structures, render frames, reactive state, or any API where caller intent, side effects, lifetime, ownership, or nullability are e