Token导航 LogoToken导航

Agent Skill · 开发

skill-mermaid-diagrams(技能 Mermaid diagrams)

skill-mermaid-diagrams 用于整理文档、README、Markdown 和说明材料,适合在 OpenClaw 中需要把零散信息整理成结构清晰的文档时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

skill-mermaid-diagrams 是开发类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为执行命令;许可证为 MIT-0,第三方扫描有提醒项,按安装量在开发类的 21,744 个 Skill 里排第 1,678。

总安装 25,288周安装 1,033GitHub Stars 公开资料未说明下载 8,099核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install skill-mermaid-diagrams

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

skill-mermaid-diagrams 用于生成技术文档中一致的美人鱼图表。适合架构图、流程图等多种可视化需求场景。支持 12 种图表类型并提供模板化输出格式。生成内容依赖外部渲染服务,注意网络延迟影响。建议校验输出图像是否符合项目风格指南。

skill-mermaid-diagrams 属于开发类 Skill,可作为该场景下的辅助能力补充。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install skill-mermaid-diagrams;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

skill-mermaid-diagrams 怎么安装?

在终端执行 openclaw skills install skill-mermaid-diagrams。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

skill-mermaid-diagrams 支持哪些 AI 工具?

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

skill-mermaid-diagrams 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 openclaw skills install skill-mermaid-diagrams 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

skill-mermaid-diagrams 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

skill-mermaid-diagrams 用的人多吗?

公开数据是累计安装 25,288 次,近一周安装 1,033 次,下载 8,099 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

skill-mermaid-diagrams 安全吗?

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

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

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

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

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
skill-mermaid-diagrams

技能 Mermaid diagrams · 本页

25,288—执行命令MIT-0有提醒

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

SKILL.md 原文

name
skill-mermaid-diagrams
description
Generate consistent, template-based Mermaid diagrams for technical content. Supports 12 diagram types (architecture, flowchart, sequence, concept-map, radial-concept, timeline, comparison, comparison-table, gantt, mindmap, class-diagram, state-diagram) with automatic template selection, LLM-powered content generation, syntax validation, and error handling. Use when creating technical illustrations, system architecture visuals, project timelines, class diagrams, state machines, or documentation requiring uniform styling. Triggers on "mermaid diagram", "generate diagram", "create flowchart", "architecture diagram", "sequence diagram", "concept map", "gantt chart", "mind map", "class diagram", "UML diagram", "project timeline", "state diagram", "technical illustration".

Mermaid Diagrams

Generate professional, consistently-styled Mermaid diagrams for technical content with automatic template selection, content generation, and quality validation.

Quick Start

Subagent Pattern (Recommended):

When user requests diagram generation, spawn a subagent:

Generate 3 Mermaid diagrams for /path/to/chapter-01.md and save to diagrams/chapter-01/

The subagent will:

  1. Read chapter content
  2. Select appropriate templates
  3. Generate placeholder content
  4. Create content.json
  5. Run generation script
  6. Validate output

Manual Pattern:

# 1. Create content.json (see assets/example-content.json)
# 2. Render diagrams
node scripts/generate.mjs --content content.json --out diagrams/chapter-01

# 3. Validate
node scripts/validate.mjs --dir diagrams/chapter-01

Prerequisites

Automated Installation (Recommended)

Run the installation script to automatically install and verify mermaid-cli:

cd $SKILL_DIR  # Path to skill-mermaid-diagrams directory
./scripts/install-deps.sh

The script will:

  • Check Node.js version (>= 18.0.0 required)
  • Install or upgrade mermaid-cli to latest version
  • Verify installation and version compatibility
  • Provide troubleshooting guidance if needed

Manual Installation

Alternatively, install Mermaid CLI globally:

npm install -g @mermaid-js/mermaid-cli

Verify installation:

mmdc --version  # Should be >= 11.0.0

Usage Patterns

Subagent Workflow (Primary Pattern)

When a user requests diagram generation, spawn a subagent to handle the complete workflow:

Task: Generate 3 Mermaid diagrams for chapter 5

Steps:
1. Read $CONTENT_DIR/chapters/chapter-05.md
2. Analyze content and select 3 appropriate diagram templates from: architecture, flowchart, sequence, concept-map, timeline, comparison
3. For each selected template:
   - Read template from $SKILL_DIR/assets/
   - Extract placeholders ({{PLACEHOLDER_NAME}} format)
   - Generate concise labels (max 8 words each) based on chapter content
4. Create content.json with structure:
   {
     "chapter": "chapter-05.md",
     "diagrams": [
       {
         "template": "architecture",
         "placeholders": { "SYSTEM_NAME": "...", ... }
       },
       ...
     ]
   }
5. Save to $CONTENT_DIR/diagrams/chapter-05/content.json
6. Run: node $SKILL_DIR/scripts/generate.mjs --content content.json --out $CONTENT_DIR/diagrams/chapter-05
7. Validate: node $SKILL_DIR/scripts/validate.mjs --dir $CONTENT_DIR/diagrams/chapter-05
8. Report success with file count

Note: Replace $SKILL_DIR and $CONTENT_DIR with actual paths:
- SKILL_DIR: Path to skill-mermaid-diagrams directory
- CONTENT_DIR: Path to your content/project directory

Manual Content Generation

If generating content.json manually:

# 1. Create content.json (see assets/example-content.json)
# 2. Render
cd $SKILL_DIR  # Path to skill-mermaid-diagrams directory
node scripts/generate.mjs \
  --content /path/to/content.json \
  --out /path/to/output

# 3. Validate
node scripts/validate.mjs --dir /path/to/output

Parameters:

  • --content / -c: Content JSON file (required)
  • --out / -o: Output directory (default: ./diagrams)

Validate All Generated Diagrams

for dir in diagrams/chapter-*/; do
  node scripts/validate.mjs --dir "$dir"
done

Available Templates

The skill includes 12 professionally-themed templates with consistent color schemes:

  1. architecture.mmd - System architecture, component diagrams, tool integration

- Use for: System components, tool pipelines, agent interactions - Fixed node IDs (space-safe): Uses C1, C2, C3 internally, only labels are customizable

  1. flowchart.mmd - Decision flows, processes, workflows, debugging steps

- Use for: Decision trees, process flows, validation workflows

  1. sequence.mmd - Actor interactions, message passing, session patterns

- Use for: API call sequences, actor communication, message flows

  1. concept-map.mmd - Key concepts, mental models, paradigms, relationships

- Use for: Hierarchical concepts, mental models, knowledge graphs - Improved version (graph-based, not mindmap): Full color control, readable text

  1. radial-concept.mmd - Layered concepts radiating from center - Use for: Progressive summarization, abstraction layers, hierarchical models

- 4 color-coded levels: green → orange → blue → purple

  1. timeline.mmd - Temporal progression, optimization stages, evolution

- Use for: Project phases, evolution timelines, staged processes

  1. comparison.mmd - Trade-offs, quadrant analysis (2D plotting)

- Use for: Cost vs performance, effort vs impact (X/Y coordinate plotting) - Requires X/Y coordinates for items

  1. comparison-table.mmd - Side-by-side feature comparison

- Use for: AI vs Script decisions, option comparisons, feature matrices - Alternative to quadrant when you need simple side-by-side, not 2D plotting

  1. gantt.mmd - Project timelines, task scheduling - Use for: Project planning, milestone tracking, task dependencies

- Supports: Multiple sections, task status (done/active/crit), date ranges

  1. mindmap.mmd - Organic radial mind maps - Use for: Brainstorming, organic thought structures, free-form concept mapping

- Limitation: Auto-assigns colors/text (limited theme control) - Alternative: Use radial-concept.mmd for better color control

  1. class-diagram.mmd - UML class diagrams

- Use for: Object models, database schemas, system architecture (OOP) - Supports: Attributes, methods, relationships (inheritance, composition, association)

  1. state-diagram.mmd - State machines, lifecycle diagrams

- Use for: Process states, object lifecycles, workflow stages - Supports: Transitions with labels, notes on states, start/end markers

Template Placeholder Reference

Each template requires specific placeholders. All placeholders must be provided to avoid rendering errors.

TemplatePlaceholdersComplexityRequired Fields
architecture10MediumSYSTEM_NAME, COMPONENT_1-3_LABEL, EXTERNAL_1-2_LABEL, FLOW_1-4
flowchart11MediumSTART_LABEL, DECISION_1-2, ACTION_1-4, CHOICE_1-2_YES/NO, END_LABEL
sequence8MediumACTOR_1-3, MESSAGE_1-5
concept-map15HighCENTRAL_CONCEPT, BRANCH_1-4, BRANCH_X_SUB_1-3
radial-concept13MediumCENTRAL_CONCEPT, LEVEL_1-4_LABEL, LEVEL_X_NODE_1-3
timeline6LowEVENT_1-6, DATE_1-6
comparison18HighCOMPARISON_TITLE, X/Y_AXIS_LOW/HIGH, QUADRANT_1-4_LABEL, ITEM_1-5 + X/Y coords
comparison-table10LowOPTION_1-2_TITLE, OPTION_X_CRITERION_1-4
gantt14HighCHART_TITLE, SECTION_1-3_TITLE, TASK_X_Y (name/id/start/duration)
mindmap13MediumROOT_CONCEPT, BRANCH_1-4, BRANCH_X_CHILD_1-3
class-diagram21HighCLASS_1-3_NAME, CLASS_X_ATTR_1-3, CLASS_X_METHOD_1-3, REL_1-3_TYPE/LABEL
state-diagram18MediumSTATE_1-8, TRANSITION_1-7_LABEL, STATE_1/4/7_NOTE

Important Notes:

  • architecture.mmd: Uses fixed node IDs (C1, C2, C3, E1, E2) internally. Only *_LABEL placeholders are customizable. Labels can contain spaces (space-safe).
  • concept-map.mmd: Improved graph-based version (replaced mindmap). Better color control and readability.
  • comparison.mmd: QuadrantChart requires X/Y coordinates. Use comparison-table.mmd for simple side-by-side comparisons.
  • gantt.mmd: Task status options: done, active, crit, or blank. Date format: YYYY-MM-DD. Duration: Nd (days) or YYYY-MM-DD.
  • mindmap.mmd: Limited theme control (auto-colors, auto-text). For controlled colors/text, use radial-concept.mmd instead.
  • class-diagram.mmd: Relationship types: <|-- (inheritance), *-- (composition), o-- (aggregation), --> (association), ..> (dependency).
  • state-diagram.mmd: Uses stateDiagram-v2 syntax. States are simple identifiers (no spaces). Notes attach to states 1, 4, and 7.
  • Text length limits: Generator warns if labels exceed recommended length (25-50 chars depending on template).

Placeholder Naming Convention:

  • Component labels: COMPONENT_1_LABEL, COMPONENT_2_LABEL
  • Branch hierarchy: BRANCH_1, BRANCH_1_SUB_1, BRANCH_1_SUB_2
  • Level-based: LEVEL_1_LABEL, LEVEL_1_NODE_1

Changelog & Migration Notes

v2.0 (2026-02-15) - Root Cause Fixes

Breaking Changes:

  1. architecture.mmd - Fixed node ID handling (space-safe)

- Before: Used placeholder values as node IDs → failed when labels contained spaces - After: Uses fixed node IDs (C1, C2, C3) → labels can contain any characters - Migration: Remove COMPONENT_1, COMPONENT_2, COMPONENT_3 from content.json (only *_LABEL variants needed)

  1. concept-map.mmd - Replaced mindmap with graph-based version

- Before: Mindmap syntax with auto-colors, black-on-purple text (unreadable) - After: Graph LR syntax with explicit styling, white text on dark backgrounds - Result: +100% contrast improvement (2.6:1 → 5.2:1 on purple nodes) New Features:

  • radial-concept.mmd - Progressive summarization diagrams with 4 color-coded levels
  • comparison-table.mmd - Side-by-side feature comparison (alternative to quadrant chart)
  • Validation - Generator now warns about text length, unresolved placeholders, special characters

All changes target root causes (template design flaws, missing validation) rather than surface symptoms.


Color Scheme (Consistent Across All Templates)

  • Primary Blue: #4A90E2 - Main components, actions
  • Secondary Purple: #7B68EE - Supporting elements
  • Tertiary Green: #90EE90 - External actors, success states
  • Warning Yellow: #FFD700 - Decisions, cautions
  • Error Red: #FF6B6B - Failures, critical paths

Output Structure

After generation, each chapter directory contains:

diagrams/chapter-01/
├── diagram-01-architecture.mmd   # Mermaid source
├── diagram-01-architecture.svg   # Vector output
├── diagram-01-architecture.png   # Raster output (1200px wide)
├── diagram-02-flowchart.mmd
├── diagram-02-flowchart.svg
├── diagram-02-flowchart.png
├── diagram-03-concept-map.mmd
├── diagram-03-concept-map.svg
├── diagram-03-concept-map.png
└── summary.json                   # Generation metadata

Error Handling

The generator includes robust error handling:

  • Template Selection Failure: Falls back to first N templates in order
  • Content Generation Failure: Skips diagram, continues with next
  • Rendering Failure: Reports error, saves .mmd source for manual debugging
  • Missing mmdc CLI: Exits early with installation instructions

Quality Validation

The validator checks each diagram for:

  1. ✅ File readable and valid UTF-8
  2. ✅ Theme configuration present
  3. ✅ No unresolved placeholders ({{PLACEHOLDER}})
  4. ✅ SVG file rendered
  5. ✅ PNG file rendered
  6. ✅ Syntax valid (can re-render without errors)

Validation workflow:

# Generate diagrams
node scripts/generate.mjs --content content.json --out diagrams/chapter-01

# Validate output
node scripts/validate.mjs --dir diagrams/chapter-01

# Fix any failures and re-run

Cost Analysis

Per Chapter (3 diagrams):

  • Subagent LLM usage:

- Chapter reading: ~3000 tokens input - Template selection: ~500 tokens output - Content generation (3 diagrams): ~1500 tokens output - Total: ~5000 tokens (~$0.002)

  • Rendering: Free (local mmdc)

At scale (e.g. 14 chapters × 3 diagrams = 42 diagrams):

  • 14 × $0.002 = ~$0.03 total

Comparison to AI image generation (42 images):

  • Mermaid diagrams: ~$0.03
  • GLM images: ~$0.63
  • DALL-E images: ~$2.52
  • Savings: 95-99% vs AI image generation

Customization

Modify Color Scheme

Edit theme variables in any template file (assets/*.mmd):

%%{init: {'theme':'base', 'themeVariables': {
  'primaryColor':'#NEW_COLOR',
  'secondaryColor':'#NEW_COLOR',
  ...
}}}%%

Add New Template

  1. Create assets/new-template.mmd with theme and placeholders
  2. Add entry to TEMPLATES object in scripts/generate.mjs:
const TEMPLATES = {
  ...
  "new-template": "Description of when to use this template",
};
  1. Test with content:
node scripts/generate.mjs --content test-content.json --out test-output

Troubleshooting

"mmdc not found"

  • Install: npm install -g @mermaid-js/mermaid-cli
  • Verify: which mmdc

"Template not found"

  • Check template name in content.json matches file in assets/ (case-sensitive)
  • Available templates: architecture, flowchart, sequence, concept-map, radial-concept, timeline, comparison, comparison-table, gantt, mindmap, class-diagram, state-diagram

"Rendering failed"

  • Check .mmd file for syntax errors
  • Manually test: mmdc -i diagram.mmd -o test.svg
  • Validate with: node scripts/validate.mjs --dir output_dir

Unresolved placeholders in output ({{PLACEHOLDER}})

  • Subagent didn't generate all required placeholder values
  • Check template file to see required placeholders
  • Manually add missing values to content.json and re-run generate.mjs

Subagent failed

  • Check chapter file path is correct
  • Verify skill path is accessible from subagent
  • Ensure mmdc is installed globally (subagent needs it too)

Examples

Generated Architecture Diagram

%%{init: {'theme':'base', ...}}%%
graph TB
    subgraph "Agent System"
        Gateway[Gateway Process]
        Session[Session Manager]
        Tools[Tool Registry]
    end

    User((User))
    Provider((LLM Provider))

    User -->|Request| Gateway
    Gateway -->|Route| Session
    Session -->|Select Tool| Tools
    Tools -->|Execute| Provider

Output: Clean, consistent, professional diagram with uniform styling across all chapters.

Best Practices

  1. Consistent counts: Use same --max value for all chapters (e.g., 3)
  2. Review before commit: Run validator on all outputs before pushing
  3. Version control: Commit both .mmd source and .svg/.png renders
  4. Iterate templates: If diagrams look wrong, adjust template then regenerate
  5. Manual touch-ups: Edit .mmd files directly for fine-tuning, then re-render with mmdc

Testing

Installation Test

./scripts/install-deps.sh

Verifies that mermaid-cli is installed and meets version requirements.

Functional Test

  1. Create test content: assets/example-content.json (already included)
  2. Generate diagrams: node scripts/generate.mjs --content assets/example-content.json --out test-output
  3. Validate output: node scripts/validate.mjs --dir test-output
  4. Verify all checks pass

References

Local Documentation

  • Mermaid Syntax Guide: references/mermaid-syntax.md - Quick reference for diagram syntax, theming, and common patterns
  • Example Content: assets/example-content.json - Real-world content structure example

External Resources

  • Mermaid Docs: https://mermaid.js.org/
  • Syntax Reference: https://mermaid.js.org/intro/syntax-reference.html
  • Theming Guide: https://mermaid.js.org/config/theming.html
  • CLI Documentation: https://github.com/mermaid-js/mermaid-cli
  • Live Editor: https://mermaid.live/ (interactive testing)

平台分布

OpenClaw

73.76%
按下载量换算5,974

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

未展示

权限和风险

执行命令

安装流程涉及命令执行,可能通过 openclaw skills install skill-mermaid-diagrams 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

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

继续浏览同类 Skills