charts-flow
Purpose
Generate and maintain Mermaid architecture diagrams for SDD documents. Diagrams
live in separate diagrams/ files next to their parent document — keeping the
parent lean to render — and stay traceable back to that parent through a stable
diagram ID and a back-reference link.
This is the single diagram skill for the plugin: all Mermaid generation,
validation, and SVG rendering lives here.
When to Use
Use charts-flow when:
- Adding an architecture diagram (flowchart, sequence, class, state, component,
or deployment) to a BRD, PRD, ADR, SPEC, or IPLAN.
- Migrating an existing inline
mermaid block into a separate diagram file.
- A parent document renders slowly because of complex inline diagrams, or a
diagram needs to be reused across documents.
Do not use it for simple tables/lists (use markdown), tiny diagrams that
render fine inline, or non-architecture charts (Gantt, pie) that fall outside
the SDD diagram contract.
Behavior
Create a new diagram
- Derive the parent document ID from its filename (e.g.
PRD-01) and locate
its folder.
- Create
diagrams/ beside the parent if absent, and write
{PARENT-ID}-diag_{description}.md containing a Document Control block
(parent link, diagram type, dates), an overview, the mermaid block, and a
References section linking back to the parent.
- Render an SVG (
mmdc CLI if available, otherwise Mermaid Live), validate the
syntax, and embed the SVG preview in the parent inside a collapsible
<details> block with a link to the diagram file.
Migrate inline diagrams
- Scan the parent for
mermaid blocks, move each into its own diagram file
(numbering multiples), then replace the original block with the SVG preview
plus a reference link, preserving document flow.
Supported types: flowchart/graph, sequence, class, state, component, and
deployment. Each diagram file follows the same Document Control + References
structure so cross-references resolve in both directions.
Diagram contract (per layer): diagrams attach to the layers that own visual
models — BRD (C4 L1 + DFD L1), PRD (C4 L2 + DFD L2 + key sequence), ADR
(decision sequences), SPEC (C4 L3 + DFD L3). Use the @diagram: tags the layer
template specifies and follow ${CLAUDE_PLUGIN_ROOT}/framework/governance/DIAGRAM_STANDARDS.md.
Quality gates: diagram file in the correct diagrams/ folder; name matches
{PARENT-ID}-diag_{description}.md; Document Control with parent back-link;
valid Mermaid syntax; SVG embedded; all cross-references resolve; SVG < 1 MB.
Related Resources
- Diagram standards:
${CLAUDE_PLUGIN_ROOT}/framework/governance/DIAGRAM_STANDARDS.md
- ID & tag standards:
${CLAUDE_PLUGIN_ROOT}/framework/governance/ID_NAMING_STANDARDS.md
- Layer templates that own diagrams:
${CLAUDE_PLUGIN_ROOT}/framework/layers/01_BRD/BRD-TEMPLATE.yaml,
${CLAUDE_PLUGIN_ROOT}/framework/layers/02_PRD/PRD-TEMPLATE.yaml,
${CLAUDE_PLUGIN_ROOT}/framework/layers/05_ADR/ADR-TEMPLATE.yaml,
${CLAUDE_PLUGIN_ROOT}/framework/layers/06_SPEC/SPEC-TEMPLATE.yaml
- Roadmap visuals:
../adr-roadmap/SKILL.md
- Mermaid: https://mermaid.js.org/ · https://mermaid.live
1---
2name: charts-flow
3description: Create and manage Mermaid architecture diagrams as separate, traceable files linked to their parent SDD documents. Use when adding or migrating diagrams for BRD, PRD, ADR, SPEC, or IPLAN documents.
4metadata:
5 tags:
6 - sdd-workflow
7 - utility
8 custom_fields:
9 skill_category: utility
10 version: "0.25.0"
11 framework_spec_version: "0.51.0"
12 last_updated: "2026-05-23"
13---
14
15# charts-flow
16
17## Purpose
18
19Generate and maintain Mermaid architecture diagrams for SDD documents. Diagrams
20live in separate `diagrams/` files next to their parent document — keeping the
21parent lean to render — and stay traceable back to that parent through a stable
22diagram ID and a back-reference link.
23
24This is the single diagram skill for the plugin: all Mermaid generation,
25validation, and SVG rendering lives here.
26
27## When to Use
28
29Use `charts-flow` when:
30
31- Adding an architecture diagram (flowchart, sequence, class, state, component,
32 or deployment) to a BRD, PRD, ADR, SPEC, or IPLAN.
33- Migrating an existing inline `mermaid` block into a separate diagram file.
34- A parent document renders slowly because of complex inline diagrams, or a
35 diagram needs to be reused across documents.
36
37Do **not** use it for simple tables/lists (use markdown), tiny diagrams that
38render fine inline, or non-architecture charts (Gantt, pie) that fall outside
39the SDD diagram contract.
40
41## Behavior
42
43**Create a new diagram**
44
451. Derive the parent document ID from its filename (e.g. `PRD-01`) and locate
46 its folder.
472. Create `diagrams/` beside the parent if absent, and write
48 `{PARENT-ID}-diag_{description}.md` containing a Document Control block
49 (parent link, diagram type, dates), an overview, the `mermaid` block, and a
50 References section linking back to the parent.
513. Render an SVG (`mmdc` CLI if available, otherwise Mermaid Live), validate the
52 syntax, and embed the SVG preview in the parent inside a collapsible
53 `<details>` block with a link to the diagram file.
54
55**Migrate inline diagrams**
56
57- Scan the parent for `mermaid` blocks, move each into its own diagram file
58 (numbering multiples), then replace the original block with the SVG preview
59 plus a reference link, preserving document flow.
60
61**Supported types**: flowchart/graph, sequence, class, state, component, and
62deployment. Each diagram file follows the same Document Control + References
63structure so cross-references resolve in both directions.
64
65**Diagram contract (per layer)**: diagrams attach to the layers that own visual
66models — BRD (C4 L1 + DFD L1), PRD (C4 L2 + DFD L2 + key sequence), ADR
67(decision sequences), SPEC (C4 L3 + DFD L3). Use the `@diagram:` tags the layer
68template specifies and follow `${CLAUDE_PLUGIN_ROOT}/framework/governance/DIAGRAM_STANDARDS.md`.
69
70**Quality gates**: diagram file in the correct `diagrams/` folder; name matches
71`{PARENT-ID}-diag_{description}.md`; Document Control with parent back-link;
72valid Mermaid syntax; SVG embedded; all cross-references resolve; SVG < 1 MB.
73
74## Related Resources
75
76- Diagram standards: `${CLAUDE_PLUGIN_ROOT}/framework/governance/DIAGRAM_STANDARDS.md`
77- ID & tag standards: `${CLAUDE_PLUGIN_ROOT}/framework/governance/ID_NAMING_STANDARDS.md`
78- Layer templates that own diagrams:
79 `${CLAUDE_PLUGIN_ROOT}/framework/layers/01_BRD/BRD-TEMPLATE.yaml`,
80 `${CLAUDE_PLUGIN_ROOT}/framework/layers/02_PRD/PRD-TEMPLATE.yaml`,
81 `${CLAUDE_PLUGIN_ROOT}/framework/layers/05_ADR/ADR-TEMPLATE.yaml`,
82 `${CLAUDE_PLUGIN_ROOT}/framework/layers/06_SPEC/SPEC-TEMPLATE.yaml`
83- Roadmap visuals: `../adr-roadmap/SKILL.md`
84- Mermaid: <https://mermaid.js.org/> · <https://mermaid.live>