Skip to content
cccskills
FreePublished on GitHub

docs-diagrams

Convert suitable diagrams in Mastra documentation into Mermaid, a text format for diagrams, or create new ones. Assess which images to keep, follow diagram styling rules, and verify layout and readability in light and dark modes.

OriginalShow the original description

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.

See how to install

Good for

  • Replace box-and-arrow images with Mermaid diagrams
  • Add a new diagram to Mastra documentation
  • Fix diagram readability in light and dark modes
  • Audit shared diagram images and remove unused assets

Files included (1)

  • SKILL.md3.9 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Docs Diagrams

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.

Decide whether to convert

Answer in order. Stop at the first yes.

  1. Is it a screenshot of a UI? → Keep the image. Mermaid draws graphs, not product surfaces.
  2. Does meaning live in where things sit rather than what connects to what? → Keep the image. ELK places nodes automatically and will move them. The agents overview image, where tool, LLM, and memory sit deliberately beneath the agent, loses its point the moment a layout engine touches it.
  3. Is it boxes joined by arrows, and would it survive being redrawn by someone who only read the node and edge labels? → Convert.

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.

Convert

1. Find every reference before touching anything

grep -rn "<image-filename>" docs/src

Docs 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.

2. Read the image and name the nodes and edges

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.

3. Write the diagram

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.

4. Verify in the browser, in both modes

cd docs && pnpm dev --port 3005

Check each of these. They are the failures that actually happen:

  • The main path is a straight line. If it bends, a branch was declared too early.
  • No node is more than twice the width of its neighbors. If one is, break its label with <br/>.
  • Every edge label sits on its edge, not in open space.
  • Toggle light and dark. Text stays readable on both, and no node keeps a fill from the other mode.

A screenshot is not verification. Render it.

5. Delete the asset only when nothing references it

Re-run the grep from step 1. Zero results, delete the file. Any results, leave it, and say which pages still use it.

Extend the color language

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.

Check the work

  • pnpm lint:remark in docs/
  • pnpm build in docs/, because a Mermaid parse error fails the build rather than degrading

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Design and audit an agent's system prompt, the instructions that guide its work. Define a concrete outcome, starting input, available tools, completion checks, fallback behavior, and final report so the prompt describes a complete run.

  • Designing the core instructions for a new agent
  • Auditing a prompt before saving it
  • Defining behavior when tools or permissions are missing
mastra-ai/mastra29KUpdated Oct 22, 2026

Create a dedicated test project linked to the current worktree and check Agent Builder through APIs and browser interactions. It covers agent and skill management, permissions, defaults, and related features, with selectable test sections.

  • Validate an Agent Builder feature branch before review
  • Check role-based permissions and authentication
  • Test agent and skill management through APIs and the UI
mastra-ai/mastra29KUpdated Oct 22, 2026

code-standards

FreeSummary

Reviews pull requests for bugs, error handling, code quality, and style consistency. Organizes feedback into an overview, must-fix issues with file locations, improvement suggestions, and positive notes so reviewers can distinguish urgent problems from refinements.

  • Finding bugs that must be fixed before merging
  • Reviewing TypeScript types and asynchronous code
  • Checking naming, imports, and leftover debug statements
mastra-ai/mastra29KUpdated Oct 22, 2026

coding-agent

FreeSummary

Design instructions for agents that write, fix, review, or refactor code. Define behavior based on file access, select suitable tools, and set clear verification and completion rules for repository changes or copyable code output.

  • Designing an agent for repository bug fixes
  • Defining a pull request review agent
  • Creating a code generator without workspace access
mastra-ai/mastra29KUpdated Oct 22, 2026

Configure Factory board behavior and GitHub or Linear event handlers in deployment code. Adjust stage transitions, phase meanings, and tool-result handling, then check the changes with focused tests and versioned audit records.

  • Add approval requirements to board transitions
  • Change GitHub or Linear event handling
  • Define custom board phases and tool-result rules
mastra-ai/mastra29KUpdated Oct 22, 2026

Design agents that draft blog posts, social posts, newsletters, and marketing copy. Define the audience, brand voice, length, and required output so each agent delivers a complete draft with a headline and supporting notes.

  • Build a blog writing agent with a consistent brand voice
  • Design an agent for LinkedIn product posts
  • Define delivery rules for newsletter drafts
mastra-ai/mastra29KUpdated Oct 22, 2026

See all skills by mastra-ai

Report a problem with this skill