Architecture Diagram HTML/SVG
Use this skill to produce standalone HTML files with embedded SVG diagrams that feel like clean presentation slides rather than code-first diagrams.
Output Form
- - Default to a standalone HTML file with embedded SVG.
- Prefer sectioned “deck” structure when there are multiple diagrams on one page.
- Use SVG, not Mermaid, for final publication-quality layout control.
- Make the result readable without zooming and understandable by non-engineers.
Visual Style
- - Use a PPT-like information design style: warm background, panel cards, soft shadows, rounded nodes, restrained colors.
- Prefer clear Chinese labels when the audience is Chinese-speaking; keep only essential English technical terms.
- Use a small set of semantic colors and keep them consistent across sections.
- Keep arrowheads understated; do not make lines or markers visually aggressive.
- Favor balanced spacing over dense packing. The page should feel edited, not auto-generated.
Diagram Building Workflow
- 1. Identify the user-facing purpose of each diagram.
- Reduce the system into a few layers or stages before drawing.
- Choose the simplest SVG structure that fits:
- layered architecture
- runtime flow
- sequence/timing flow
- subsystem drill-down
- 4. Place groups first, then nodes, then arrows, then notes.
- After layout is stable, localize labels and tighten wording.
- Do a dedicated arrow and overlap review before finishing.
Node Rules
- - Give every node one clear responsibility.
- Keep titles short; if a title is long, widen the node before shrinking text.
- Use subtitle lines for detail; keep them short and scannable.
- Avoid mixing multiple abstraction levels inside one node.
- Align sibling nodes rigorously.
Arrow Rules
- - Every arrow must start and end on a node edge, not inside a node.
- Prefer straight lines first. Add bends only to avoid collisions or ambiguity.
- When two arrows connect the same pair of areas, offset them vertically or horizontally.
- Use solid lines for primary runtime/data flow.
- Use dashed lines only for support, configuration, feedback, optional linkage, or on-demand reads.
- If arrows are long, shorten or reroute them so the direction remains obvious.
- Do not let text sit on top of an arrow.
Editing Rules
- - When refining an existing SVG, inspect coordinates instead of making semantic guesses.
- If a user reports overlap, fix geometry directly: move nodes, widen boxes, reroute paths, or adjust text anchors.
- If a user questions arrow meaning, verify the actual system relationship in code/docs first, then correct the line.
- Prefer explicit labels over decorative complexity.
Diagram-Specific Guidance
Overall Architecture
- - Separate access surfaces, control plane/runtime, capability subsystems, and state/config areas.
- Use enclosing groups to show ownership or subsystem boundaries.
- Keep cross-group arrows sparse and precise.
Runtime Flow
- - Emphasize the main path first.
- Put configuration, session state, and plugin/runtime support below the main path as supporting layers.
- Use wording that reads like product behavior, not source code names, unless the source name is important.
Sequence Diagram
- - Reduce participants to the minimum needed to explain the flow.
- Name participants by role, not by file/module, unless implementation detail is the point.
- Use loops only where a real repeated interaction exists.
- Move loop labels close to the loop arrow.
Final Review Checklist
Before finishing, read references/review-checklist.md and verify every item.
架构图 HTML/SVG
使用此技能生成独立的HTML文件,其中包含嵌入式SVG图表,使其感觉像干净的演示幻灯片,而非代码优先的图表。
输出形式
- - 默认生成包含嵌入式SVG的独立HTML文件。
- 当一页中有多个图表时,优先采用分节“卡片式”结构。
- 使用SVG而非Mermaid,以实现最终出版级的布局控制。
- 确保结果无需缩放即可阅读,且非工程师也能理解。
视觉风格
- - 采用类似PPT的信息设计风格:暖色背景、面板卡片、柔和阴影、圆角节点、克制用色。
- 当受众为中文使用者时,优先使用清晰的中文标签;仅保留必要的英文技术术语。
- 使用少量语义化颜色,并在各节之间保持一致。
- 箭头保持低调;线条或标记不应具有视觉攻击性。
- 优先平衡间距而非密集排列。页面应呈现精心编排感,而非自动生成感。
图表构建流程
- 1. 明确每个图表面向用户的目的。
- 在绘制前将系统简化为几个层次或阶段。
- 选择最合适的简单SVG结构:
- 分层架构
- 运行时流程
- 时序/时间流
- 子系统深入剖析
- 4. 先放置组,然后是节点,接着是箭头,最后是注释。
- 布局稳定后,本地化标签并精简措辞。
- 在完成前进行专门的箭头和重叠检查。
节点规则
- - 每个节点承担一个明确的职责。
- 标题保持简短;若标题过长,先加宽节点再缩小文字。
- 使用副标题行提供细节;保持简短且易于浏览。
- 避免在一个节点内混合多个抽象层级。
- 同级节点严格对齐。
箭头规则
- - 每个箭头必须起始和结束于节点边缘,而非节点内部。
- 优先使用直线。仅在需要避免碰撞或歧义时添加折线。
- 当两个箭头连接同一对区域时,垂直或水平偏移它们。
- 实线用于主要运行时/数据流。
- 虚线仅用于支持、配置、反馈、可选链接或按需读取。
- 若箭头过长,缩短或重新布线,确保方向清晰。
- 不要让文字位于箭头之上。
编辑规则
- - 优化现有SVG时,检查坐标而非进行语义猜测。
- 若用户报告重叠,直接修正几何结构:移动节点、加宽方框、重新布线路径或调整文本锚点。
- 若用户质疑箭头含义,首先在代码/文档中验证实际系统关系,然后修正线条。
- 优先使用明确的标签,而非装饰性复杂。
图表特定指导
整体架构
- - 分离访问面、控制面/运行时、能力子系统以及状态/配置区域。
- 使用包围组显示归属关系或子系统边界。
- 跨组箭头保持稀疏且精确。
运行时流程
- - 首先强调主路径。
- 将配置、会话状态和插件/运行时支持作为支撑层放在主路径下方。
- 使用类似产品行为的措辞,而非源代码名称,除非源名称很重要。
时序图
- - 将参与者减少到解释流程所需的最小数量。
- 按角色命名参与者,而非按文件/模块,除非实现细节是重点。
- 仅在存在真实重复交互时使用循环。
- 将循环标签移近循环箭头。
最终审查清单
在完成前,阅读 references/review-checklist.md 并逐项验证。