mermaid-studio
What it does
This skill writes Mermaid diagram code, checks it for errors, and renders it to image files. It is for developers and writers who want clear diagrams in documentation without drawing them by hand.
When to use it
- βWhen you want a flowchart, sequence diagram, or database diagram written in Mermaid code.
- βWhen you need a diagram rendered to an image file for a document or presentation.
- βWhen you want to turn existing code into a diagram that explains how it works.
Skill link
https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(tooling)/mermaid-studio/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCan you make a Mermaid sequence diagram of how my login flow works and export it as a PNG?β
5 new skills a week. 1 minute to read.
How it works
The agent writes Mermaid code with a color theme, checks the syntax, and renders the result. It can also analyze existing code to build a diagram of its structure.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Mermaid Studio
Expert-level Mermaid diagram creation, validation, and multi-format rendering. Creates diagrams from descriptions or code analysis, validates syntax, and renders to SVG, PNG, or ASCII with professional theming.
Golden Rules β Elegant Diagrams by Default
Every diagram MUST follow these principles. They are not optional β they define the difference between a mediocre diagram and a gold-standard one.
Rule 1: Always Use an Init Directive for Professional Styling
NEVER create a diagram without an %%{init} directive or frontmatter config. The default Mermaid theme produces harsh black lines and generic colors. Always apply a curated palette.
For general diagrams (flowchart, sequence, state, class, ERD):
%%{init: {'theme': 'base', 'themeVariables': {
'primaryColor': '#4f46e5', 'primaryTextColor': '#ffffff',
'primaryBorderColor': '#3730a3', 'lineColor': '#94a3b8',
'secondaryColor': '#10b981', 'tertiaryColor': '#f59e0b',
'background': '#ffffff', 'mainBkg': '#f8fafc',
'nodeBorder': '#cbd5e1', 'clusterBkg': '#f1f5f9',
'clusterBorder': '#e2e8f0', 'titleColor': '#1e293b',
'edgeLabelBackground': '#ffffff', 'textColor': '#334155'
}}}%%
β οΈ Font Warning: Do NOT set fontFamily in theme variables. The Mermaid default font (trebuchet ms, verdana, arial, sans-serif) works everywhere. Setting system-ui, Segoe UI, or -apple-system will render as Times New Roman in headless Chromium (used by mmdc).
For C4 diagrams β see the dedicated C4 styling section below.
For architecture-beta diagrams β see the dedicated AWS/Architecture section below.
Rule 2: Soft Lines, Never Harsh Black
The single biggest visual improvement is using lineColor: '#94a3b8' (slate-400) instead of the default black. This creates a modern, breathable diagram. For dark themes, use lineColor: '#64748b' (slate-500).
Rule 3: Limit Density β Breathe
- Maximum 15 nodes per diagram (not 20 β fewer is more elegant)
- Use
subgraphor boundaries to create whitespace and visual grouping - Prefer LR (left-right) for process flows β it reads more naturally
- Use invisible links (
A ~~~ B) to add spacing when the layout is cramped
Rule 4: Meaningful Labels and Consistent Style
- Node IDs: camelCase (
orderService, nots1oros) - Labels: short, clear natural language (
[Order Service]) - Arrows: action verbs with protocol info (
"Sends order via gRPC") - Descriptions: one-line, role-focused (
"Handles order lifecycle")
Rule 5: Color Harmony Over Color Variety
Use max 3-4 colors per diagram. Map colors to meaning:
- Blue tones (#4f46e5, #3b82f6) β primary systems, internal services
- Green tones (#10b981, #059669) β success states, data stores
- Amber tones (#f59e0b, #d97706) β external systems, warnings
- Slate tones (#64748b, #94a3b8) β lines, borders, secondary elements
- Red tones (#ef4444) β errors ONLY, never as decoration
Modes of Operation
This skill operates in three modes based on user intent:
| Mode | Trigger | What happens |
|---|---|---|
| Create | "draw a diagram of...", "visualize my..." | Generates .mmd code only |
| Render | "render this mermaid", "convert to SVG/PNG/ASCII" | Renders existing .mmd |
| Full | "create and render...", ambiguous requests | Create β Validate β Render |
Default to Full mode when intent is unclear.
Step 1: Understand the Request
Before writing any Mermaid code, determine:
- What to diagram β system, flow, schema, architecture, code structure?
- Which diagram type β use the Decision Matrix below
- Output format β code only, SVG, PNG, or ASCII?
- Theme preference β ask only if rendering; default to
basetheme with curated palette
Diagram Type Decision Matrix
| User describes... | Diagram Type | Syntax keyword |
|---|---|---|
| Process, algorithm, decision tree, workflow | Flowchart | flowchart TD/LR |
| API calls, message passing, request/response | Sequence | sequenceDiagram |
| Database schema, table relationships | ERD | erDiagram |
| OOP classes, domain model, interfaces | Class | `classDiagra |
FAQ
Which diagram types does it support?
The skill supports more than 20 Mermaid types, including flowcharts, sequence, ERD, state, class, and architecture diagrams.
What output formats does it give?
It renders to SVG, PNG, or ASCII.
Does it check the diagram before rendering?
Yes. It validates the syntax, so errors are caught before the file is made.
Details
Original description by the author
Expert Mermaid diagram creation, validation, and rendering with dual-engine output (SVG/PNG/ASCII). Supports all 20+ diagram types including C4 architecture, AWS architecture-beta with service icons, flowcharts, sequence, ERD, state, class, mindmap, timeline, git graph, sankey, and more. Features code-to-diagram analysis, batch rendering, 15+ themes, and syntax validation. Use when users ask to create diagrams, visualize architecture, render mermaid files, generate ASCII diagrams, document system flows, model databases, draw AWS infrastructure, analyze code structure, or anything involving "me
Popularity
- GitHub stars
- 7.1k
- Ranking position
- #13570
- License
- β
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
component-common-domain-detection
7.1kHelps your agent find business logic that is repeated across several parts of a codebase and suggests how to combine it.
component-flattening-analysis
7.1kHelps your agent find misplaced code and flatten messy component folder structures, so each piece sits where it belongs.
component-identification-sizing
7.1kHelps your agent map the parts of a codebase and measure their size, to find which module to split first.
coupling-analysis
7.1kHelps your agent check how tightly parts of a codebase depend on each other, and which connections to loosen first.
Similar skills
technical-documentation
394kHelps your agent write and review clear technical docs and agent instruction files, so people and AI tools can follow them easily.
architecture-decision-records
280kHas your agent record important project structure decisions. It helps to understand the reasoning behind choices and maintain a clear history of changes.
code-tour
280kLets your agent create step-by-step code walkthroughs with exact file and line references. Useful for intros, explanations, and reviews.