名称: mermaid-图表渲染器 描述: 通过主题定制和Markdown集成将Mermaid图表渲染为图像 允许使用的工具:
- Bash
- Read
- Write
- Glob
Mermaid 图表渲染器 技能
概述
将Mermaid图表定义渲染为图像,支持流程图、序列图、类图、ER图等,并提供主题定制功能。
功能
- 将Mermaid图表渲染为PNG、SVG、PDF格式
- 支持流程图、序列图、类图、ER图、甘特图、饼图、旅程图等
- 主题定制(默认、暗黑、森林、中性)
- 与Markdown文档集成
- 背景颜色和样式选项
- 基于Puppeteer的高质量渲染
目标流程
- c4模型文档化
- 微服务分解
- 数据架构设计
输入模式
{
"type": "object",
"required": ["source"],
"properties": {
"source": {
"type": "string",
"description": "Mermaid图表定义"
},
"outputFormat": {
"type": "string",
"enum": ["png", "svg", "pdf"],
"default": "svg"
},
"outputPath": {
"type": "string",
"description": "输出文件路径"
},
"theme": {
"type": "string",
"enum": ["default", "dark", "forest", "neutral"],
"default": "default"
},
"config": {
"type": "object",
"properties": {
"backgroundColor": {
"type": "string",
"default": "white"
},
"width": {
"type": "number"
},
"height": {
"type": "number"
}
}
}
}
}
输出模式
{
"type": "object",
"properties": {
"outputPath": {
"type": "string",
"description": "渲染后图像的路径"
},
"format": {
"type": "string"
},
"dimensions": {
"type": "object",
"properties": {
"width": { "type": "number" },
"height": { "type": "number" }
}
}
}
}
使用示例
{
kind: 'skill',
skill: {
name: 'mermaid-renderer',
context: {
source: 'graph TD
A[开始] --> B[处理]
B --> C[结束]',
outputFormat: 'svg',
outputPath: 'docs/diagrams/flow.svg',
theme: 'default'
}
}
}