Awesome-omni-skills mermaid-studio
Mermaid Studio workflow skill. Use this skill when the user needs 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 \"mermaid\", \"diagram\", \"flowchart\", \"architecture diagram\", \"sequence diagram\", \"ERD\", \"C4\", \"ASCII diagram\". Do NOT use for non-Mermaid image generation, data plotting with chart libraries, or general documentation writing and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.
git clone https://github.com/diegosouzapw/awesome-omni-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/mermaid-studio" ~/.claude/skills/diegosouzapw-awesome-omni-skills-mermaid-studio && rm -rf "$T"
skills/mermaid-studio/SKILL.mdMermaid Studio
Overview
This public intake copy packages
packages/skills-catalog/skills/(tooling)/mermaid-studio from https://github.com/tech-leads-club/agent-skills into the native Omni Skills editorial shape without hiding its origin.
Use it when the operator needs the upstream workflow, support files, and repository context to stay intact while the public validator and private enhancer continue their normal downstream flow.
This intake keeps the copied upstream files intact and uses
metadata.json plus ORIGIN.md as the provenance anchor for review.
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.
Imported source sections that did not map cleanly to the public headings are still preserved below or in the support files. Notable imported sections: Modes of Operation, C4 Diagrams — Mandatory Styling Guide, Output Conventions.
When to Use This Skill
Use this section as the trigger filter. It should make the activation boundary explicit before the operator loads files, runs commands, or opens a pull request.
- Read references/code-to-diagram.md for the analysis methodology
- Analyze the codebase to identify the right diagram type:
- Module dependencies → Flowchart or Class diagram
- API routes and handlers → Sequence diagram
- Database models/schemas → ERD
- Service architecture → C4 Container or Architecture diagram
Operating Table
| Situation | Start here | Why it matters |
|---|---|---|
| First-time use | | Confirms repository, branch, commit, and imported path before touching the copied workflow |
| Provenance review | | Gives reviewers a plain-language audit trail for the imported source |
| Workflow execution | | Starts with the smallest copied file that materially changes execution |
| Supporting context | | Adds the next most relevant copied source file without loading the entire package |
| Handoff decision | | Helps the operator switch to a stronger native skill when the task drifts |
Workflow
This workflow is intentionally editorial and operational at the same time. It keeps the imported source useful to the operator while still satisfying the public intake standards that feed the downstream enhancer flow.
- 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 base theme with curated palette
- User describes... - Diagram Type - Syntax keyword
- Process, algorithm, decision tree, workflow - Flowchart - flowchart TD/LR
- API calls, message passing, request/response - Sequence - sequenceDiagram
Imported Workflow Notes
Imported: 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
theme with curated palettebase
Diagram Type Decision Matrix
| User describes... | Diagram Type | Syntax keyword |
|---|---|---|
| Process, algorithm, decision tree, workflow | Flowchart | |
| API calls, message passing, request/response | Sequence | |
| Database schema, table relationships | ERD | |
| OOP classes, domain model, interfaces | Class | |
| State machine, lifecycle, transitions | State | |
| High-level system overview (C4 Level 1) | C4 Context | |
| Applications, databases, services (C4 Level 2) | C4 Container | |
| Internal components (C4 Level 3) | C4 Component | |
| Request flows with numbered steps | C4 Dynamic | |
| Infrastructure, cloud deployment | C4 Deployment | |
| Cloud services with icons (AWS/GCP/Azure) | Architecture | |
| Project timeline, scheduling | Gantt | |
| Proportional data, percentages | Pie | |
| Brainstorming, hierarchical ideas | Mindmap | |
| Historical events, chronology | Timeline | |
| Branching strategy, git history | Git Graph | |
| Flow quantities, resource distribution | Sankey | |
| X/Y data visualization | XY Chart | |
| Priority matrix, strategic positioning | Quadrant | |
| Layout control, grid positioning | Block | |
| Network packets, protocol headers | Packet | |
| Task boards, kanban workflow | Kanban | |
| User experience, satisfaction scoring | User Journey | |
| System requirements traceability | Requirement | |
If the user's description doesn't clearly map to one type, suggest 2-3 options with a brief rationale for each, then let them choose.
When to Load References
Load reference files ONLY when needed for the specific diagram type:
- C4 diagrams → Read
BEFORE writing codereferences/c4-architecture.md - AWS/Cloud architecture → Read
BEFORE writing codereferences/aws-architecture.md - Code-to-diagram → Read
BEFORE analyzingreferences/code-to-diagram.md - Theming/styling → Read
when user requests custom themesreferences/themes.md - Syntax errors → Read
when validation failsreferences/troubleshooting.md - Any diagram type details → Read
for comprehensive syntaxreferences/diagram-types.md
Imported: Step 2: Create the Diagram
2.1 — Write Mermaid Code
Follow these principles in order of priority:
- Elegance first — every diagram must look professional with init directives and curated colors
- Correctness — valid syntax that renders without errors
- Clarity — meaningful labels, logical flow direction, clear relationships
- Simplicity — under 15 nodes per diagram; split complex systems into multiple
- Consistency — uniform naming (camelCase for IDs, descriptive labels in brackets)
2.2 — Structure Rules
%% Diagram: [Purpose] | Author: [auto] | Date: [auto] %%{init: {'theme': 'base', 'themeVariables': { ... }}}%% [diagramType] [content]
CRITICAL: The
%%{init} directive MUST go on the very first non-comment line, BEFORE the diagram type declaration. Alternatively, use YAML frontmatter at the absolute start of the file.
Naming conventions:
- Node IDs: camelCase, descriptive (
, notorderService
)s1 - Labels: natural language in brackets (
)[Order Service] - Relationships: action verbs (
,"Sends order to"
)"Reads from"
Layout best practices:
(top-down) for hierarchical flows and processesTD
(left-right) for timelines, pipelines, and sequential processesLR
for right-to-left reading contextsRL- Use
to group related nodes; name subgraphs meaningfullysubgraph - Add
inside subgraphs when needed for different flowdirection
2.3 — Quick Reference Examples
Flowchart (with professional styling):
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#4f46e5', 'primaryTextColor': '#fff', 'primaryBorderColor': '#3730a3', 'lineColor': '#94a3b8', 'secondaryColor': '#10b981', 'tertiaryColor': '#f59e0b', 'background': '#ffffff', 'mainBkg': '#f8fafc', 'nodeBorder': '#cbd5e1', 'clusterBkg': '#f1f5f9', 'clusterBorder': '#e2e8f0', 'titleColor': '#1e293b', 'edgeLabelBackground': '#ffffff' }}}%% flowchart TD Start([Start]) --> Input[/User Input/] Input --> Validate{Valid?} Validate -->|Yes| Process[Process Data] Validate -->|No| Error[Show Error] Error --> Input Process --> Save[(Save to DB)] Save --> End([End])
For sequence diagram and ERD styling examples, read
references/themes.md.
C4 Context (with MANDATORY elegant styling):
C4Context title System Context — E-Commerce Platform Person(customer, "Customer", "Places orders online") System(platform, "E-Commerce Platform", "Handles orders and payments") System_Ext(payment, "Payment Gateway", "Processes transactions") System_Ext(email, "Email Service", "Sends notifications") Rel(customer, platform, "Uses", "HTTPS") Rel(platform, payment, "Processes payments", "API") Rel(platform, email, "Sends emails", "SMTP") UpdateRelStyle(customer, platform, $textColor="#475569", $lineColor="#94a3b8") UpdateRelStyle(platform, payment, $textColor="#475569", $lineColor="#94a3b8") UpdateRelStyle(platform, email, $textColor="#475569", $lineColor="#94a3b8") UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
Architecture (AWS with Iconify icons):
architecture-beta group vpc(logos:aws-vpc)[VPC] service api(logos:aws-api-gateway)[API Gateway] in vpc service lambda(logos:aws-lambda)[Lambda] in vpc service db(logos:aws-dynamodb)[DynamoDB] in vpc service s3(logos:aws-s3)[S3 Bucket] api:R --> L:lambda lambda:R --> L:db lambda:B --> T:s3
IMPORTANT: Architecture-beta diagrams with
logos:* icons require icon pack registration. When rendering with the render script, use the --icons logos flag. If rendering in a markdown viewer that doesn't support icon packs, use the built-in icons (cloud, database, disk, server, internet) as fallback. Read references/aws-architecture.md for the complete icon catalog and rendering instructions.
For comprehensive syntax of ALL diagram types, read
references/diagram-types.md.
Imported: Step 3: Validate
Before rendering, ALWAYS validate the Mermaid syntax:
node $SKILL_DIR/scripts/validate.mjs <file.mmd>
If validation fails:
- Read the error message carefully
- Consult
for common fixesreferences/troubleshooting.md - Fix the syntax and re-validate
- Maximum 3 fix attempts before asking the user for clarification
Imported: Step 4: Render
4.1 — Setup (First Run Only)
bash $SKILL_DIR/scripts/setup.sh
This auto-installs both rendering engines and icon pack dependencies. Run once per environment.
4.2 — Single Diagram Rendering
# SVG (default — best quality) node $SKILL_DIR/scripts/render.mjs -i diagram.mmd -o diagram.svg # PNG (for documents/presentations) node $SKILL_DIR/scripts/render.mjs -i diagram.mmd -o diagram.png --width 1200 # ASCII (for terminals/READMEs) node $SKILL_DIR/scripts/render-ascii.mjs -i diagram.mmd # With icon packs (architecture-beta with AWS/tech icons) node $SKILL_DIR/scripts/render.mjs -i diagram.mmd -o diagram.svg --icons logos,fa
The
--icons flag registers Iconify packs before rendering. Packs: logos (AWS/tech), fa (Font Awesome). Use logos for AWS.
4.3 — Batch Rendering
For multiple diagrams at once:
node $SKILL_DIR/scripts/batch.mjs \ --input-dir ./diagrams \ --output-dir ./rendered \ --format svg \ --theme default \ --workers 4
4.4 — Available Themes
beautiful-mermaid (15):
tokyo-night | tokyo-night-storm | tokyo-night-light | dracula | nord | nord-light | catppuccin-mocha | catppuccin-latte | github-dark | github-light | solarized-dark | solarized-light | one-dark | zinc-dark | zinc-light
mermaid-cli native (5):
default | forest | dark | neutral | base
Custom theme:
--theme base --config '{"theme":"base","themeVariables":{"primaryColor":"#4f46e5","lineColor":"#94a3b8"}}'
For the full theme catalog, read
references/themes.md. The render script auto-selects the best engine (mmdc primary, beautiful-mermaid fallback, Puppeteer for icon packs).
Imported: 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.
Examples
Example 1: Ask for the upstream workflow directly
Use @mermaid-studio to handle <task>. Start from the copied upstream workflow, load only the files that change the outcome, and keep provenance visible in the answer.
Explanation: This is the safest starting point when the operator needs the imported workflow, but not the entire repository.
Example 2: Ask for a provenance-grounded review
Review @mermaid-studio against metadata.json and ORIGIN.md, then explain which copied upstream files you would load first and why.
Explanation: Use this before review or troubleshooting when you need a precise, auditable explanation of origin and file selection.
Example 3: Narrow the copied support files before execution
Use @mermaid-studio for <task>. Load only the copied references, examples, or scripts that change the outcome, and name the files explicitly before proceeding.
Explanation: This keeps the skill aligned with progressive disclosure instead of loading the whole copied package by default.
Example 4: Build a reviewer packet
Review @mermaid-studio using the copied upstream files plus provenance, then summarize any gaps before merge.
Explanation: This is useful when the PR is waiting for human review and you want a repeatable audit packet.
Best Practices
Treat the generated public skill as a reviewable packaging layer around the upstream repository. The goal is to keep provenance explicit and load only the copied source material that materially improves execution.
- Maximum 15 nodes per diagram (not 20 — fewer is more elegant)
- Use subgraph or 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
- Node IDs: camelCase (orderService, not s1 or os)
- Labels: short, clear natural language ([Order Service])
- Arrows: action verbs with protocol info ("Sends order via gRPC")
Imported Operating Notes
Imported: 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
or boundaries to create whitespace and visual groupingsubgraph - Prefer LR (left-right) for process flows — it reads more naturally
- Use invisible links (
) to add spacing when the layout is crampedA ~~~ B
Rule 4: Meaningful Labels and Consistent Style
- Node IDs: camelCase (
, notorderService
ors1
)os - 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
Troubleshooting
Problem: The operator skipped the imported context and answered too generically
Symptoms: The result ignores the upstream workflow in
packages/skills-catalog/skills/(tooling)/mermaid-studio, fails to mention provenance, or does not use any copied source files at all.
Solution: Re-open metadata.json, ORIGIN.md, and the most relevant copied upstream files. Load only the files that materially change the answer, then restate the provenance before continuing.
Problem: The imported workflow feels incomplete during review
Symptoms: Reviewers can see the generated
SKILL.md, but they cannot quickly tell which references, examples, or scripts matter for the current task.
Solution: Point at the exact copied references, examples, scripts, or assets that justify the path you took. If the gap is still real, record it in the PR instead of hiding it.
Problem: The task drifted into a different specialization
Symptoms: The imported skill starts in the right place, but the work turns into debugging, architecture, design, security, or release orchestration that a native skill handles better. Solution: Use the related skills section to hand off deliberately. Keep the imported provenance visible so the next skill inherits the right context instead of starting blind.
Imported Troubleshooting Notes
Imported: Troubleshooting Quick Reference
| Symptom | Likely Cause | Fix |
|---|---|---|
| Diagram won't render | Syntax error | Run validate.mjs, check brackets/quotes |
| Labels cut off | Text too long | Shorten labels or use line breaks |
| Layout looks wrong | Wrong direction | Try different TD/LR/BT/RL |
| Nodes overlap | Too many nodes | Split into subgraphs or multiple diagrams |
| Lines too dark/thick | No init directive | Add with |
| C4 lines overlapping | No styling applied | Add with offsets to each Rel |
| AWS icons not showing | No icon pack | Use flag or fallback to built-in icons |
not found | Not installed | Run |
| Theme not applied | Wrong engine | beautiful-mermaid themes only work with that engine |
For comprehensive troubleshooting, read
references/troubleshooting.md.
Related Skills
- Use when the work is better handled by that native specialization after this imported skill establishes context.@accessibility
- Use when the work is better handled by that native specialization after this imported skill establishes context.@ai-cold-outreach
- Use when the work is better handled by that native specialization after this imported skill establishes context.@ai-pricing
- Use when the work is better handled by that native specialization after this imported skill establishes context.@ai-sdr
Additional Resources
Use this support matrix and the linked files below as the operator packet for this imported skill. They should reflect real copied source material, not generic scaffolding.
| Resource family | What it gives the reviewer | Example path |
|---|---|---|
| copied reference notes, guides, or background material from upstream | |
| worked examples or reusable prompts copied from upstream | |
| upstream helper scripts that change execution or validation | |
| routing or delegation notes that are genuinely part of the imported package | |
| supporting assets or schemas copied from the source package | |
- aws-architecture.md
- c4-architecture.md
- code-to-diagram.md
- diagram-types.md
- batch.mjs
- render-ascii.mjs
- render.mjs
- setup.sh
Imported Reference Notes
Imported: C4 Diagrams — Mandatory Styling Guide
C4 diagrams have fixed element styling (blue boxes for systems, gray for persons, etc.), but their relationship lines default to harsh black which creates visual noise. You MUST apply these styling rules:
The C4 Styling Pattern
Every C4 diagram MUST include these directives at the end:
%% === MANDATORY STYLING === %% Apply soft line colors to ALL relationships UpdateRelStyle(fromAlias, toAlias, $textColor="#475569", $lineColor="#94a3b8") %% Repeat for each Rel() in the diagram %% Optimize layout spacing UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
C4 Color Values Reference
| Purpose | Color | Hex | Notes |
|---|---|---|---|
| Soft line color | Slate-400 | | Replaces harsh default black |
| Line text color | Slate-600 | | Readable but not dominant |
| Accent line | Blue-400 | | For highlighted or primary relationships |
| Warning line | Amber-500 | | For external/risky connections |
| Custom element bg | Emerald | | For data stores or success highlights |
| Custom element bg | Indigo | | For primary system emphasis |
C4 Layout Tips
CRITICAL — Maximum 6
per diagram. More than 6 relationships causes Dagre to route arrows through nodes, creating unreadable spaghetti. If your system needs more connections, split it into multiple focused diagrams.Rel()
- Use
for most diagrams (prevents horizontal crowding)$c4ShapeInRow="3" - Use
for diagrams with long labels$c4ShapeInRow="2" - Use
always (stacks boundaries vertically for clarity)$c4BoundaryInRow="1" - Apply
to$offsetY="-10"
when labels overlap with elementsUpdateRelStyle - Prefer tree-shaped topologies (1 in, 1-2 out per node) over mesh topologies
- Declare elements in flow order — the order of
declarations affects layoutContainer() - Use directional
,Rel_D
, etc. only as a last resort when auto-layout creates overlappingRel_R
For comprehensive C4 syntax, examples, and patterns, read
references/c4-architecture.md.
Imported: Output Conventions
- Save .mmd source files alongside rendered outputs
- Naming:
(e.g.,{purpose}-{type}.mmd
)auth-flow-sequence.mmd - For batch: maintain input filename, change extension
- Always provide both the .mmd source and rendered file to the user