brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
svg-architecture-diagram将任意架构文字描述转化为专业的 SVG 信息架构图。当用户提到"画架构图"、"生成系统图"、"可视化架构"、"画流程图"、"信息架构"、"组织结构图"、"数据流图"、"业务流程图",或提供了一段架构描述希望图形化展示时,必须触发此 Skill。即使用户只是描述了一个系统的组成部分和关系,也应主动使用本 Skill 生成 SVG 图表,而不是用文字或 Mermaid 代替。
Independent GitHub snapshot · Automated classification · Original documentation governs
将用户提供的任何架构文字描述,转化为结构清晰、视觉专业、可直接渲染的 SVG 架构图。目标受众是产品经理和业务团队,风格为高对比度商务风格。
拿到用户的描述后,按以下顺序完成任务:
第一步:理解与分析 深度解读用户描述,识别架构类型(系统架构 / 业务流程 / 组织结构 / 数据流等),提取所有层级、组件、节点以及它们之间的连接关系。若存在关键歧义,先向用户澄清,或基于最佳实践做假设并明确告知。
同时确定:
standard(1400×1000)或 widescreen(1920×1080)第二步:输出 JSON 架构模型 将信息转换为以下结构化 JSON,作为第一部分交付:
{
"canvasMode": "standard",
"themeName": "default",
"canvas": {"w": 1400, "h": 1000},
"direction": "TTB",
"theme": {
"background": "#FFFFFF",
"layerFills": ["#FFE0B2", "#FFCC80", "#B9F6CA", "#C5CAE9", "#90CAF9"],
"nodeFill": "#FFFFFF",
"nodeStroke": "#333333",
"primaryText": "#000000",
"secondaryText": "#333333",
"accentColor": "#FFAB91",
"lineColor": "#333333"
},
"layers": [
{
"id": "layer1",
"title": "层级名称",
"blocks": [
{
"id": "block1",
"title": "模块标题",
"layout": "horizontal",
"nodes": [
{
"id": "node1",
"label": "节点名称",
"type": "gateway",
"metadata": { "description": "节点说明" }
}
]
}
]
}
],
"connections": [
{
"from": "node1",
"to": "node2",
"label": "连接说明",
"style": {
"stroke": "#333333",
"strokeWidth": 2,
"strokeDasharray": "5 5"
}
}
]
}
第三步:生成完整 SVG 代码 基于 JSON 模型,生成完整可渲染的 SVG,作为第二部分交付。
| 模式 | 字段值 | 尺寸 | 适用场景 |
|---|---|---|---|
| 标准 | "standard" | 1400×1000 | 常规架构图(默认) |
| 宽屏 | "widescreen" | 1920×1080 | 16:9 演示、横向层级较多的架构 |
在 JSON 模型中通过 canvasMode 字段指定,canvas.w 和 canvas.h 对应更新。
通过 JSON 中的 themeName 字段选择预设主题,theme 对象填充对应色值。
| 主题名 | 适用场景 | 风格简述 |
|---|---|---|
default | 通用多彩 | 橙/绿/紫/蓝分层,当前经典风格 |
tech-blue | 科技/软件/SaaS | 蓝色系渐变,科技感 |
ocean-dark | 科技/暗色模式 | 深色背景 + 蓝青高亮 |
healthcare | 医疗/健康/制药 | 柔蓝+绿色信任色系 |
finance | 金融/银行/保险 | 藏青+金色 |
forest-green | 能源/环保/可持续 | 森林绿色系 |
enterprise | 政企/合规/审计 | 中性灰+蓝色强调 |
warm-creative | 营销/创意/品牌 | 暖橙+品红 |
各主题的完整色值定义见 references/color-themes.md。
自动匹配规则:根据用户描述的行业关键词自动选择主题。若用户明确指定主题名或色系偏好,优先使用用户指定。无法判断时使用 default。
<style>(通用样式)和各层注释<defs> 中的 <marker> 箭头,改用几何拼接箭头(见下文)-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-seriftheme.layerFills 数组中的颜色作为背景色,形成视觉分区layerFills 数组theme.primaryTextlayerFills 色值填充theme.nodeStroke,描边宽度 1.5px 或 2pxstroke-dasharray="4 4"theme.nodeFill,边框使用 theme.nodeStroke,圆角 2pxtheme.primaryText<path> 绘制贝塞尔曲线或折线,颜色使用 theme.lineColormarker-end 属性stroke-dasharray="5 5" 表示非强依赖关系禁止使用 <marker> 定义箭头。 所有数据流向箭头使用 SVG 基础图形(矩形 + 三角形)拼接:
<!-- 几何拼接箭头模板 -->
<!-- 通过 translate 定位到连接线终点附近,通过 rotate 控制方向 -->
<g class="flow-arrow" transform="translate(x, y) rotate(angle)">
<!-- 线身:矩形 -->
<rect x="0" y="-4" width="40" height="8" fill="{lineColor}" rx="1"/>
<!-- 箭头头部:三角形 -->
<polygon points="40,-10 40,10 56,0" fill="{lineColor}"/>
</g>
箭头规则:
<rect> 作为箭头线身,<polygon> 三角形作为箭头头部transform="translate(x, y) rotate(angle)" 控制位置和方向fill 颜色使用 theme.lineColor方向变体示例:
<!-- 向右箭头 -->
<g class="flow-arrow" transform="translate(300, 200) rotate(0)">
<rect x="0" y="-4" width="40" height="8" fill="#333" rx="1"/>
<polygon points="40,-10 40,10 56,0" fill="#333"/>
</g>
<!-- 向下箭头 -->
<g class="flow-arrow" transform="translate(500, 300) rotate(90)">
<rect x="0" y="-4" width="40" height="8" fill="#333" rx="1"/>
<polygon points="40,-10 40,10 56,0" fill="#333"/>
</g>
<!-- 向左箭头 -->
<g class="flow-arrow" transform="translate(200, 400) rotate(180)">
<rect x="0" y="-4" width="40" height="8" fill="#333" rx="1"/>
<polygon points="40,-10 40,10 56,0" fill="#333"/>
</g>
<svg xmlns="http://www.w3.org/2000/svg" width="{canvas.w}" height="{canvas.h}">
<style>
/* 通用样式:字体、文字颜色等 */
</style>
<!-- 背景 -->
<rect width="100%" height="100%" fill="{background}"/>
<!-- 层级1:应用层 -->
<g id="layer1">...</g>
<!-- 层级2:业务服务层 -->
<g id="layer2">...</g>
<!-- 连接线 -->
<g id="connections">
<!-- path 连接线(不带 marker-end) -->
<path d="..." stroke="{lineColor}" fill="none" stroke-width="2"/>
<!-- 几何拼接箭头 -->
<g class="flow-arrow" transform="translate(x, y) rotate(angle)">
<rect x="0" y="-4" width="40" height="8" fill="{lineColor}" rx="1"/>
<polygon points="40,-10 40,10 56,0" fill="{lineColor}"/>
</g>
</g>
</svg>
<marker> 定义箭头,必须使用几何拼接箭头<path> 上使用 marker-end 属性最终交付必须包含两部分:
第一部分:高级 JSON 架构分析(按上述结构,包含 canvasMode 和 themeName 字段)
第二部分:完整 SVG 代码,以 ```svg 代码块包裹,包含从 <svg> 到 </svg> 的全部内容,并为每个主要层级添加 HTML 注释。