跳到正文
cccskills
免费在 GitHub 公开中文介绍

beautiful-mermaid

将文字说明或Mermaid代码转为展示流程、交互及数据关系的图表,可选择配色主题,同时保存放大后仍清晰的SVG和高分辨率PNG。

原文查看原文说明

Render Mermaid diagrams as SVG and PNG using the Beautiful Mermaid library. Use when the user asks to render a Mermaid diagram.

实测评分 未实测

查看安装方法

适用场景

  • 绘制业务流程和判断分支
  • 说明API交互过程
  • 可视化数据库关系
  • 选择配色并导出图表

中文介绍

功能

将文字说明或Mermaid代码制作成图表,同时保存SVG和PNG。支持展示流程分支的流程图、展示交互顺序的时序图、状态图、类图,以及展示数据关系的实体关系图。使用Beautiful Mermaid渲染,可选择浅色、深色等配色主题。

适用场景

适合用图表说明业务步骤、API调用或数据库结构。即使没有Mermaid代码,流程也包含根据文字生成图表代码的步骤。需要同时准备可放大使用的SVG和便于作为图片使用的PNG时,也可使用这项技能。

使用示例

  • “把这套审批步骤画成流程图,并保存为SVG和PNG。”
  • “用github-dark主题将这段Mermaid代码渲染成图片。”

注意事项

制作PNG需要agent-browser技能。脚本提供使用Bun运行的示例,也有tsx和Deno的示例。未指定主题时使用default;未指定保存位置时,文件输出到当前工作目录。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

文档检查

AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。

安全性发送数据、删除文件、执行命令等是否有说明
A良好明确将rm删除范围限定为生成的中间文件,并要求保留最终图片。
安装难易度所需工具和 API 密钥是否少且有说明
B部分不足列出了agent-browser和运行环境选项,但没有安装步骤。

不计入评分。 由 AI(OpenAI Codex)于 2026年10月23日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(4)

  • SKILL.md5.0 KB
  • references/mermaid-syntax.md4.3 KB
  • scripts/create-html.ts4.2 KB
  • scripts/render.ts5.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Beautiful Mermaid Diagram Rendering

Render Mermaid diagrams as SVG and PNG images using the Beautiful Mermaid library.

Dependencies

This skill requires the agent-browser skill for PNG rendering. Load it before proceeding with PNG capture.

Supported Diagram Types

  • Flowchart - Process flows, decision trees, CI/CD pipelines
  • Sequence - API calls, OAuth flows, database transactions
  • State - State machines, connection lifecycles
  • Class - UML class diagrams, design patterns
  • Entity-Relationship - Database schemas, data models

Available Themes

Default, Dracula, Solarized, Zinc Dark, Tokyo Night, Tokyo Night Storm, Tokyo Night Light, Catppuccin Latte, Nord, Nord Light, GitHub Dark, GitHub Light, One Dark.

If no theme is specified, use default.

Common Syntax Patterns

Flowchart Edge Labels

Use pipe syntax for edge labels:

A -->|label| B
A ---|label| B

Avoid space-dash syntax which can cause incomplete renders:

A -- label --> B   # May cause issues

Node Labels with Special Characters

Wrap labels containing special characters in quotes:

A["Label with (parens)"]
B["Label with / slash"]

Workflow

Step 1: Generate or Validate Mermaid Code

If the user provides a description rather than code, generate valid Mermaid syntax. Consult references/mermaid-syntax.md for full syntax details.

Step 2: Render SVG

Run the rendering script to produce an SVG file:

bun run scripts/render.ts --code "graph TD; A-->B" --output diagram --theme default

Or from a file:

bun run scripts/render.ts --input diagram.mmd --output diagram --theme tokyo-night

Alternative runtimes:

npx tsx scripts/render.ts --code "..." --output diagram
deno run --allow-read --allow-write --allow-net scripts/render.ts --code "..." --output diagram

This produces <output>.svg in the current working directory.

Step 3: Create HTML Wrapper

Run the HTML wrapper script to prepare for screenshot:

bun run scripts/create-html.ts --svg diagram.svg --output diagram.html

This creates a minimal HTML file that displays the SVG with proper padding and background.

Step 4: Capture High-Resolution PNG with agent-browser

Use the agent-browser CLI to capture a high-quality screenshot. Refer to the agent-browser skill for full CLI documentation.

# Set 4K viewport for high-resolution capture
agent-browser set viewport 3840 2160

# Open the HTML wrapper
agent-browser open "file://$(pwd)/diagram.html"

# Wait for render to complete
agent-browser wait 1000

# Capture full-page screenshot
agent-browser screenshot --full diagram.png

# Close browser
agent-browser close

For even higher resolution on complex diagrams, increase the viewport further or use the --padding option when creating the HTML wrapper to give the diagram more space.

Step 5: Clean Up Intermediary Files

After rendering, remove all intermediary files. Only the final .svg and .png should remain.

Files to clean up:

  • The HTML wrapper file (e.g., diagram.html)
  • Any temporary .mmd files created to hold diagram code
  • Any other files created during the rendering process
rm diagram.html

If a temporary .mmd file was created, remove it as well.

Output

Both outputs are always produced:

  • SVG: Vector format, infinitely scalable, small file size
  • PNG: High-resolution raster, captured at 4K (3840×2160) viewport with minimum 1200px diagram width

Files are saved to the current working directory unless the user explicitly specifies a different path.

Theme Selection Guide

ThemeBackgroundBest For
defaultLight greyGeneral use
draculaDark purpleDark mode preference
tokyo-nightDark blueModern dark aesthetic
tokyo-night-stormDarker blueHigher contrast
nordDark arcticMuted, calm visuals
nord-lightLight arcticLight mode with soft tones
github-darkGitHub darkMatches GitHub UI
github-lightGitHub lightMatches GitHub UI
catppuccin-latteWarm lightSoft pastel aesthetic
solarizedTan/creamSolarized colour scheme
one-darkAtom darkAtom editor aesthetic
zinc-darkNeutral darkMinimal, no colour bias

Troubleshooting

Theme not applied

Check the render script output for the bg and fg values, or inspect the SVG's opening tag for --bg and --fg CSS custom properties.

Diagram appears cut off or incomplete

  • Check edge label syntax — use -->|label| pipe notation, not -- label -->
  • Verify all node IDs are unique
  • Check for unclosed brackets in node labels

Render produces empty or malformed SVG

  • Validate Mermaid syntax at https://mermaid.live before rendering
  • Check for special characters that need escaping (wrap in quotes)
  • Ensure flowchart direction is specified (graph TD, graph LR, etc.)

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

3d-asset-generation

免费有简介

从文字或图像生成3D模型,并与目录素材搭配使用。在Blender中检查形状、材质、大小和接地情况,记录生成条件、来源及费用,再将素材加入场景。

  • 根据文字生成独特的3D道具
  • 将概念图中的物体转为3D模型
  • 用目录中的植被和岩石填充背景
calesthio/OpenMontage7.1万2026年10月17日 更新

acestep

免费有简介

使用ACE-Step 1.5生成视频背景音乐和带歌词的歌曲,可指定曲风、时长、速度与调性,也支持改编参考音频,以及从混合音频中分离人声或乐器。

  • 制作适合视频场景的背景音乐
  • 制作带歌词的短广告曲
  • 将参考音频改编为爵士风格
calesthio/OpenMontage7.1万2026年10月17日 更新

agents

免费有简介

使用ElevenLabs创建语音对话助手或角色,配置声音、应答规则、语言模型及外部工具,支持嵌入网站,并通过Twilio集成设置电话外呼。

  • 创建回答咨询的语音机器人
  • 在网站中嵌入语音引导
  • 制作可对话的语音角色原型
calesthio/OpenMontage7.1万2026年10月17日 更新

ai-video-gen

免费有简介

根据文字或参考图像生成AI视频,并按用途、可用服务和预算选择模型。可制作社交平台竖屏短片、让商品照片动起来,也可通过对话编辑已有片段。

  • 制作社交平台竖屏短片
  • 为商品照片添加动态效果
  • 按预算和风格选择生成服务
calesthio/OpenMontage7.1万2026年10月17日 更新

ai-video-gen

免费有简介

根据文字描述或参考图片生成AI视频,并按用途和费用选择生成服务。支持设置画面比例、查看生成进度,以及通过Gemini Omni对话修改现有视频。

  • 将文字描述的场景制作成视频
  • 为商品照片添加动态效果
  • 制作社交媒体竖屏视频
calesthio/OpenMontage7.1万2026年10月17日 更新

atlas-cloud

免费有简介

通过Atlas Cloud使用多种模型生成和编辑图像与视频,只需一个API密钥,即可保存生成素材,以及所用模型、提交设置和预估费用等记录。

  • 通过同一服务生成图像和视频
  • 利用参考素材编辑商品图
  • 参考图像、视频和音频生成视频
calesthio/OpenMontage7.1万2026年10月17日 更新

查看 calesthio 的全部技能

报告此技能的问题