---
name: "mermaid-flowchart-state-diagrams"
description: "Generate declarative flowcharts, state transitions, and class models in plain text."
metadata:
  author: "Mermaid"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "write mermaid flowchart"
  - "create mermaid state diagram"
  - "style mermaid diagram nodes"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Mermaid.js Flowcharts & State Diagrams

Authors Mermaid diagram syntax: flowchart TD/LR directions, decision diamonds, subgraphs, stateDiagram-v2 transitions, composite states, and custom CSS theme styling.

## When to Invoke
Invoke this skill whenever you need to:
- write mermaid flowchart
- create mermaid state diagram
- style mermaid diagram nodes

## Execution SOP & Rules
1. Specify graph direction explicitly with flowchart TD (top-down) or flowchart LR (left-right).
2. Use semantic node brackets: (round), [rectangle], {diamond}, ((circle)).
3. Group related subsystems into labeled subgraphs: subgraph PaymentGateway ... end.
4. Apply CSS style classes to specific nodes with style nodeA fill:#f9f,stroke:#333.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
