Create hand-drawn workflow diagrams from natural-language process descriptions by generating strictly validated Mermaid flowchart, sequenceDiagram, or classD...
Treat flowchart as the primary hand-drawn path. It converts to native Excalidraw elements and gives the best editable sketch-style result.
Treat sequenceDiagram as supported but still verify output visually when the diagram is complex.
Treat classDiagram as supported with possible image fallback inside the Excalidraw scene. If the script reports image-fallback, the PNG is valid, but editability is limited.
Reject unsupported Mermaid diagram types instead of silently producing a lower-quality result.
Do not claim success until the renderer has completed without validation or export errors.
Strict Validation Rules
Run node scripts/render-mermaid-handdraw.mjs --input --validate-only after generating Mermaid if you need a fast syntax gate.
If validation fails, edit the Mermaid source and rerun. Do not bypass validation.
Prefer simple Mermaid syntax over clever syntax. Avoid custom CSS, HTML labels, Markdown tables inside labels, YAML frontmatter, and experimental Mermaid shape declarations.
Keep node IDs stable and ASCII where practical. Put user-facing Chinese text in labels, not IDs.
Rendering Notes
The script uses browser execution because Excalidraw export utilities require DOM/canvas APIs.
If Playwright has no bundled browser, the script tries common local Chrome/Chromium executable paths and honors CHROME_PATH.
For reproducible results, keep the versions pinned in package.json unless there is a specific reason to upgrade and retest the renderer.