Mermaid Diagram Authoring
Write the smallest diagram people can inspect while the conversation is still changing. Treat Mermaid as a thinking surface, not merely a final rendering format.
Core contract
- Default to one
mermaid code block inside a Markdown file.
- Keep one diagram and one main question per working file.
- Keep the Markdown file as the single editable source and working visual-review surface; do not duplicate it into
.mmd automatically.
- Use a standalone
.mmd only when the user explicitly asks for one or an integration requires it.
- Preserve business meaning while improving notation and visual consistency. Treat the established icon stroke width and size, spacing, relation line, arrow usage, color, and typography as visual-language assets; do not change them without explicit agreement.
- In a business model set, keep the profiles separate: Overall / Business Map,
Business Context for one scene with a multi-Business backbone, and a Flow or
recursive Detailed Business Context expanding one selected Business. Record
the parent/expanded-node trace outside the Mermaid block.
- Keep image-node properties in the exact order
label, img, pos, w,
h, constraint, so the stable English ID and Japanese label remain easy
to compare while editing.
- Before adding layout machinery, try the semantic relationships, node and relationship source order, and Mermaid's native layout. Do not use dummy nodes, meaningless transparent relations, or derived-asset adjustments to force an arrangement.
- Never create SVG or PNG, invoke a renderer, or install rendering dependencies unless the user explicitly asks to export.
Workflow
- Identify the diagram's purpose, reader, subject, and one-sentence reading.
- Reuse an existing Markdown file when one already carries the discussion. Otherwise copy
/templates/icon-context.md or /templates/business-flow.md.
- Choose the smallest suitable profile:
- Read references/icon-context.md for actors,
activities, information, systems, semantic left/center/right layout, and
context relationships.
- For an actor, external-system, or information master map, read
../business-context-modeling/references/master-elements.md, copy the
matching template, and run check_master_map.py with its --kind.
- Read references/business-flow.md for order, decisions, and rework.
- For another Mermaid type, use native syntax and avoid adding visual machinery that the subject does not require.
- Edit the Mermaid block and its short reading or unresolved question together.
- For a governed profile, run the relevant source-only checker:
python3 .agents/skills/mermaid-diagram-authoring/scripts/check_context_diagram.py path/to/context.md --strict
python3 .agents/skills/mermaid-diagram-authoring/scripts/check_business_flow.py path/to/flow.md --strict
For Business Context semantics, also run:
python3 .agents/skills/business-context-modeling/scripts/check_business_context.py path/to/context.md
The context checker rejects arrows by default. If direction itself is a
documented semantic exception, opt in with --allow-arrow-exception; ordinary
provider, recipient, input, and output relations do not need it.
- Inspect the native or rendered preview after source validation. For a
Business Context, confirm the Business backbone is traceable, both semantic
sides are legible, crossings do not hide the scene, and relation endpoints
are intact. Then let the user inspect the Markdown in GitHub or VS Code.
Modeling relationship
When business-context-modeling leads the task, use this Skill as its notation discipline inside the same loop:
conversation -> tentative model -> Mermaid -> inspect density and relationships
-> revise boundary or grain -> update Mermaid
Layout pressure is evidence for modeling, not permission to silently change meaning.
Use source order as a semantic layout hint: provider/executor/input nodes,
then Business activities and genuine shared Information in positions matching
their roles, then recipient/output nodes. Do not force a Business / Information
alternation. Write each relation in approximate left-to-right endpoint order.
Never add a fake node or edge to force coordinates.
Output contract
Return the Markdown working source, the Mermaid block, a compact text
alternative, source-validation and visual-review results when applicable, and
one unresolved semantic or visual question. Do not list image artifacts that
were not explicitly requested.
1---2name: mermaid-diagram-authoring3description: Create and refine simple Mermaid diagrams directly inside Markdown or as explicitly requested standalone .mmd sources. Use for fast GitHub or VS Code preview, actor/system/information master maps, relationship diagrams, business context views, operational flows, decisions, rework, and source-only Mermaid cleanup. This Skill never creates SVG or PNG; route explicit media requests to mermaid-diagram-export.4---56# Mermaid Diagram Authoring78Write the smallest diagram people can inspect while the conversation is still changing. Treat Mermaid as a thinking surface, not merely a final rendering format.910## Core contract1112- Default to one `mermaid` code block inside a Markdown file.13- Keep one diagram and one main question per working file.14- Keep the Markdown file as the single editable source and working visual-review surface; do not duplicate it into `.mmd` automatically.15- Use a standalone `.mmd` only when the user explicitly asks for one or an integration requires it.16- Preserve business meaning while improving notation and visual consistency. Treat the established icon stroke width and size, spacing, relation line, arrow usage, color, and typography as visual-language assets; do not change them without explicit agreement.17- In a business model set, keep the profiles separate: Overall / Business Map,18 Business Context for one scene with a multi-Business backbone, and a Flow or19 recursive Detailed Business Context expanding one selected Business. Record20 the parent/expanded-node trace outside the Mermaid block.21- Keep image-node properties in the exact order `label`, `img`, `pos`, `w`,22 `h`, `constraint`, so the stable English ID and Japanese label remain easy23 to compare while editing.24- Before adding layout machinery, try the semantic relationships, node and relationship source order, and Mermaid's native layout. Do not use dummy nodes, meaningless transparent relations, or derived-asset adjustments to force an arrangement.25- Never create SVG or PNG, invoke a renderer, or install rendering dependencies unless the user explicitly asks to export.2627## Workflow28291. Identify the diagram's purpose, reader, subject, and one-sentence reading.302. Reuse an existing Markdown file when one already carries the discussion. Otherwise copy `/templates/icon-context.md` or `/templates/business-flow.md`.313. Choose the smallest suitable profile:32 - Read [references/icon-context.md](references/icon-context.md) for actors,33 activities, information, systems, semantic left/center/right layout, and34 context relationships.35 - For an actor, external-system, or information master map, read36 `../business-context-modeling/references/master-elements.md`, copy the37 matching template, and run `check_master_map.py` with its `--kind`.38 - Read [references/business-flow.md](references/business-flow.md) for order, decisions, and rework.39 - For another Mermaid type, use native syntax and avoid adding visual machinery that the subject does not require.404. Edit the Mermaid block and its short reading or unresolved question together.415. For a governed profile, run the relevant source-only checker:4243```bash44python3 .agents/skills/mermaid-diagram-authoring/scripts/check_context_diagram.py path/to/context.md --strict45python3 .agents/skills/mermaid-diagram-authoring/scripts/check_business_flow.py path/to/flow.md --strict46```4748For Business Context semantics, also run:4950```bash51python3 .agents/skills/business-context-modeling/scripts/check_business_context.py path/to/context.md52```5354The context checker rejects arrows by default. If direction itself is a55documented semantic exception, opt in with `--allow-arrow-exception`; ordinary56provider, recipient, input, and output relations do not need it.57586. Inspect the native or rendered preview after source validation. For a59 Business Context, confirm the Business backbone is traceable, both semantic60 sides are legible, crossings do not hide the scene, and relation endpoints61 are intact. Then let the user inspect the Markdown in GitHub or VS Code.6263## Modeling relationship6465When `business-context-modeling` leads the task, use this Skill as its notation discipline inside the same loop:6667```text68conversation -> tentative model -> Mermaid -> inspect density and relationships69 -> revise boundary or grain -> update Mermaid70```7172Layout pressure is evidence for modeling, not permission to silently change meaning.7374Use source order as a semantic layout hint: provider/executor/input nodes,75then Business activities and genuine shared Information in positions matching76their roles, then recipient/output nodes. Do not force a Business / Information77alternation. Write each relation in approximate left-to-right endpoint order.78Never add a fake node or edge to force coordinates.7980## Output contract8182Return the Markdown working source, the Mermaid block, a compact text83alternative, source-validation and visual-review results when applicable, and84one unresolved semantic or visual question. Do not list image artifacts that85were not explicitly requested.