SuperAPI AI 工具集

mermaid-studio

通用与其它

查看项目

更新于 10-15 22:09

技能介绍

用途:根据描述或代码分析创建 Mermaid 图表,校验语法,并渲染为 SVG、PNG 或 ASCII。适用于流程、时序、ERD、类图、状态、C4 架构、甘特图、思维导图等多种图表场景。

主要能力:支持 20 多种图表类型,含 C4 的 Context/Container/Component/Dynamic/Deployment,以及 architecture-beta、Git Graph、Sankey、XY Chart、Quadrant、Kanban、User Journey 等;提供 Create、Render、Full 三种工作模式;内置校验与多引擎渲染(mmdc 主引擎、beautiful-mermaid 回退、Puppeteer 处理图标包)。

必要用法:先安装依赖 bash $SKILL_DIR/scripts/setup.sh;校验 node $SKILL_DIR/scripts/validate.mjs <file.mmd>;渲染 SVG 用 node $SKILL_DIR/scripts/render.mjs -i diagram.mmd -o diagram.svg,PNG 加 --width 1200,ASCII 用 render-ascii.mjs -i diagram.mmd,图标包加 --icons logos,fa;批量渲染用 batch.mjs 并指定 --input-dir、--output-dir、--format、--workers。

使用约束:图表建议不超过 15 个节点,C4 图表不超过 6 条关系;必须使用 init 指令或 frontmatter 配置主题,行色建议 #94a3b8;不要在主题变量中设置 fontFamily,否则在无头 Chromium 中可能显示异常。渲染主题包括 beautiful-mermaid 系列与 mermaid-cli 原生主题,具体以参考资料为准。

限制:资料未提供收费、价格或平台信息。