Help us improve
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
By xiaolai
Auto-preview Mermaid diagrams in the browser on Write/Edit/MultiEdit/NotebookEdit. Inlined Mermaid bundle (offline-safe), dark-mode aware, auto-reload on source change, per-file preview with LRU retention.
npx claudepluginhub xiaolai/claude-plugin-marketplace --plugin mermaid-previewAuto-preview Mermaid diagrams in the browser whenever Claude Code writes to a markdown-ish file.
@11.4.1) is vendored and inlined into each preview HTML, so no network call is ever made at render time.prefers-color-scheme.textContent; </script> literals inside the bundle are pre-escaped./plugin install mermaid-preview@xiaolai
Install fails with "Plugin not found in marketplace 'xiaolai'"? Your local marketplace clone is stale. Run
claude plugin marketplace update xiaolaiand retry —plugin installdoes not auto-refresh.
No further configuration needed. The plugin registers a PostToolUse hook on Write|Edit|MultiEdit|NotebookEdit and writes previews to ~/.claude/previews/.
flowchart LR
A[Claude writes .md] --> B{hook fires}
B -- ext matches --> C[extract ```mermaid blocks]
C --> D[embed as JSON + inline Mermaid bundle]
D --> E[write ~/.claude/previews/preview-<slug>.html]
E --> F[open in default browser]
F --> G[page polls self, reloads on hash change]
.md, .mmd, .mdx, .markdown, or .ipynb and the file contains a ```mermaid fence.~/.claude/previews/preview-<12-char path hash>.html.open (macOS) / xdg-open (Linux) brings the page up in the default browser. The page builds <pre class="mermaid"> elements via textContent (no HTML injection) and calls mermaid.run().data-hash differs from the one the page loaded with, it calls location.reload(). Scroll, zoom, and tab focus survive between edits.Logs go to ~/.claude/previews/preview.log. LRU retention keeps the newest 20 previews.
Bundled skill mermaid-charts carries authoring guidelines: validate via mcp__mermaider__validate_syntax before writing, iterate until clean, prefer mermaid over ASCII, fence correctly, write charts to files rather than inline-only. Claude auto-invokes it when producing mermaid output.
python3 (macOS system Python is fine)jq (optional — falls back to grep/sed)shasumopen on macOS or xdg-open on LinuxISC — see LICENSE.
Modifies files
Hook triggers on file write and edit operations
Share bugs, ideas, or general feedback.
Based on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Create, validate, and render Mermaid diagrams
MCP server for previewing Mermaid diagrams in Claude Code
Diagrams-as-code tools for visualizing code, data, and systems using Mermaid and PlantUML
Diagram generation for Claude Code via UML-MCP (PlantUML, Mermaid, D2, Graphviz, and more) over HTTP MCP.
Ultra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.
Memory compression system for Claude Code - persist context across sessions
Natural-Language Programming Manager — scan, lint, and write NL artifacts with Claude-native quality scoring
A 260-token system prompt that overrides three structural presumptions every RLHF-trained LLM inherits from training: that you want confirmation, that old scarcity still applies, that best practices are ceilings.
English language coach for non-native speakers — auto-corrects prompts, translates non-English, refines with :: prefix, tracks improvement over time
Initialize a multi-agent workspace with shared configuration for Claude Code, Codex CLI, and Gemini CLI
Documentation quality and freshness enforcer — detect staleness, check accuracy, measure coverage, and auto-generate docs
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claim