Token导航 LogoToken导航TokenDH.com
前端设计可写文件github未标认证来源可访问clear审计通过

mermaidMermaid 图表绘制

Agent Skill

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

总安装

259

周安装

11

GitHub Stars

26

下载量

91
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/nilecui/skillsbase --skill mermaid

简介

mermaid 用于处理 GitHub 仓库、Issue、Pull Request 等协作信息。

  • 适合围绕代码变更、仓库状态或协作事项进行整理和分析。
  • 通过 npx skills add 命令从 GitHub 仓库安装,建议结合原始 README 验证功能。
  • 使用前需确认权限边界、项目维护状态,避免触发不必要的网络或文件操作。
  • mermaid 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Mermaid Diagram Skill

This skill helps you create, validate, and render Mermaid diagrams from natural language descriptions, code analysis, or by editing existing diagrams.

Core Workflow

Follow these steps for every diagram creation/modification:

1. Understand the Request

  • Identify the diagram type needed (flowchart, sequence, class, etc.)
  • Extract key elements: entities, relationships, flow, hierarchy
  • Determine if creating new, editing existing, or generating from code

2. Generate Mermaid Code

  • Create syntactically correct Mermaid diagram code
  • Use appropriate diagram type syntax
  • Apply consistent naming and styling
  • Refer to examples/ directory for type-specific syntax (load on-demand)

3. Save to File

  • Write code to .mmd file
  • Generate meaningful filename based on diagram purpose (e.g., user-authentication-flow.mmd, database-schema.mmd)
  • Use kebab-case for filenames

4. Validate with CLI

  • ALWAYS validate using: mmdc -i <filename>.mmd
  • Check for syntax errors and warnings
  • If validation fails, proceed to step 5

5. Auto-Correct Errors

  • Analyze error messages from mmdc
  • Common issues:

- Invalid syntax or keywords - Missing quotes around labels with spaces - Incorrect arrow syntax - Malformed node definitions

  • Automatically fix the code
  • Re-save and re-validate
  • Repeat until validation succeeds

6. Render on Request

  • Default format: SVG
  • Command: mmdc -i <filename>.mmd -o <filename>.svg
  • Alternative formats: PNG (-o <filename>.png), PDF (-o <filename>.pdf)
  • Only render when user explicitly requests a preview/image

Supported Diagram Types

Load examples from examples/ directory as needed:

Basic Diagrams:

  • Flowchart (examples/flowchart.md)
  • Sequence Diagram (examples/sequence.md)
  • Class Diagram (examples/class.md)
  • State Diagram (examples/state.md)
  • Entity Relationship (examples/er.md)

Planning & Management:

  • Gantt Chart (examples/gantt.md)
  • User Journey (examples/journey.md)
  • Timeline (examples/timeline.md)
  • Kanban (examples/kanban.md)

Data Visualization:

  • Pie Chart (examples/pie.md)
  • XY Chart (examples/xy-chart.md)
  • Quadrant Chart (examples/quadrant.md)
  • Sankey (examples/sankey.md)
  • Radar (examples/radar.md)
  • Treemap (examples/treemap.md)

Technical Diagrams:

  • Git Graph (examples/git.md)
  • C4 Diagram (examples/c4.md)
  • Requirement Diagram (examples/requirement.md)
  • Architecture (examples/architecture.md)
  • Block Diagram (examples/block.md)
  • Packet (examples/packet.md)

Organizational:

  • Mindmap (examples/mindmap.md)
  • ZenUML (examples/zenuml.md)

Code Analysis → Diagram

When analyzing code to create diagrams:

Class Diagrams:

  • Extract classes, methods, properties, inheritance, interfaces
  • Show relationships: inheritance, composition, aggregation

Sequence Diagrams:

  • Track function calls, async operations, API interactions
  • Show actors, lifelines, activation boxes

Flowcharts:

  • Map control flow, conditionals, loops
  • Show function entry/exit points

State Diagrams:

  • Identify states from enums, state machines, status fields
  • Map transitions and events

Templates

Common patterns available in templates/common-patterns.md (load on-demand):

  • Standard flowchart structures
  • API sequence patterns
  • Database ER patterns
  • Microservice architecture layouts
  • State machine templates

Best Practices

Styling:

  • Use meaningful node IDs
  • Add clear, concise labels
  • Apply subgraphs for grouping related elements
  • Use classDefs for visual consistency

Readability:

  • Keep diagrams focused (split large diagrams into smaller ones)
  • Use top-to-bottom or left-to-right orientation consistently
  • Add comments in code for complex sections

Validation:

  • NEVER skip validation step
  • Always fix errors before presenting to user
  • Test rendered output when in doubt

Error Handling

If mmdc validation fails:

  1. Read error message carefully
  2. Identify line number and issue
  3. Apply fix (common fixes in examples)
  4. Re-validate
  5. Inform user only if repeated attempts fail

Output Format

Present to user:

Created: <filename>.mmd

<Show the mermaid code in a code block>

✓ Validated successfully with mermaid-cli

If rendered:

Created: <filename>.mmd
Rendered: <filename>.svg

[Show file paths]

Notes

  • Assume mmdc (mermaid-cli) is installed and available
  • Default output format: SVG
  • Always validate before presenting
  • Fix errors autonomously
  • Only load example files when needed for specific diagram type

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

26.93%
按下载量换算25

OpenCode

23.52%
按下载量换算21

Antigravity

20.16%
按下载量换算18

Codex

13.59%
按下载量换算12

Gemini CLI

8.39%
按下载量换算8

windsurf

3.67%
按下载量换算3

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

可写文件

该 Skill 可能写入或修改本地文件,使用前需要确认目标目录和修改范围。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills