Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问clear审计通过

charts-flow图表流程

Agent Skill

charts-flow 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,536

周安装

64

GitHub Stars

14

下载量

512
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:charts-flow(图表流程)
来源仓库:https://github.com/vladm3105/aidoc-flow-framework
仓库路径:skills/charts-flow
安装命令:
npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill charts-flow
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill charts-flow

简介

charts-flow 自动化生成 Mermaid 流程图并转换为 SVG,分离源码与预览以提升文档性能。

  • 保持父文档与 diagram 文件的 traceability,便于维护与版本追溯。
  • 适用于技术文档中架构图、时序图与状态机的标准化管理。
  • 需遵循命名规范与 ID 规则,否则无法正确链接与渲染嵌套图表。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

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

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)

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 diagram3_tier_agent_hierarchy
Diagram TypeArchitecture diagram typeflowchart, sequence, class, state, component, deployment

Optional Inputs

InputDescriptionDefault
Migration ModeExtract existing diagrams from documentfalse (create new)
Diagram TitleHuman-readable titleDerived from description
Styling PreferencesColor scheme, layout directionProject defaults

Skill Workflow

Mode 1: Create New Diagram

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

Mode 2: Migrate Existing Diagrams

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)

Templates

Diagram File Template

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

## Document Control

| Item | Details |
|------|---------|
| **Diagram ID** | {PARENT-ID}-diag |
| **Parent Document** | [{PARENT-ID}: {Parent Title}](../{PARENT-FILE}.md) |
| **Diagram Type** | {flowchart|sequence|class|state|component|deployment} |
| **Status** | Active |
| **Version** | 1.0.0 |
| **Created** | {YYYY-MM-DD} |
| **Last Updated** | {YYYY-MM-DD} |
| **Maintained By** | {Role} |

## Overview

{Brief description of what this diagram represents}

## {Diagram Title}

{Mermaid diagram code}


## 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}](https://github.com/vladm3105/aidoc-flow-framework/blob/HEAD/.claude/skills/charts-flow/../%7BPARENT-FILE%7D.md)
- **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}

Parent Document Reference Template

**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>

Supported Diagram Types

Flowchart / Graph

graph TB
    A[Start] --> B{Decision}
    B -->|Yes| C[Action 1]
    B -->|No| D[Action 2]

Use for: Process flows, decision trees, workflows

Sequence Diagram

sequenceDiagram
    Actor->>System: Request
    System->>Database: Query
    Database-->>System: Result
    System-->>Actor: Response

Use for: Agent interactions, API calls, message flows

Class Diagram

classDiagram
    class Agent {
        +state: State
        +execute()
        +validate()
    }
    Agent <|-- StrategyAgent

Use for: Object relationships, system components

State Diagram

stateDiagram-v2
    [*] --> SCANNING
    SCANNING --> ACTIVE
    ACTIVE --> DEFENSE
    DEFENSE --> [*]

Use for: State machines, lifecycle flows

Component Diagram (using flowchart)

graph LR
    subgraph "Level 1"
        SO[System Orchestrator]
    end
    subgraph "Level 2"
        IS[Item Selection]
    end
    SO --> IS

Use for: System architecture, component relationships

Deployment Diagram (using flowchart)

graph TB
    subgraph "Cloud Run"
        A[Agent Container]
    end
    subgraph "Cloud SQL"
        B[(Database)]
    end
    A --> B

Use for: Infrastructure architecture, deployment topology

Tool Usage

Check for Mermaid CLI

which mmdc

If not installed:

npm install -g @mermaid-js/mermaid-cli

Alternative: Use Puppeteer

npm install -g puppeteer

Generate SVG from Mermaid

mmdc -i input.md -o output.svg -b transparent

Parameters:

  • -i: Input file (Mermaid markdown)
  • -o: Output file (SVG)
  • -b: Background color (transparent recommended)

Convert SVG to Base64

base64 -w 0 diagram.svg

macOS:

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

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)

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

Error Handling

Error: mmdc command not found

Cause: Mermaid CLI not installed

Resolution:

npm install -g @mermaid-js/mermaid-cli
# OR
# Provide manual instructions to use Mermaid Live (https://mermaid.live)

Error: Invalid Mermaid syntax

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)

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

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

Error: diagrams/ folder creation failed

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

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

Example 2: Migrate Existing Diagram

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

Example 3: Create Sequence Diagram for 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

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

  1. SVG File (optional, if using file-based approach)

- Location: Same as diagram file, .svg extension - Format: Scalable Vector Graphics - Used for Base64 encoding

  1. Updated Parent Document

- Reference link added in appropriate section - SVG preview embedded in <details> block - Original content preserved

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

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

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

References

Internal Documentation

External Resources

Related Templates


Skill Version: 1.0.0 Created: 2025-01-04 Last Updated: 2025-01-04 Maintained By: Development Team

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Gemini CLI

28.22%
按下载量换算144

Claude Code

23.99%
按下载量换算123

Antigravity

17.68%
按下载量换算91

OpenCode

11.86%
按下载量换算61

windsurf

7.77%
按下载量换算40

Codex

3.53%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills