method-shorthand-jsdoc
Installation
SKILL.md
Method Shorthand for JSDoc Preservation
When factory functions have helper functions that are only used by returned methods, move them INTO the return object using method shorthand. This ensures JSDoc comments are properly passed through to consumers.
Related Skills: See
factory-function-compositionfor the four-zone factory anatomy and thethisdecision rule.
The Problem
You write a factory function with a well-documented helper:
function createHeadDoc(options: { workspaceId: string }) {
const { workspaceId } = options;