charts-flow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

charts-flow

charts-flow

Purpose

用途

The
charts-flow
skill automates creation and management of Mermaid diagrams for technical documentation. It separates diagram source files from main documents to improve rendering performance, provides automatic SVG conversion for human viewing, and maintains traceability between parent documents and diagram files.
Key Benefits:
  • Performance: Separate diagram files load faster in documentation viewers
  • Dual Format: Mermaid source for AI assistants, SVG preview for humans
  • Traceability: Diagrams linked to parent documents with proper ID naming
  • Migration: Extract existing inline diagrams to separate files
  • Consistency: Standardized diagram file structure and metadata
charts-flow
技能可自动为技术文档创建和管理Mermaid图表。它将图表源文件与主文档分离以提升渲染性能,提供自动SVG转换以便人类查看,并维护父文档与图表文件之间的可追溯性。
核心优势:
  • 性能: 独立的图表文件在文档查看器中加载速度更快
  • 双格式: Mermaid源码供AI助手使用,SVG预览供人类查看
  • 可追溯性: 通过规范的ID命名将图表与父文档关联
  • 迁移: 将现有内嵌图表提取到独立文件中
  • 一致性: 标准化的图表文件结构和元数据

When to Use This Skill

何时使用本技能

Use charts-flow when:
  • Creating architecture diagrams for PRD, BRD, ADR, SYS, or other technical documents
  • Migrating existing inline Mermaid diagrams to separate files
  • Main document becomes slow to render due to complex diagrams
  • Diagram needs to be reused across multiple documents
  • Creating flowcharts, component diagrams, deployment diagrams, sequence diagrams, state machines, or class diagrams
Do NOT use charts-flow when:
  • Creating simple tables or text-based lists (use markdown)
  • Diagram is < 20 lines and main document renders fast
  • Creating data visualization charts (use appropriate charting libraries)
  • Working with non-architecture diagrams (Gantt, pie charts - outside scope)
在以下场景使用charts-flow:
  • 为PRD、BRD、ADR、SYS或其他技术文档创建架构图
  • 将现有内嵌Mermaid图表迁移到独立文件
  • 主文档因复杂图表导致渲染缓慢
  • 图表需要在多个文档中复用
  • 创建流程图、组件图、部署图、序列图、状态机图或类图
请勿在以下场景使用charts-flow:
  • 创建简单表格或基于文本的列表(使用Markdown即可)
  • 图表少于20行且主文档渲染速度快
  • 创建数据可视化图表(使用专用图表库)
  • 处理非架构类图表(甘特图、饼图不在支持范围内)

Skill Inputs

技能输入参数

Required Inputs

必填输入参数

InputDescriptionExample
Parent File PathAbsolute path to main document
{project_root}/docs/PRD/PRD-01_multi_agent_system_architecture.md
Diagram DescriptionShort name for diagram
3_tier_agent_hierarchy
Diagram TypeArchitecture diagram type
flowchart
,
sequence
,
class
,
state
,
component
,
deployment
输入项说明示例
父文档路径主文档的绝对路径
{project_root}/docs/PRD/PRD-01_multi_agent_system_architecture.md
图表描述图表的简短名称
3_tier_agent_hierarchy
图表类型架构图类型
flowchart
,
sequence
,
class
,
state
,
component
,
deployment

Optional Inputs

可选输入参数

InputDescriptionDefault
Migration ModeExtract existing diagrams from document
false
(create new)
Diagram TitleHuman-readable titleDerived from description
Styling PreferencesColor scheme, layout directionProject defaults
输入项说明默认值
迁移模式从文档中提取现有图表
false
(创建新图表)
图表标题人类可读的图表标题从图表描述自动生成
样式偏好配色方案、布局方向项目默认配置

Skill Workflow

技能工作流

Mode 1: Create New Diagram

模式1:创建新图表

Step 1: Parse Parent Document
  • Extract parent document ID from filename (e.g.,
    PRD-01
    from
    PRD-01_multi_agent_system_architecture.md
    )
  • Identify parent document type (PRD, BRD, ADR, SYS, etc.)
  • Determine correct
    diagrams/
    subfolder location
Step 2: Generate Diagram File Path
  • Format:
    {parent_folder}/diagrams/{PARENT-ID}-diag_{description}.md
  • The
    diagrams/
    subfolder is created in the same directory as the parent document
  • Examples by document type:
    • BRD:
      docs/BRD/diagrams/BRD-01-diag_workflow.md
    • PRD:
      docs/PRD/diagrams/PRD-01-diag_3_tier_agent_hierarchy.md
    • ADR:
      docs/ADR/diagrams/ADR-005-diag_cloud_deployment.md
    • SYS:
      docs/SYS/diagrams/SYS-002-diag_data_flow.md
    • IMPL:
      docs/IMPL/diagrams/IMPL-010-diag_implementation_phases.md
  • Create
    diagrams/
    folder if it doesn't exist
Step 3: Create Diagram File
  • Use diagram file template (see Templates section below)
  • Include Document Control section linking to parent
  • Add diagram type metadata
  • Create Mermaid code block with syntax appropriate for diagram type
Step 4: Generate SVG
  • Attempt
    mmdc
    CLI conversion:
    mmdc -i diagram.md -o diagram.svg
  • Fallback: Use Mermaid Live API if CLI unavailable
  • Validate SVG output (check for errors, size < 1MB)
Step 5: Encode SVG as Base64
  • Read generated SVG file
  • Convert to Base64 string
  • Prepare data URI:
    data:image/svg+xml;base64,{BASE64_STRING}
Step 6: Update Parent Document
  • Add reference link to diagram file
  • Embed Base64 SVG in collapsible
    <details>
    block
  • Place in appropriate section of parent document
Step 7: Validate
  • Verify diagram file exists and is readable
  • Check Mermaid syntax validity
  • Confirm SVG renders correctly
  • Validate cross-references resolve
步骤1:解析父文档
  • 从文件名中提取父文档ID(例如从
    PRD-01_multi_agent_system_architecture.md
    中提取
    PRD-01
  • 识别父文档类型(PRD、BRD、ADR、SYS等)
  • 确定正确的
    diagrams/
    子文件夹位置
步骤2:生成图表文件路径
  • 格式:
    {parent_folder}/diagrams/{PARENT-ID}-diag_{description}.md
  • diagrams/
    子文件夹与父文档位于同一目录
  • 按文档类型划分的示例:
    • BRD:
      docs/BRD/diagrams/BRD-01-diag_workflow.md
    • PRD:
      docs/PRD/diagrams/PRD-01-diag_3_tier_agent_hierarchy.md
    • ADR:
      docs/ADR/diagrams/ADR-005-diag_cloud_deployment.md
    • SYS:
      docs/SYS/diagrams/SYS-002-diag_data_flow.md
    • IMPL:
      docs/IMPL/diagrams/IMPL-010-diag_implementation_phases.md
  • 如果
    diagrams/
    文件夹不存在则自动创建
步骤3:创建图表文件
  • 使用图表文件模板(见下方模板章节)
  • 包含指向父文档的文档控制章节
  • 添加图表类型元数据
  • 创建符合图表类型语法的Mermaid代码块
步骤4:生成SVG
  • 尝试使用
    mmdc
    CLI转换:
    mmdc -i diagram.md -o diagram.svg
  • 备选方案:如果CLI不可用,使用Mermaid Live API
  • 验证SVG输出(检查错误,文件大小<1MB)
步骤5:将SVG编码为Base64
  • 读取生成的SVG文件
  • 转换为Base64字符串
  • 准备数据URI:
    data:image/svg+xml;base64,{BASE64_STRING}
步骤6:更新父文档
  • 添加指向图表文件的引用链接
  • 在可折叠的
    <details>
    块中嵌入Base64格式的SVG
  • 将内容插入父文档的对应章节
步骤7:验证
  • 验证图表文件存在且可读取
  • 检查Mermaid语法有效性
  • 确认SVG可正常渲染
  • 验证交叉引用可正常解析

Mode 2: Migrate Existing Diagrams

模式2:迁移现有图表

Step 1: Scan Parent Document
  • Search for ````mermaid` code blocks
  • Extract each diagram with surrounding context
  • Preserve diagram content and styling
Step 2: Create Diagram Files
  • For each extracted diagram, follow Steps 1-4 from Mode 1
  • Auto-generate description from diagram content or context
  • Number multiple diagrams:
    _diagram_1
    ,
    _diagram_2
    , etc.
Step 3: Replace in Parent Document
  • Remove original ````mermaid` blocks
  • Insert SVG + reference link in same location
  • Maintain document flow and readability
Step 4: Validate Migration
  • Confirm all diagrams extracted
  • Verify no broken references
  • Check visual fidelity (SVG matches original Mermaid)
步骤1:扫描父文档
  • 搜索````mermaid`代码块
  • 提取每个图表及其上下文
  • 保留图表内容和样式
步骤2:创建图表文件
  • 对每个提取的图表,遵循模式1中的步骤1-4
  • 从图表内容或上下文自动生成描述
  • 对多个图表进行编号:
    _diagram_1
    ,
    _diagram_2
步骤3:替换父文档内容
  • 删除原始的````mermaid`块
  • 在同一位置插入SVG和引用链接
  • 保持文档的流程和可读性
步骤4:验证迁移结果
  • 确认所有图表已提取
  • 验证无无效引用
  • 检查视觉一致性(SVG与原始Mermaid图表一致)

Templates

模板

Diagram File Template

图表文件模板

markdown
undefined
markdown
undefined

{PARENT-ID}-diag: {Diagram Title}

{PARENT-ID}-diag: {图表标题}

Document Control

文档控制

ItemDetails
Diagram ID{PARENT-ID}-diag
Parent Document{PARENT-ID}: {Parent Title}
Diagram Type{flowchart
StatusActive
Version1.0.0
Created{YYYY-MM-DD}
Last Updated{YYYY-MM-DD}
Maintained By{Role}
详情
图表ID{PARENT-ID}-diag
父文档{PARENT-ID}: {父文档标题}
图表类型{flowchart
状态活跃
版本1.0.0
创建时间{YYYY-MM-DD}
最后更新时间{YYYY-MM-DD}
维护人{角色}

Overview

概述

{Brief description of what this diagram represents}
{本图表的简要说明}

{Diagram Title}

{图表标题}

mermaid
{Mermaid diagram code}
mermaid
{Mermaid图表代码}

Diagram Description

图表说明

{Detailed explanation of diagram elements, flows, and purpose}
{图表元素、流程和用途的详细解释}

Key Elements

核心元素

{List or table of important nodes, components, actors, states, or flows}
{重要节点、组件、参与者、状态或流程的列表或表格}

References

参考资料

  • Parent Document: {PARENT-ID}: {Parent Title}
  • Related Diagrams: {Links to related diagram files if applicable}
  • Related Documents: {Links to related requirements, ADRs, strategy docs}

Diagram Version: 1.0.0 Created: {YYYY-MM-DD} Maintained By: {Role}
undefined
  • 父文档: {PARENT-ID}: {父文档标题}
  • 相关图表: {相关图表文件链接(如有)}
  • 相关文档: {相关需求、ADR、战略文档的链接}

图表版本: 1.0.0 创建时间: {YYYY-MM-DD} 维护人: {角色}
undefined

Parent Document Reference Template

父文档引用模板

markdown
**Visual Diagram**: [{PARENT-ID}-diag: {Diagram Title}](diagrams/{PARENT-ID}-diag_{description}.md)

<details>
<summary>View Diagram (SVG Preview)</summary>

![{Diagram Title}](data:image/svg+xml;base64,{BASE64_SVG_STRING})

</details>
markdown
**可视化图表**: [{PARENT-ID}-diag: {图表标题}](diagrams/{PARENT-ID}-diag_{description}.md)

<details>
<summary>查看图表(SVG预览)</summary>

![{图表标题}](data:image/svg+xml;base64,{BASE64_SVG_STRING})

</details>

Supported Diagram Types

支持的图表类型

Flowchart / Graph

流程图 / 图形

mermaid
graph TB
    A[Start] --> B{Decision}
    B -->|Yes| C[Action 1]
    B -->|No| D[Action 2]
Use for: Process flows, decision trees, workflows
mermaid
graph TB
    A[开始] --> B{决策}
    B -->|是| C[操作1]
    B -->|否| D[操作2]
适用场景: 流程流、决策树、工作流

Sequence Diagram

序列图

mermaid
sequenceDiagram
    Actor->>System: Request
    System->>Database: Query
    Database-->>System: Result
    System-->>Actor: Response
Use for: Agent interactions, API calls, message flows
mermaid
sequenceDiagram
    Actor->>System: 请求
    System->>Database: 查询
    Database-->>System: 结果
    System-->>Actor: 响应
适用场景: Agent交互、API调用、消息流

Class Diagram

类图

mermaid
classDiagram
    class Agent {
        +state: State
        +execute()
        +validate()
    }
    Agent <|-- StrategyAgent
Use for: Object relationships, system components
mermaid
classDiagram
    class Agent {
        +state: State
        +execute()
        +validate()
    }
    Agent <|-- StrategyAgent
适用场景: 对象关系、系统组件

State Diagram

状态图

mermaid
stateDiagram-v2
    [*] --> SCANNING
    SCANNING --> ACTIVE
    ACTIVE --> DEFENSE
    DEFENSE --> [*]
Use for: State machines, lifecycle flows
mermaid
stateDiagram-v2
    [*] --> SCANNING
    SCANNING --> ACTIVE
    ACTIVE --> DEFENSE
    DEFENSE --> [*]
适用场景: 状态机、生命周期流

Component Diagram (using flowchart)

组件图(使用流程图语法)

mermaid
graph LR
    subgraph "Level 1"
        SO[System Orchestrator]
    end
    subgraph "Level 2"
        IS[Item Selection]
    end
    SO --> IS
Use for: System architecture, component relationships
mermaid
graph LR
    subgraph "层级1"
        SO[系统编排器]
    end
    subgraph "层级2"
        IS[项目选择模块]
    end
    SO --> IS
适用场景: 系统架构、组件关系

Deployment Diagram (using flowchart)

部署图(使用流程图语法)

mermaid
graph TB
    subgraph "Cloud Run"
        A[Agent Container]
    end
    subgraph "Cloud SQL"
        B[(Database)]
    end
    A --> B
Use for: Infrastructure architecture, deployment topology
mermaid
graph TB
    subgraph "Cloud Run"
        A[Agent容器]
    end
    subgraph "Cloud SQL"
        B[(数据库)]
    end
    A --> B
适用场景: 基础设施架构、部署拓扑

Tool Usage

工具使用方法

Check for Mermaid CLI

检查Mermaid CLI是否安装

bash
which mmdc
If not installed:
bash
npm install -g @mermaid-js/mermaid-cli
Alternative: Use Puppeteer
bash
npm install -g puppeteer
bash
which mmdc
如果未安装:
bash
npm install -g @mermaid-js/mermaid-cli
备选方案: 使用Puppeteer
bash
npm install -g puppeteer

Generate SVG from Mermaid

从Mermaid生成SVG

bash
mmdc -i input.md -o output.svg -b transparent
Parameters:
  • -i
    : Input file (Mermaid markdown)
  • -o
    : Output file (SVG)
  • -b
    : Background color (
    transparent
    recommended)
bash
mmdc -i input.md -o output.svg -b transparent
参数说明:
  • -i
    : 输入文件(Mermaid格式的Markdown)
  • -o
    : 输出文件(SVG格式)
  • -b
    : 背景颜色(推荐使用
    transparent

Convert SVG to Base64

将SVG转换为Base64

bash
base64 -w 0 diagram.svg
macOS:
bash
base64 -i diagram.svg
bash
base64 -w 0 diagram.svg
macOS系统:
bash
base64 -i diagram.svg

Quality Gates (Definition of Done)

质量验收标准(完成定义)

  • File Created: Diagram file exists in correct
    diagrams/
    subfolder
  • Naming Convention: File name follows
    {PARENT-ID}-diag_{description}.md
    pattern
  • Document Control: Metadata section present with parent link back-reference
  • Mermaid Syntax: Diagram syntax validates without errors
  • SVG Generated: SVG file created successfully (if using file method)
  • SVG Embedded: Base64 SVG embedded in parent document
  • Reference Added: Link to diagram file added in parent document
  • Cross-References: All links resolve correctly (bidirectional)
  • Rendering: Diagram displays correctly in GitHub, VS Code, and documentation sites
  • Accessibility: Collapsible
    <details>
    block used for SVG preview
  • File Size: SVG < 1MB, Base64 string < 1.5MB
  • 文件已创建: 图表文件已在正确的
    diagrams/
    子文件夹中生成
  • 命名规范: 文件名符合
    {PARENT-ID}-diag_{description}.md
    格式
  • 文档控制: 包含元数据章节及指向父文档的反向引用
  • Mermaid语法: 图表语法验证通过,无错误
  • SVG已生成: SVG文件已成功创建(如果使用文件方式)
  • SVG已嵌入: Base64格式的SVG已嵌入父文档
  • 引用已添加: 父文档中已添加指向图表文件的链接
  • 交叉引用: 所有链接可正常解析(双向)
  • 渲染正常: 图表可在GitHub、VS Code和文档站点中正常显示
  • 可访问性: 使用可折叠的
    <details>
    块展示SVG预览
  • 文件大小: SVG文件<1MB,Base64字符串<1.5MB

Skill Constraints

技能约束

What NOT to Do

禁止操作

  • Do NOT create diagrams in archived folders without explicit permission
  • Do NOT modify existing diagram files without checking version history
  • Do NOT embed large binary images (use SVG only)
  • Do NOT use Gantt charts, pie charts, or git graphs (outside scope - architecture diagrams only)
  • Do NOT create diagrams for simple lists or tables (use markdown)
  • Do NOT skip Document Control metadata
  • Do NOT use generic filenames like
    diagram1.md
    (use descriptive names)
  • 请勿在未获得明确许可的情况下在归档文件夹中创建图表
  • 请勿在未查看版本历史的情况下修改现有图表文件
  • 请勿嵌入大型二进制图片(仅使用SVG格式)
  • 请勿创建甘特图、饼图或Git图(不在支持范围内,仅支持架构类图表)
  • 请勿为简单列表或表格创建图表(使用Markdown即可)
  • 请勿省略文档控制元数据
  • 请勿使用
    diagram1.md
    这类通用文件名(使用描述性名称)

File Organization Rules

文件组织规则

  • Always create
    diagrams/
    subfolder in same directory as parent document
  • Always use parent document ID as diagram file prefix
  • Always maintain traceability with cross-references
  • Always follow template structure for consistency
  • 必须在父文档同一目录下创建
    diagrams/
    子文件夹
  • 必须使用父文档ID作为图表文件的前缀
  • 必须通过交叉引用维护可追溯性
  • 必须遵循模板结构以保证一致性

Error Handling

错误处理

Error:
mmdc
command not found

错误:
mmdc
命令未找到

Cause: Mermaid CLI not installed
Resolution:
bash
npm install -g @mermaid-js/mermaid-cli
原因: Mermaid CLI未安装
解决方案:
bash
npm install -g @mermaid-js/mermaid-cli

OR

Provide manual instructions to use Mermaid Live (https://mermaid.live)

手动使用Mermaid Live(https://mermaid.live)

undefined
undefined

Error: Invalid Mermaid syntax

错误: Mermaid语法无效

Cause: Syntax error in diagram code
Resolution:
  • Validate syntax at https://mermaid.live
  • Check for missing quotes, brackets, or keywords
  • Review Mermaid documentation for diagram type
原因: 图表代码存在语法错误
解决方案:

Error: SVG file too large (> 1MB)

错误: SVG文件过大(>1MB)

Cause: Diagram too complex
Resolution:
  • Split into multiple diagrams
  • Simplify diagram (remove redundant elements)
  • Use subgraphs to organize complexity
原因: 图表过于复杂
解决方案:
  • 将图表拆分为多个子图表
  • 简化图表(移除冗余元素)
  • 使用子图组织复杂内容

Error: Cannot determine parent document ID

错误: 无法确定父文档ID

Cause: Filename doesn't follow standard naming (e.g., no ID prefix)
Resolution:
  • Prompt user to specify parent ID manually
  • Suggest renaming parent file to follow conventions
原因: 文件名不符合标准命名规范(例如缺少ID前缀)
解决方案:
  • 提示用户手动指定父文档ID
  • 建议重命名父文档以遵循规范

Error:
diagrams/
folder creation failed

错误:
diagrams/
文件夹创建失败

Cause: Permission issues or invalid path
Resolution:
  • Check file permissions
  • Verify parent directory exists
  • Use absolute paths
原因: 权限问题或路径无效
解决方案:
  • 检查文件权限
  • 验证父目录是否存在
  • 使用绝对路径

Example Usage

使用示例

Example 1: Create New Flowchart Diagram for BRD

示例1:为BRD创建新流程图

User Request:
"Create a flowchart diagram showing the user workflow for BRD-01"
Skill Actions:
  1. Parse parent:
    {project_root}/docs/BRD/BRD-01_project_requirements.md
  2. Extract ID:
    BRD-01
  3. Create file:
    docs/BRD/diagrams/BRD-01-diag_user_workflow.md
    (in BRD subfolder)
  4. Generate Mermaid flowchart with user journey steps
  5. Convert to SVG using
    mmdc
  6. Embed Base64 SVG in BRD-01
  7. Add reference link
Result:
  • Diagram file created in
    docs/BRD/diagrams/
    (document type-specific subfolder)
  • SVG preview visible in parent document
  • Cross-references working in both directions
用户请求:
"为BRD-01创建展示用户工作流的流程图"
技能执行动作:
  1. 解析父文档:
    {project_root}/docs/BRD/BRD-01_project_requirements.md
  2. 提取ID:
    BRD-01
  3. 创建文件:
    docs/BRD/diagrams/BRD-01-diag_user_workflow.md
    (位于BRD子文件夹)
  4. 生成包含用户旅程步骤的Mermaid流程图
  5. 使用
    mmdc
    转换为SVG
  6. 将Base64格式的SVG嵌入BRD-01
  7. 添加引用链接
执行结果:
  • 图表文件已创建在
    docs/BRD/diagrams/
    (按文档类型划分的子文件夹)
  • 父文档中可查看SVG预览
  • 双向交叉引用可正常工作

Example 2: Migrate Existing Diagram

示例2:迁移现有图表

User Request:
"Migrate the state machine diagram from strategy_state_machine.md to a separate file"
Skill Actions:
  1. Scan
    {project_root}/strategy/strategy_state_machine.md
  2. Find ```mermaid block (state diagram)
  3. Extract diagram code
  4. Create
    {project_root}/strategy/diagrams/SSM-001-diag_state_transitions.md
  5. Generate SVG
  6. Replace original block with SVG + reference
  7. Validate migration
Result:
  • Original Mermaid moved to separate file
  • SVG preview embedded in main document
  • Main document renders faster
用户请求:
"将strategy_state_machine.md中的状态机图表迁移到独立文件"
技能执行动作:
  1. 扫描
    {project_root}/strategy/strategy_state_machine.md
  2. 找到````mermaid`块(状态图)
  3. 提取图表代码
  4. 创建
    {project_root}/strategy/diagrams/SSM-001-diag_state_transitions.md
  5. 生成SVG
  6. 用SVG和引用链接替换原始代码块
  7. 验证迁移结果
执行结果:
  • 原始Mermaid图表已迁移到独立文件
  • 主文档中嵌入了SVG预览
  • 主文档渲染速度提升

Example 3: Create Sequence Diagram for ADR

示例3:为ADR创建序列图

User Request:
"Create a sequence diagram showing the agent communication flow for ADR-003"
Skill Actions:
  1. Parent:
    docs/ADR/ADR-003_agent_communication.md
  2. Create:
    docs/ADR/diagrams/ADR-003-diag_agent_communication_sequence.md
    (in ADR subfolder)
  3. Generate sequence diagram: System Orchestrator → Selection Service → Strategy Agent → Risk Service
  4. Add swimlanes for timing (A2A Protocol patterns)
  5. Convert to SVG
  6. Embed in ADR-003
Result:
  • Sequence diagram in
    docs/ADR/diagrams/
    (document type-specific subfolder)
  • Message flow with <50ms SLA annotations visible
  • SVG preview in ADR document
用户请求:
"为ADR-003创建展示Agent通信流程的序列图"
技能执行动作:
  1. 父文档:
    docs/ADR/ADR-003_agent_communication.md
  2. 创建文件:
    docs/ADR/diagrams/ADR-003-diag_agent_communication_sequence.md
    (位于ADR子文件夹)
  3. 生成序列图:系统编排器 → 选择服务 → 策略Agent → 风险服务
  4. 添加时间轴泳道(A2A协议模式)
  5. 转换为SVG
  6. 嵌入到ADR-003中
执行结果:
  • 序列图已创建在
    docs/ADR/diagrams/
    (按文档类型划分的子文件夹)
  • 包含<50ms SLA标注的消息流清晰可见
  • ADR文档中可查看SVG预览

Output Format

输出格式

Generated Artifacts

生成的产物

  1. Diagram File (
    {PARENT-ID}-diag_{description}.md
    )
    • Location:
      {parent_folder}/diagrams/
    • Format: Markdown with Mermaid code block
    • Includes: Document Control, diagram code, description, references
  2. SVG File (optional, if using file-based approach)
    • Location: Same as diagram file,
      .svg
      extension
    • Format: Scalable Vector Graphics
    • Used for Base64 encoding
  3. Updated Parent Document
    • Reference link added in appropriate section
    • SVG preview embedded in
      <details>
      block
    • Original content preserved
  1. 图表文件 (
    {PARENT-ID}-diag_{description}.md
    )
    • 位置:
      {parent_folder}/diagrams/
    • 格式: 包含Mermaid代码块的Markdown文件
    • 内容: 文档控制、图表代码、说明、参考资料
  2. SVG文件(可选,若使用文件方式)
    • 位置: 与图表文件同一目录,扩展名为
      .svg
    • 格式: 可缩放矢量图形
    • 用途: 用于Base64编码
  3. 更新后的父文档
    • 对应章节已添加引用链接
    • SVG预览已嵌入
      <details>
    • 原始内容保留

File Organization After Execution

执行后的文件组织结构

Each document type has its own diagrams subfolder:
docs/
├── BRD/
│   ├── BRD-01_project_requirements.md         ← Updated with SVG + link
│   └── diagrams/
│       ├── BRD-01-diag_user_workflow.md       ← BRD diagrams
│       └── BRD-01-diag_business_rules.md
├── PRD/
│   ├── PRD-01_multi_agent_system.md           ← Updated with SVG + link
│   └── diagrams/
│       ├── PRD-01-diag_3_tier_hierarchy.md    ← PRD diagrams
│       └── PRD-01-diag_cloud_architecture.md
├── ADR/
│   ├── ADR-005_deployment_strategy.md          ← Updated with SVG + link
│   └── diagrams/
│       └── ADR-005-diag_deployment_flow.md     ← ADR diagrams
├── SYS/
│   ├── SYS-002_data_pipeline.md                ← Updated with SVG + link
│   └── diagrams/
│       └── SYS-002-diag_data_flow.md           ← SYS diagrams
└── IMPL/
    ├── IMPL-010_phase_1_plan.md                ← Updated with SVG + link
    └── diagrams/
        └── IMPL-010-diag_implementation.md     ← IMPL diagrams
每种文档类型都有独立的图表子文件夹:
docs/
├── BRD/
│   ├── BRD-01_project_requirements.md         ← 已更新,包含SVG和链接
│   └── diagrams/
│       ├── BRD-01-diag_user_workflow.md       ← BRD类图表
│       └── BRD-01-diag_business_rules.md
├── PRD/
│   ├── PRD-01_multi_agent_system.md           ← 已更新,包含SVG和链接
│   └── diagrams/
│       ├── PRD-01-diag_3_tier_hierarchy.md    ← PRD类图表
│       └── PRD-01-diag_cloud_architecture.md
├── ADR/
│   ├── ADR-005_deployment_strategy.md          ← 已更新,包含SVG和链接
│   └── diagrams/
│       └── ADR-005-diag_deployment_flow.md     ← ADR类图表
├── SYS/
│   ├── SYS-002_data_pipeline.md                ← 已更新,包含SVG和链接
│   └── diagrams/
│       └── SYS-002-diag_data_flow.md           ← SYS类图表
└── IMPL/
    ├── IMPL-010_phase_1_plan.md                ← 已更新,包含SVG和链接
    └── diagrams/
        └── IMPL-010-diag_implementation.md     ← IMPL类图表

Integration with Project Workflow

与项目工作流的集成

Traceability Chain

可追溯链

Product Strategy ({project_root}/strategy/*.md)
Requirements (docs/reqs/*.md)
Architecture Decisions (docs/adrs/*.md) ← diagrams support ADRs
System Specifications (docs/sys/*.md) ← diagrams show architecture
BDD Scenarios (docs/BDD/*.feature)
Code Implementation
Diagrams enhance: ADRs, SYS, PRD, BRD documents with visual architecture representations
产品战略 ({project_root}/strategy/*.md)
需求文档 (docs/reqs/*.md)
架构决策文档 (docs/adrs/*.md) ← 图表支持ADR文档
系统规格文档 (docs/sys/*.md) ← 图表展示系统架构
BDD场景 (docs/BDD/*.feature)
代码实现
图表增强作用: 为ADR、SYS、PRD、BRD文档提供可视化的架构展示

Relationship to Other Skills

与其他技能的关联

  • doc-flow: Creates specification documents; charts-flow adds diagrams to those documents
  • google-adk: Defines agent framework; charts-flow visualizes agent hierarchies
  • project-mngt: Creates implementation plans; charts-flow shows dependency graphs
  • doc-flow: 创建规格文档;charts-flow为这些文档添加图表
  • google-adk: 定义Agent框架;charts-flow可视化Agent层级结构
  • project-mngt: 创建实施计划;charts-flow展示依赖关系图

References

参考资料

Internal Documentation

内部文档

  • Claude Code Skills README
  • SDD Framework Guide
  • Claude Code Skills README
  • SDD框架指南

External Resources

外部资源

Related Templates

相关模板

  • BRD Template
  • PRD Template
  • ADR Template
  • SYS Template
  • IMPL Template

Skill Version: 1.0.0 Created: 2025-01-04 Last Updated: 2025-01-04 Maintained By: Development Team
  • BRD模板
  • PRD模板
  • ADR模板
  • SYS模板
  • IMPL模板

技能版本: 1.0.0 创建时间: 2025-01-04 最后更新时间: 2025-01-04 维护团队: 开发团队