Mermaid Validation
| Field | Value |
|---|---|
| Type | Skill Resource |
| Source | ~/.copilot/skills/technical-writing/references/mermaid/validation.md |
| Description | Not specified |
Source Content
Mermaid Validation
Lint Workflow
For a Markdown or MDX file:
python3 ~/.copilot/skills/technical-writing/scripts/mermaid_lint.py /path/to/file.mdFor an isolated diagram, write a temp file first:
cat > /tmp/diagram.mmd << 'EOF'flowchart TD A["Start"] --> B{"Done?"}EOFpython3 ~/.copilot/skills/technical-writing/scripts/mermaid_lint.py /tmp/diagram.mmdExit 0 is clean. Exit 1 means errors were found. Fix every error and re-run.
If mmdc is installed, the script also runs Mermaid CLI validation.
Common Errors
| Wrong | Correct | Why |
|---|---|---|
graph TD | flowchart TD | graph is legacy |
A->B | A --> B | Single dash is not a flowchart arrow |
A[label: text] | A["label: text"] | Punctuation needs quoting |
stateDiagram | stateDiagram-v2 | v1 is deprecated |
A->>B in flowchart | A --> B | Wrong arrow family |
Node ID end | EndState | end is reserved |
Bare < in label | < or quoted text | Breaks renderers |
classDef in beautiful-mermaid flowchart | style Node ... | Avoid stray visible class node |
Final Self-Rubric
- Pre-generation checklist completed.
- Diagram starts with the person/actor when a person drives the flow.
- Roles are visible early enough to answer “where am I?” quickly.
- Role labels use canonical names.
- Diagram answers one reader question.
- Layout is balanced and print-safe.
- Labels are short and concrete.
- No reserved words are used as node IDs.
- Every block opener has a matching
end. - Special-character labels are quoted.
beautiful-mermaidflowcharts usestyle, notclassDef/class.- Linter exits 0.