Convert existing docs diagram images to Mermaid, and author new Mermaid diagrams for Mastra docs. Use when replacing an Excalidraw or PNG/JPG/SVG diagram with Mermaid, when a docs page needs a new diagram, when a diagram renders wrong in light or dark mode, or when auditing which docs images should become Mermaid. Triggers on: convert diagram, Excalidraw, mermaid, flowchart, diagram image, diagram styling, diagram looks wrong.
76
93%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Read docs/styleguides/DIAGRAM.md first. It is the shape, color, and layout
language. This skill is the process for applying it to an image that already
exists.
Answer in order. Stop at the first yes.
A diagram that only converts by fighting the layout engine is a diagram that
should stay an image. Do not add invisible spacer nodes, padding spaces in
labels, or a hand-tuned elk block to force a shape. The next writer will not
know why they are there.
grep -rn "<image-filename>" docs/srcDocs images are shared across pages more often than expected. The suspend and resume images appear on both the human-in-the-loop and suspend-and-resume pages. Converting one page does not free the asset.
Write down each node, its job, and each edge with its label. Work from that
list, not from the picture. The list is what maps onto the shape decision tree
in DIAGRAM.md; the picture tempts you into copying a hand-drawn layout that
ELK will not reproduce.
Main path first, then branches. Apply shapes from the decision tree, semantic
classes for outcomes only, accTitle and accDescr always.
Match the story to the sentence above the diagram. A page section about resuming a workflow gets a diagram that starts at the paused state, not one that replays the entire run with resume tacked on. When a diagram tries to show a full suspend and resume loop, ELK pushes the paused node left of the step and crosses the two dotted edges. Show the leg the section is about.
cd docs && pnpm dev --port 3005Check each of these. They are the failures that actually happen:
<br/>.A screenshot is not verification. Render it.
Re-run the grep from step 1. Zero results, delete the file. Any results, leave it, and say which pages still use it.
Three classes exist: accent, pending, danger. Adding a fourth requires
light and dark palette values in docs/src/theme/Mermaid/mastra-mermaid-theme.ts,
plus registrations through semanticClassCSS(...) for nodes and
semanticEdgeCSS(...) for edges. Add the class to the DIAGRAM.md table too.
Never add a color by writing hex in a diagram; it will be wrong in one of the
two modes.
pnpm lint:remark in docs/pnpm build in docs/, because a Mermaid parse error fails the build rather
than degrading748d4ed
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.