writing-tsdocs

द्वारा medusajs

Adds and updates TypeDoc (TSDoc) comments to TypeScript source files in the Medusa codebase. Covers HTTP types, API routes, UI components, data models, service…

npx skills add https://github.com/medusajs/medusa --skill writing-tsdocs

Writing Medusa TSDocs

Adds TypeDoc (TSDoc) comments to Medusa TypeScript source files. Follows TypeDoc conventions and uses custom tags defined in www/utils/packages/typedoc-config/tsdoc.json.

Constraints

CRITICAL: Violating these produces incorrect or broken documentation.

  • Never document unexported items — only exported interfaces, types, functions, classes
  • Never add TSDocs to test files — skip *.spec.ts, *.test.ts, __tests__/
  • Never fabricate @since version numbers — only use the version passed in the prompt
  • Never remove or modify existing TSDocs — only add where missing
  • Never modify logic — only add/edit comment blocks
  • For Medusa-specific custom tags, only use those defined in tsdoc.json: @expandable, @featureFlag, @since, @apiIgnore, @schema, @tags, @version, @keep, @customNamespace, @namespaceMember

Load Reference Files When Needed

Load the reference file for the file type you're documenting before writing any TSDocs.

Path patternLoad
packages/core/types/src/http/reference/http-types.md
packages/medusa/src/api/admin/ or /store/reference/api-routes.md
packages/design-system/ui/src/components/reference/ui-components.md
packages/modules/*/src/models/reference/data-models.md
packages/core/types/src/ (non-http)reference/service-interfaces.md
packages/core/js-sdk/src/reference/service-interfaces.md
packages/core/utils/src/ (abstract providers)reference/service-interfaces.md
packages/core/workflows-sdk/src/utils/composer/reference/service-interfaces.md
packages/core/core-flows/src/ (workflows)reference/workflows-steps.md
packages/core/core-flows/src/ (steps)reference/workflows-steps.md
packages/core/utils/src/core-flows/events.tsreference/events.md

Quick Reference

TSDoc block format

/**
 * Brief description.
 */
export interface Foo {
  /**
   * The foo's ID.
   */
  id: string
}

Per-type depth guide

File typeWhat to documentKey Medusa tags
HTTP typesEvery exported interface/type + all properties@expandable on nested objects
API routesExported handlers only (minimal)@featureFlag, @since
UI componentsComponent + all propsPlain descriptions
Data modelsModel + each property@since on new items
Service interfacesEvery method in full@param, @returns, @example
JS SDKEvery public method@param, @returns, @example, @tags
ProvidersClass + every abstract method@param, @returns, @example
Workflow SDKEvery exported function@param, @returns, @example
core-flows workflowsWorkflow export + hooks@summary, @featureFlag, @since
core-flows stepsStep export + input type@featureFlag, @since, @example
EventsEvery event constant@eventPayload, @featureFlag, @since

Medusa custom tags (from www/utils/packages/typedoc-config/tsdoc.json)

TagKindUse when
@featureFlag <name>blockExport requires a feature flag to be enabled
@expandablemodifierNested object expandable in API queries
@since <version>blockExport was added in this version (prompt-provided only)
@apiIgnoremodifierExclude from API docs output
@tags <name>blockSDK categorization
@schemablockCustom schema documentation
@keepmodifierPreserve during doc generation
@customNamespaceblockAssign to custom doc namespace

Standard TypeDoc/JSDoc tags (@param, @returns, @example, @deprecated, @remarks, etc.) are always allowed.

Common Mistakes

  • Documenting unexported or private items
  • Using @since without a version being provided in the prompt
  • Writing property descriptions longer than 2 sentences
  • Adding @param/@returns to non-method exports (interfaces, types)
  • Documenting an id field without specifying what resource it belongs to

Reference Files

reference/http-types.md          - HTTP type interfaces: properties, @expandable
reference/api-routes.md          - API routes: @featureFlag, @since, minimal docs
reference/ui-components.md       - UI components: component + inline prop pattern
reference/data-models.md         - DML models: @since, property descriptions
reference/service-interfaces.md  - Methods, SDK, providers, workflow SDK: full JSDoc
reference/workflows-steps.md     - core-flows workflows and steps: @summary, hooks, @example
reference/events.md              - Event constants: @eventPayload, @featureFlag, @since

medusajs की और Skills

mcloud-variables
medusajs
क्लाउड वातावरण के लिए पर्यावरण चरों को सूचीबद्ध करने और प्राप्त करने हेतु mcloud variables कमांड निष्पादित करें। पर्यावरण चरों का निरीक्षण, पठन या निर्यात करते समय उपयोग करें।
official
building-storefronts
medusajs
SDK-प्रथम फ्रंटएंड एकीकरण, Medusa स्टोरफ्रंट के लिए React Query पैटर्न और महत्वपूर्ण API कॉलिंग नियमों के साथ। सभी API अनुरोधों के लिए हमेशा Medusa JS SDK का उपयोग करें—कभी भी सामान्य fetch() का उपयोग न करें, क्योंकि इसमें आवश्यक हेडर (स्टोर रूट के लिए प्रकाशनीय API कुंजी, एडमिन रूट के लिए प्रमाणीकरण) का अभाव होता है। SDK विधियों में सादे जावास्क्रिप्ट ऑब्जेक्ट पास करें; बॉडी पैरामीटर पर कभी भी JSON.stringify() का
official
building-admin-dashboard-customizations
medusajs
मेडुसा एडमिन डैशबोर्ड के लिए एडमिन SDK और मेडुसा UI घटकों का उपयोग करके कस्टम UI एक्सटेंशन। किसी भी एडमिन UI कार्य (योजना, कार्यान्वयन, अन्वेषण) के लिए पहले इस स्किल को लोड करें; MCP सर्वर केवल API संदर्भ प्रदान करते हैं, डिज़ाइन पैटर्न या डेटा लोडिंग रणनीतियाँ नहीं। महत्वपूर्ण: सभी API अनुरोधों के लिए हमेशा मेडुसा JS SDK का उपयोग करें (कभी भी सामान्य fetch का नहीं); डिस्प्ले क्वेरी को
official
learning-medusa
medusajs
इंटरैक्टिव चरण-दर-चरण मेडुसा डेवलपमेंट बूटकैंप जहां आप आर्किटेक्चर पैटर्न सीखते हुए एक ब्रांड्स फीचर बनाते हैं। तीन प्रगतिशील पाठ (कुल 2-3 घंटे) जिनमें मॉड्यूल, वर्कफ़्लो, एपीआई रूट्स, मॉड्यूल लिंक्स, वर्कफ़्लो हुक्स और एडमिन यूआई कस्टमाइज़ेशन शामिल हैं। प्रत्येक प्रमुख घटक के बाद चेकपॉइंट सत्यापन आगे बढ़ने से पहले अवधारणात्मक सम
official
db-migrate
medusajs
लंबित Medusa डेटाबेस माइग्रेशन निष्पादित करें और परिणाम रिपोर्ट करें। आपके Medusa डेटाबेस पर सभी लंबित माइग्रेशन लागू करने के लिए Bash के माध्यम से npx medusa db:migrate चलाता है। लागू किए गए माइग्रेशन की संख्या, सामने आई किसी भी त्रुटि और सफलता की पुष्टि सहित माइग्रेशन परिणाम रिपोर्ट करता है। मानक npm/npx सेटअप वाले Medusa प्रोजेक्ट्स के लिए डिज़ाइन किया गया है।
official
mcloud-environments
medusajs
mcloud environments कमांड को निष्पादित करके क्लाउड वातावरणों को सूचीबद्ध करना, प्राप्त करना, बनाना, हटाना, पुनः तैनात करना या बिल्ड ट्रिगर करना। वातावरण जीवनचक्र प्रबंधित करते समय उपयोग करें,…
official
db-generate
medusajs
एक ही कमांड से Medusa मॉड्यूल के लिए डेटाबेस माइग्रेशन जनरेट करें। निर्दिष्ट Medusa मॉड्यूल के लिए माइग्रेशन फ़ाइलें बनाने हेतु npx medusa db:generate CLI कमांड को रैप करता है। मॉड्यूल का नाम एक आर्गुमेंट के रूप में स्वीकार करता है और माइग्रेशन फ़ाइल का स्थान, त्रुटियाँ, तथा अगले कदमों की रिपोर्ट करता है। जनरेशन के बाद माइग्रेशन लागू करने के लिए स्वचालित रूप से npx medusa db:migrate चलाने का सुझाव देता है।
official
mcloud-deployments
medusajs
Execute mcloud deployments commands to list deployments, retrieve deployment details, and fetch build logs. Use when listing deployments, checking deployment…
official