From lumen
Render Mermaid diagram (flowchart, sequence, ER, state, gantt, mindmap, class) as self-contained HTML with zoom, pan, fit-to-screen, expand-to-tab. Invoke when user asks for mermaid diagram or supplies mermaid source.
How this skill is triggered — by the user, by Claude, or both
Slash command
/lumen:lumen-mermaidThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Mermaid in HTML shell. Zoom / pan / fit / new-tab. Offline-safe after first CDN load.
Mermaid in HTML shell. Zoom / pan / fit / new-tab. Offline-safe after first CDN load.
Tier: capability (atomic) — does not invoke other lumen skills. Composites and playbooks may invoke it.
Triggers: mermaid diagram, mermaid chart, raw mermaid source pasted by user, or when mermaid syntax fits the request better than custom SVG (flowcharts with conditionals, sequence with many actors, ER schemas).
Single HTML file. Mermaid source embedded via opaque script tag to avoid HTML parser mangling:
<script type="text/plain" class="diagram-source">
graph TD
A --> B
</script>
</script> inside the source escaped to <\/script. Mermaid CDN loaded with startOnLoad: false. Explicit mermaid.render(id, code) called after DOMContentLoaded to avoid timing races.
Lifted from visual-explainer. 8 palettes, each with light + dark variants:
blueprint (default), editorial, paper, terminal, dracula, nord, solarized, gruvbox.
The 5 fgraph aesthetics (dark-professional, blueprint, editorial, terminal, lyra) live in skills/_shared/aesthetics/ and are consumed by the deterministic diagram / chart / guide / slide / gallery renderers — NOT by mermaid (mermaid uses the 8 palettes above, baked into src/templates/shared.ts). Future gmdiagram-derived aesthetics (glassmorphism, cyberpunk-neon, hand-drawn) land in skills/_shared/aesthetics/ as patches.
MERMAID_SHELL_CSS + MERMAID_SHELL_JS in src/templates/shared.ts)position: relative; overflow: hidden. Canvas absolute-positioned, transformed via translate + scale.+, −, fit, 1:1, expand-to-tab. Expand reads data-bg and exports SVG to minimal new-tab HTML.generateMermaidTemplate(title, {mermaidSyntax, caption?}, aesthetic, isDark) from src/templates/mermaid.ts. CSS + IIFE JS inlined.data-bg + theme tokens.writeHtmlFile. Open via file://.</script> in source escaped to <\/scriptmermaid.startOnLoad is falsemermaid.render called oncedata-bg attribute set so expand-to-tab matcheslumen-generate_visual({type, content, title, aesthetic?, theme?}) where type ∈ {flowchart, sequence, er, state, mermaid_custom} → renderer at src/templates/mermaid.ts (lifted verbatim from visual-explainer). Note that type: "sequence" here means a mermaid sequence diagram (text source); the fgraph deterministic sequence renderer is reached via type: "diagram" with content.topology: "sequence" (see lumen-diagram/SKILL.md).
visual-explainer/src/templates/mermaid.ts → HTML scaffold + escape trick + explicit rendervisual-explainer/src/templates/shared.ts::MERMAID_SHELL_JS → zoom / pan / fit / expand-to-tab IIFEvisual-explainer/src/templates/shared.ts::MERMAID_SHELL_CSS → readability floor, adaptive height, concrete fontsnpx claudepluginhub monsieurbarti/lumen --plugin lumenCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.