writing-docs

作者: medusajs

Writes and updates Medusa documentation MDX files for the book, resources, ui, user-guide, and cloud projects. Use when making documentation changes based on…

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

Writing Medusa Documentation

Skill for writing and updating MDX documentation across the book, resources, ui, user-guide, and cloud projects under www/apps/.

Constraints

CRITICAL: Violating these will corrupt the documentation or break CI.

  • Never document @ignore-tagged items — any option, method, or parameter with @ignore in its TSDoc must be skipped entirely
  • Never touch www/apps/resources/references/ — auto-generated, will be overwritten
  • Never touch www/apps/ui/specs/components/ — auto-generated, will be overwritten
  • Never touch www/apps/api-reference/ — managed by a separate process
  • Never run yarn prep or yarn lint:content — these run automatically after your session
  • Never invent Cloudinary screenshot URLs in user-guide — leave <!-- TODO: add screenshot --> instead

Load Reference Files When Needed

Load at least one reference file before writing any content.

TaskLoad
Deciding if a change needs docsreference/when-to-document.md
Writing any MDX contentreference/mdx-patterns.md
Writing for the book projectreference/book-style.md
Writing for the resources projectreference/resources-style.md
Writing for the user-guide projectreference/user-guide-style.md
Writing for the cloud projectreference/cloud-style.md
Checking prose qualityreference/vale-rules.md

Quick Reference

Project paths and writable directories

ProjectContent pathSidebar file
bookwww/apps/book/app/www/apps/book/sidebar.mjs
resourceswww/apps/resources/app/www/apps/resources/sidebars/*.mjs
uiwww/apps/ui/app/, www/apps/ui/specs/examples/www/apps/ui/sidebar.mjs
user-guidewww/apps/user-guide/app/www/apps/user-guide/sidebar.mjs
cloudwww/apps/cloud/app/www/apps/cloud/sidebar.mjs

MDX file minimum structure

export const metadata = {
  title: `Page Title`,
}

# {metadata.title}

Content here.

For book pages that use chapter numbering, the title uses ${pageNumber}:

export const metadata = {
  title: `${pageNumber} Chapter Title`,
}

Cross-project links

[text](!docs!/learn/path)        → book
[text](!resources!/path)         → resources
[text](!user-guide!/path)        → user-guide

Common Mistakes

  • Adding a new option, method, or parameter without a version note
  • Documenting any option, method, or parameter tagged with @ignore in its TSDoc — skip these entirely
  • Touching references/ or specs/components/ directories
  • Using we, us, let's, our in prose (use "you" or imperative)
  • Using "Medusa API" to mean the backend — use "Medusa backend" instead
  • Writing "Medusa Cloud" — use "Medusa" (noun form) or "Cloud" (location/service)
  • Using e.g., — write for example instead
  • Using em dashes () — rewrite sentence to avoid them
  • Using passive voice ("is created", "can be configured") — write active ("you can configure", "call X to create")
  • Writing code lines longer than 64 characters
  • Forgetting to add a new page to the sidebar file
  • Removing ${pageNumber} from book page titles
  • Using <img> or bare HTML instead of MDX components
  • Documenting internal implementation details (only public APIs)

Reference Files

reference/when-to-document.md   - Decision tree: does this change need docs?
reference/mdx-patterns.md       - MDX syntax, code blocks, components
reference/book-style.md         - book-specific structure and conventions
reference/resources-style.md    - resources-specific structure and conventions
reference/user-guide-style.md   - user-guide writing style and conventions
reference/cloud-style.md        - cloud-specific structure and conventions
reference/vale-rules.md         - Vale + lint rules to follow in prose

來自 medusajs 的更多技能

mcloud-variables
medusajs
執行 mcloud variables 指令,列出並取得雲端環境的環境變數。用於檢查、讀取或匯出環境…
official
building-storefronts
medusajs
以SDK為優先的前端整合方式,適用於Medusa商店前端,採用React Query模式並遵循關鍵API呼叫規則。所有API請求必須使用Medusa JS SDK,絕不能使用一般的fetch(),因為它缺少必要的標頭(商店路由需要可發布的API金鑰,管理路由需要驗證資訊)。傳遞純JavaScript物件給SDK方法,切勿對主體參數使用JSON.stringify(),因為SDK會自動處理序列化。使用useQuery處理GET請求,使用useMutation處理POST/DELETE請求...
official
building-admin-dashboard-customizations
medusajs
使用管理員SDK和Medusa UI元件為Medusa管理後台自訂UI擴充功能。進行任何管理員UI工作(規劃、實作、探索)時,請優先載入此技能;MCP伺服器僅提供API參考,不包含設計模式或資料載入策略。關鍵:所有API請求務必使用Medusa JS SDK(絕不使用一般fetch);將顯示查詢與模態查詢分離,並在變更後使顯示資料失效。在現有頁面上實作小工具或建立自訂UI路由;...
official
learning-medusa
medusajs
互動式逐步Medusa開發訓練營,在建立品牌功能的同時學習架構模式。三個漸進式課程(總計2-3小時),涵蓋模組、工作流程、API路由、模組連結、工作流程鉤子及管理後台UI自訂。每個主要元件完成後設有檢查點驗證,測試概念理解、程式碼品質與功能正確性後才繼續進行。將錯誤視為教學機會,透過診斷問題與根本原因分析共同除錯...
official
db-migrate
medusajs
執行待處理的 Medusa 資料庫遷移並回報結果。透過 Bash 執行 npx medusa db:migrate 以將所有待處理的遷移套用至 Medusa 資料庫。回報遷移結果,包括已套用的遷移數量、遇到的任何錯誤以及成功確認。專為使用標準 npm/npx 設定的 Medusa 專案設計。
official
mcloud-environments
medusajs
執行 mcloud environments 指令,以列出、取得、建立、刪除、重新部署或觸發雲端環境的建置。適用於管理環境生命週期等情境。
official
db-generate
medusajs
以單一指令為 Medusa 模組生成資料庫遷移檔案。封裝 npx medusa db:generate CLI 指令,為指定的 Medusa 模組建立遷移檔案。接受模組名稱作為參數,並回報遷移檔案位置、錯誤及後續步驟。自動建議在生成後執行 npx medusa db:migrate 以套用遷移。
official
mcloud-deployments
medusajs
執行 mcloud deployments 指令以列出部署、取得部署詳細資訊,並擷取建置日誌。用於列出部署、檢查部署…
official