Token导航 LogoToken导航

Agent Skill · 前端设计

mermaid-studio(Mermaid studio 命令行)

mermaid-studio 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

mermaid-studio 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描有提醒项,按安装量在前端设计类的 10,216 个 Skill 里排第 2,608。

总安装 2,070周安装 88GitHub Stars 2,304下载 725核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:mermaid-studio(Mermaid studio 命令行)
来源仓库:https://github.com/tech-leads-club/agent-skills
仓库路径:skills/mermaid-studio
安装命令:
npx skills add https://github.com/tech-leads-club/agent-skills --skill mermaid-studio
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tech-leads-club/agent-skills --skill mermaid-studio

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合围绕仓库状态、代码变更或协作事项进行整理与分析。通过 npx 命令从 GitHub 仓库安装,需确认权限范围和维护状态。使用前建议核实是否会触发联网、命令执行或文件读写操作。

mermaid-studio 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/mermaid-studio

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/tech-leads-club/agent-skills --skill mermaid-s…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

mermaid-studio 怎么安装?

在终端执行 npx skills add https://github.com/tech-leads-club/agent-skills --skill mermaid-studio。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

mermaid-studio 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

mermaid-studio 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

mermaid-studio 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

mermaid-studio 用的人多吗?

公开数据是累计安装 2,070 次,近一周安装 88 次,下载 725 次,GitHub 2,304 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

mermaid-studio 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 来源仓库有 2,304 星,维护活跃度相对可查。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
mermaid-studio

Mermaid studio 命令行 · 本页

2,0702,304调用外部服务未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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

Rule 4: Meaningful Labels and Consistent Style

  • 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")
  • 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:

ModeTriggerWhat 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 requestsCreate → Validate → Render

Default to Full mode when intent is unclear.

Step 1: Understand the Request

Before writing any Mermaid code, determine:

  1. What to diagram — system, flow, schema, architecture, code structure?
  2. Which diagram type — use the Decision Matrix below
  3. Output format — code only, SVG, PNG, or ASCII?
  4. Theme preference — ask only if rendering; default to base theme with curated palette

Diagram Type Decision Matrix

User describes...Diagram TypeSyntax keyword
Process, algorithm, decision tree, workflowFlowchartflowchart TD/LR
API calls, message passing, request/responseSequencesequenceDiagram
Database schema, table relationshipsERDerDiagram
OOP classes, domain model, interfacesClassclassDiagram
State machine, lifecycle, transitionsStatestateDiagram-v2
High-level system overview (C4 Level 1)C4 ContextC4Context
Applications, databases, services (C4 Level 2)C4 ContainerC4Container
Internal components (C4 Level 3)C4 ComponentC4Component
Request flows with numbered stepsC4 DynamicC4Dynamic
Infrastructure, cloud deploymentC4 DeploymentC4Deployment
Cloud services with icons (AWS/GCP/Azure)Architecturearchitecture-beta
Project timeline, schedulingGanttgantt
Proportional data, percentagesPiepie
Brainstorming, hierarchical ideasMindmapmindmap
Historical events, chronologyTimelinetimeline
Branching strategy, git historyGit GraphgitGraph
Flow quantities, resource distributionSankeysankey-beta
X/Y data visualizationXY Chartxychart-beta
Priority matrix, strategic positioningQuadrantquadrantChart
Layout control, grid positioningBlockblock-beta
Network packets, protocol headersPacketpacket-beta
Task boards, kanban workflowKanbankanban
User experience, satisfaction scoringUser Journeyjourney
System requirements traceabilityRequirementrequirementDiagram

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 references/c4-architecture.md BEFORE writing code
  • AWS/Cloud architecture → Read references/aws-architecture.md BEFORE writing code
  • Code-to-diagram → Read references/code-to-diagram.md BEFORE analyzing
  • Theming/styling → Read references/themes.md when user requests custom themes
  • Syntax errors → Read references/troubleshooting.md when validation fails
  • Any diagram type details → Read references/diagram-types.md for comprehensive syntax

Step 2: Create the Diagram

2.1 — Write Mermaid Code

Follow these principles in order of priority:

  1. Elegance first — every diagram must look professional with init directives and curated colors
  2. Correctness — valid syntax that renders without errors
  3. Clarity — meaningful labels, logical flow direction, clear relationships
  4. Simplicity — under 15 nodes per diagram; split complex systems into multiple
  5. 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 (orderService, not s1)
  • Labels: natural language in brackets ([Order Service])
  • Relationships: action verbs ("Sends order to", "Reads from")

Layout best practices:

  • TD (top-down) for hierarchical flows and processes
  • LR (left-right) for timelines, pipelines, and sequential processes
  • RL for right-to-left reading contexts
  • Use subgraph to group related nodes; name subgraphs meaningfully
  • Add direction inside subgraphs when needed for different flow

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.

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

PurposeColorHexNotes
Soft line colorSlate-400#94a3b8Replaces harsh default black
Line text colorSlate-600#475569Readable but not dominant
Accent lineBlue-400#60a5faFor highlighted or primary relationships
Warning lineAmber-500#f59e0bFor external/risky connections
Custom element bgEmerald#10b981For data stores or success highlights
Custom element bgIndigo#4f46e5For primary system emphasis

C4 Layout Tips

CRITICAL — Maximum 6 Rel() 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.

  • Use $c4ShapeInRow="3" for most diagrams (prevents horizontal crowding)
  • Use $c4ShapeInRow="2" for diagrams with long labels
  • Use $c4BoundaryInRow="1" always (stacks boundaries vertically for clarity)
  • Apply $offsetY="-10" to UpdateRelStyle when labels overlap with elements
  • Prefer tree-shaped topologies (1 in, 1-2 out per node) over mesh topologies
  • Declare elements in flow order — the order of Container() declarations affects layout
  • Use directional Rel_D, Rel_R, etc. only as a last resort when auto-layout creates overlapping

For comprehensive C4 syntax, examples, and patterns, read references/c4-architecture.md.

Step 3: Validate

Before rendering, ALWAYS validate the Mermaid syntax:

node $SKILL_DIR/scripts/validate.mjs <file.mmd>

If validation fails:

  1. Read the error message carefully
  2. Consult references/troubleshooting.md for common fixes
  3. Fix the syntax and re-validate
  4. Maximum 3 fix attempts before asking the user for clarification

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

Step 5: Code-to-Diagram (When Requested)

When the user asks to visualize existing code or architecture:

  1. Read references/code-to-diagram.md for the analysis methodology
  2. 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 - State machines in code → State diagram

  1. Generate the.mmd file with proper init directives (Golden Rule 1)
  2. Validate and render as usual

Troubleshooting Quick Reference

SymptomLikely CauseFix
Diagram won't renderSyntax errorRun validate.mjs, check brackets/quotes
Labels cut offText too longShorten labels or use line breaks <br/>
Layout looks wrongWrong directionTry different TD/LR/BT/RL
Nodes overlapToo many nodesSplit into subgraphs or multiple diagrams
Lines too dark/thickNo init directiveAdd %%{init} with lineColor: '#94a3b8'
C4 lines overlappingNo styling appliedAdd UpdateRelStyle with offsets to each Rel
AWS icons not showingNo icon packUse --icons logos flag or fallback to built-in icons
mmdc not foundNot installedRun setup.sh
Theme not appliedWrong enginebeautiful-mermaid themes only work with that engine

For comprehensive troubleshooting, read references/troubleshooting.md.

Output Conventions

  • Save.mmd source files alongside rendered outputs
  • Naming: {purpose}-{type}.mmd (e.g., auth-flow-sequence.mmd)
  • For batch: maintain input filename, change extension
  • Always provide both the.mmd source and rendered file to the user

平台分布

Codex

35.16%
按下载量换算255

Claude

32.71%
按下载量换算237

Cursor

19.9%
按下载量换算144

Gemini CLI

9.34%
按下载量换算68

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills