Xpersona
M

Mermaid Charts 全图表画图技能

CLAWHUB · Unverified

使用 Mermaid 语法生成流程图、时序图、类图等多种图表,支持输出 PNG 和交互型 HTML 格式。 Skill: Mermaid Charts 全图表画图技能 Owner: harrot90-code Summary: 使用 Mermaid 语法生成流程图、时序图、类图等多种图表,支持输出 PNG 和交互型 HTML 格式。 Tags: latest:1.0.0 Version history: v1.0.0 | 2026-04-04T06:10:25.430Z | user Initial release: 15 chart types (flowchart/sequence/class/state/ER/gantt/pie/mindmap/timeline/git/sankey/xy/block/quadrant/journey), PNG+HTML dual output, layout anti-pattern rules, CJK support Archive index: Archive v1.0.0: 3 fi

62
Rank
84
Safety
1.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s173pzdpwe5fnqnebr870vs8bn83xnvw:mermaid-charts
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-harrot90-code-mermaid-charts/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

16,631 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

# Mermaid Diagram 画图技能

> 使用 Mermaid 语法生成各类图表(流程图、时序图、甘特图、饼图等),支持 PNG 和 HTML 两种输出格式。

---

## 输出格式

### 格式一:PNG 图片(推荐用于分享/嵌入)

```bash
mmdc -i input.mmd -o output.png -w <宽度> -H <高度> -b <背景色> -t <主题>
```

| 参数 | 说明 | 默认值 |
|------|------|--------|
| `-i` | 输入 `.mmd` 文件 | 必填 |
| `-o` | 输出文件(`.png` / `.svg` / `.pdf`) | 必填 |
| `-w` | 页面宽度(像素) | 800 |
| `-H` | 页面高度(像素) | 600 |
| `-b` | 背景色(`transparent`, `white`, `#F0F0F0`) | `white` |
| `-t` | 主题(`default`, `forest`, `dark`, `neutral`) | `default` |
| `-s` | 缩放比例 | 1 |
| `-c` | JSON 配置文件 | 无 |

**工作流程:**
1. 将 mermaid 代码写入 `.mmd` 文件
2. 执行 `mmdc` 命令生成 PNG
3. 检查输出图片尺寸和宽高比

### 格式二:HTML 文件(推荐用于交互/修改)

```html
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Mermaid Diagram</title>
  <script type="module">
    import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
    mermaid.initialize({ startOnLoad: true, theme: 'default' });
  </script>
</head>
<body>
  <pre class="mermaid">
    <!-- 在此处粘贴 mermaid 代码 -->
  </pre>
</body>
</html>
```

---

## ❗ 布局与排版规范(必读)

### 宽高比控制原则

| 原则 | 说明 |
|------|------|
| **避免极端比例** | 宽高比不超过 3:1 或 1:3 |
| **流程图方向选择** | 节点 ≤6 个横向用 `LR`,≥7 个纵向用 `TD` |
| **控制单层节点数** | 同一层级不超过 5-6 个节点 |
| **复杂图表拆分** | 超过 15 个节点考虑拆成多张图 |

### 方向选择指南

| 方向 | 关键字 | 适用场景 |
|------|--------|----------|
| 上→下 | `TD` / `TB` | 层级结构、决策树、组织架构 |
| 左→右 | `LR` | 流程/管道、时间线式流程 |
| 下→上 | `BT` | 自底向上的构建过程 |
| 右→左 | `RL` | 回溯/反向流程 |

### 各图表推荐画布尺寸

| 图表类型 | 推荐宽度 | 推荐高度 | 说明 |
|----------|----------|----------|------|
| Flowchart (TD, ≤8 节点) | 800 | 600 | 标准 4:3 |
| Flowchart (LR, ≤6 节点) | 1000 | 500 | 横向 2:1 |
| Flowchart (大型 >10 节点) | 1200 | 800 | 加大画布 |
| Sequence Diagram (≤5 参与者) | 800 | 600 | 标准 |
| Sequence Diagram (>5 参与者) | 1200 | 600 | 加宽 |
| Class Diagram | 1000 | 700 | 略宽 |
| State Diagram | 800 | 600 | 标准 |
| ER Diagram | 1000 | 700 | 略宽 |
| Gantt Chart (≤10 任务) | 1000 | 500 | 横向 2:1 |
| Gantt Chart (>10 任务) | 1200 | 700 | 加高 |
| Pie Chart | 700 | 700 | 1:1 正方形 |
| Mindmap | 1000 | 700 | 略宽 |
| Timeline (≤5 时期) | 1000 | 500 | 横向 |
| Timeline (>5 时期) | 1200 | 600 | 加宽 |
| Git Graph | 1000 | 500 | 横向 |
| Sankey Diagram | 1000 | 600 | 略宽 |
| XY Chart | 800 | 600 | 标准 4:3 |
| Quadrant Chart | 700 | 700 | 1:1 正方形 |
| User Journey | 1000 | 500 | 横向 |
| Block Diagram | 800 | 600 | 标准 |

---

## 图表类型详解

---

### 1. Flowchart(流程图)

**使用场景:** 业务流程、决策树、系统架构、算法步骤

**语法模板:**
```mermaid
flowchart TD
    A[开始] --> B{条件判断}
    B -->|是| C[执行操作A]
    B -->|否| D[执行操作B]
    C --> E[结束]
    D --> E
```

**节点形状:**
| 语法 | 形状 | 用途 |
|------|------|------|
| `A[文本]` | 矩形 | 普通步骤 |
| `A(文本)` | 圆角矩形 | 普通步骤(柔和) |
| `A{文本}` | 菱形 | 条件判断 |
| `A((文本))` | 圆形 | 起止点 |
| `A([文本])` | 体育场形 | 起止点(替代) |
| `A[[文本]]` | 子程序 | 子流程调用 |
| `A[(文本)]` | 圆柱体 | 数据库 |
| `A>文本]` | 旗帜形 | 标记/信号 |
| `A{{文本}}` | 六边形 | 准备/条件 |
| `A[/文本/]` | 平行四边形 | 输入/输出 |

**连线类型:**
| 语法 | 说明 |
|------|------|
| `-->` | 带箭头实线 |
| `---` | 无箭头实线 |
| `-.->` | 带箭头虚线 |
| `==>` | 带箭头粗线 |
| `--文字-->` | 带标签的线 |
| `-->|文字|` | 带标签的线(另一种写法

_meta.json

{
  "ownerId": "kn7dc7ezxh59g9t8r5b85vbcxd82ekpe",
  "slug": "mermaid-charts",
  "version": "1.0.0",
  "publishedAt": 1775283025430
}

skill-card.md

## Description:

使用 Mermaid 语法生成流程图、时序图、甘特图、饼图等多种图表,并指导代理输出 PNG 或交互型 HTML 图表文件。

This skill is ready for commercial/non-commercial use.

## Publisher:

[harrot90-code](https://clawhub.ai/user/harrot90-code)

### License/Terms of Use:

MIT-0

## Use Case:

Developers, documentation writers, and agents use this skill to draft Mermaid diagrams for technical workflows, data models, timelines, journeys, and planning artifacts, then render them as PNG, SVG, PDF, or HTML when needed.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: HTML examples may load Mermaid JavaScript from a public CDN, which is unsuitable for some sensitive or offline documents.

Mitigation: For sensitive or offline use, pin, vendor, or self-host Mermaid before rendering HTML.

Risk: Generated Mermaid diagrams can misrepresent complex systems if syntax, layout, or labels are not reviewed.

Mitigation: Review the Mermaid source and rendered output before publishing or embedding diagrams.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/harrot90-code/skills/mermaid-charts)
- [Artifact SKILL.md](artifact/SKILL.md)

## Skill Output:

**Output Type(s):** [Markdown, Code, Shell commands, Configuration, Guidance]

**Output Format:** [Markdown with Mermaid code blocks, shell commands, and HTML examples]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Can guide creation of PNG, SVG, PDF, and HTML diagram files with Mermaid CLI or browser rendering.]

## Skill Version(s):

1.0.0 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Mermaid Charts 全图表画图技能 and adjacent AI workflows.