1 ---
2 name: writing-tutorials
3 description: Creates Medusa documentation tutorials in two phases: first builds the tutorial feature in an example project (with planning, coding, and tests), then writes the MDX documentation. Use when creating a new how-to tutorial or integration guide for the Medusa docs. Handles both feature implementation and documentation writing, but only one phase at a time.
4 ---
5
6 # Writing Medusa Tutorials
7
8 Guides an agent through creating a complete Medusa tutorial: building the feature in an example project, then writing the documentation.
9
10 ## Two-Phase Approach
11
12 **Phase 1 — Build:** Gather requirements → plan with user → implement feature → add tests → confirm with user
13 **Phase 2 — Write:** Create step diagram → write per-step MD files → combine into final MDX → update sidebar → clean up
14
15 > **CRITICAL:** Never do both phases in one session. Complete Phase 1, get user confirmation, then reload this skill for Phase 2.
16
17 ## Load Reference Files When Needed
18
19 > **Load at least one reference file before proceeding.**
20
21 | Task | Load |
22 |------|------|
23 | Starting Phase 1 (building) | `reference/building-phase.md` |
24 | Starting Phase 2 (writing) | `reference/writing-phase.md` + `reference/tutorial-conventions.md` + `reference/concept-definitions.md` |
25 | MDX patterns and components | `reference/tutorial-conventions.md` |
26 | Concept definitions (module, workflow, etc.) | `reference/concept-definitions.md` |
27
28 ## Quick Reference
29
30 ### File Locations
31
32 | Type | Content Path | Sidebar File |
33 |------|-------------|--------------|
34 | How-to tutorial | `www/apps/resources/app/how-to-tutorials/tutorials/{name}/page.mdx` | `www/apps/resources/sidebars/how-to-tutorials.mjs` |
35 | Integration guide | `www/apps/resources/app/integrations/guides/{name}/page.mdx` | `www/apps/resources/sidebars/integrations.mjs` |
36
37 ### Development Skills to Load During Build
38
39 - Backend features → `medusa-dev:building-with-medusa`
40 - Admin UI → `medusa-dev:building-admin-dashboard-customizations`
41 - Storefront → `medusa-dev:building-storefronts`
42 - Third-party services → `context7` MCP or skills
43 - Medusa API questions → `mcp__medusa__ask_medusa_question`
44
45 ## Common Mistakes
46
47 - [ ] Jumping straight to writing documentation without building the feature first
48 - [ ] Writing both phases in one session without user confirmation between them
49 - [ ] Writing Step 1 (Medusa installation) from scratch — use the pre-written template in `tutorial-conventions.md`
50 - [ ] Forgetting to update the sidebar after writing the tutorial MDX
51 - [ ] Leaving `_step-*.md` temp files after combining into final MDX
52 - [ ] Making tutorial code overly complex — tutorials are educational, keep it simple