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

Skills เพิ่มเติมจาก medusajs

mcloud-variables
medusajs
ดำเนินการคำสั่ง mcloud variables เพื่อแสดงรายการและรับตัวแปรสภาพแวดล้อมสำหรับสภาพแวดล้อมคลาวด์ ใช้เมื่อตรวจสอบ อ่าน หรือส่งออกสภาพแวดล้อม…
official
building-storefronts
medusajs
การผสานรวมฟรอนต์เอนด์แบบ SDK-first สำหรับร้านค้า Medusa ด้วยรูปแบบ React Query และกฎการเรียก API ที่สำคัญ ใช้ Medusa JS SDK สำหรับคำขอ API ทั้งหมดเสมอ—ห้ามใช้ fetch() ปกติเด็ดขาด เนื่องจากขาดส่วนหัวที่จำเป็น (publishable API key สำหรับเส้นทางร้านค้า, auth สำหรับเส้นทางผู้ดูแลระบบ) ส่งออบเจกต์ JavaScript ธรรมดาไปยังเมธอดของ SDK ห้ามใช้ JSON.stringify() กับพารามิเตอร์ body เพราะ SDK จัดการการทำให้เป็นอนุกรมโดยอัตโนมัติ ใช้ useQuery สำหรับคำขอ GET และ useMutation สำหรับคำขอ POST/DELETE,...
official
building-admin-dashboard-customizations
medusajs
ส่วนขยาย UI แบบกำหนดเองสำหรับแดชบอร์ด Medusa Admin โดยใช้ Admin SDK และคอมโพเนนต์ Medusa UI โหลดสกิลนี้ก่อนสำหรับงาน UI ของแอดมิน (การวางแผน การนำไปใช้ การสำรวจ); เซิร์ฟเวอร์ MCP ให้เฉพาะการอ้างอิง API เท่านั้น ไม่ใช่รูปแบบการออกแบบหรือกลยุทธ์การโหลดข้อมูล สำคัญ: ใช้ Medusa JS SDK สำหรับคำขอ API ทั้งหมดเสมอ (ห้ามใช้ fetch ปกติ); แยกคิวรีการแสดงผลออกจากคิวรีโมดอล และล้างข้อมูลการแสดงผลหลังจากการกลายพันธุ์ นำวิดเจ็ตไปใช้บนหน้าที่มีอยู่หรือสร้างเส้นทาง UI แบบกำหนดเอง;...
official
learning-medusa
medusajs
ค่ายฝึกพัฒนา Medusa แบบโต้ตอบทีละขั้นตอน ที่คุณจะสร้างฟีเจอร์แบรนด์ไปพร้อมกับเรียนรู้รูปแบบสถาปัตยกรรม ประกอบด้วยสามบทเรียนแบบต่อเนื่อง (รวม 2–3 ชั่วโมง) ครอบคลุมโมดูล เวิร์กโฟลว์ เส้นทาง API การเชื่อมโยงโมดูล ฮุคของเวิร์กโฟลว์ และการปรับแต่ง UI ของแอดมิน มีการตรวจสอบจุดเช็คพอยต์หลังจากแต่ละองค์ประกอบหลัก เพื่อทดสอบความเข้าใจเชิงแนวคิด คุณภาพโค้ด และฟังก์ชันการทำงานก่อนดำเนินการต่อ ปฏิบัติต่อข้อผิดพลาดเป็นโอกาสในการสอน แก้ไขข้อบกพร่องร่วมกันด้วยคำถามวินิจฉัยและการวิเคราะห์สาเหตุที่แท้จริง...
official
db-migrate
medusajs
ดำเนินการย้ายฐานข้อมูล Medusa ที่รออยู่และรายงานผลลัพธ์ รัน npx medusa db:migrate ผ่าน Bash เพื่อใช้การย้ายข้อมูลที่รออยู่ทั้งหมดไปยังฐานข้อมูล Medusa ของคุณ รายงานผลลัพธ์การย้ายข้อมูล รวมถึงจำนวนการย้ายข้อมูลที่ถูกนำไปใช้ ข้อผิดพลาดที่พบ และการยืนยันความสำเร็จ ออกแบบมาสำหรับโปรเจกต์ Medusa ที่มีการตั้งค่า npm/npx มาตรฐาน
official
mcloud-environments
medusajs
ดำเนินการคำสั่ง mcloud environments เพื่อแสดงรายการ รับข้อมูล สร้าง ลบ ปรับใช้ใหม่ หรือเรียกใช้บิลด์สำหรับสภาพแวดล้อม Cloud ใช้เมื่อจัดการวงจรชีวิตของสภาพแวดล้อม...
official
db-generate
medusajs
สร้างการย้ายฐานข้อมูลสำหรับโมดูล Medusa ด้วยคำสั่งเดียว ครอบคลุมคำสั่ง CLI npx medusa db:generate เพื่อสร้างไฟล์การย้ายสำหรับโมดูล Medusa ที่ระบุ รับชื่อโมดูลเป็นอาร์กิวเมนต์และรายงานตำแหน่งไฟล์การย้าย ข้อผิดพลาด และขั้นตอนถัดไป แนะนำให้รัน 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