Writing docs

From medusajs/medusa · View interactive version

Writing docs is an AI agent skill from the GitHub repository medusajs/medusa. Writes and updates Medusa documentation MDX files for the book, resources, ui, user-guide, and cloud projects. Use when making documentation changes based on code diffs, adding new pages, updating existing content, or updating component examples. ALWAYS load this skill before modifying any MDX file

How to use this skill

Skill file

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.

After Making Changes

Run these from each project you changed (www/apps/<project>), in order:

  1. Prep: yarn prep:turbo --force in resources, yarn prep in book, ui, user-guide, and cloud
  2. Content lint: yarn lint:content (auto-fixes MDX; fix any remaining errors manually)
  3. Code lint: yarn lint, only if you changed non-MDX files (for example, sidebar .mjs files or specs/examples/ in ui)

Load Reference Files When Needed

Load at least one reference file before writing any content.

| Task | Load |

|------|------|

| Deciding if a change needs docs | reference/when-to-document.md |

| Writing any MDX content | reference/mdx-patterns.md |

| Writing for the book project | reference/book-style.md |

| Writing for the resources project | reference/resources-style.md |

| Writing for the user-guide project | reference/user-guide-style.md |

| Writing for the cloud project | reference/cloud-style.md |

| Checking prose quality | reference/vale-rules.md |

Quick Reference

Project paths and writable directories

| Project | Content path | Sidebar file |

|---------|-------------|--------------|

| book | www/apps/book/app/ | www/apps/book/sidebar.mjs |

| resources | www/apps/resources/app/ | www/apps/resources/sidebars/*.mjs |

| ui | www/apps/ui/app/, www/apps/ui/specs/examples/ | www/apps/ui/sidebar.mjs |

| user-guide | www/apps/user-guide/app/ | www/apps/user-guide/sidebar.mjs |

| cloud | www/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

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
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.