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, opens the tab once per file (MERMAID_PREVIEW_ALWAYS_OPEN=1 to force-open every write).
Auto-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 required configuration. The plugin registers a PostToolUse hook on Write|Edit|MultiEdit|NotebookEdit and writes previews to ~/.claude/previews/. The browser opens once per file (on first render); set MERMAID_PREVIEW_ALWAYS_OPEN=1 if you want a tab opened on every write instead.
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 browser on first render]
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; later edits rewrite the same file and let the in-page poller reload the existing tab. Set MERMAID_PREVIEW_ALWAYS_OPEN=1 (or true/yes/on) to open a tab on every write. 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
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub xiaolai/claude-plugin-marketplace --plugin mermaid-previewNatural-Language Programming Manager — score, check, fix, and test NL artifacts across Claude Code, Codex CLI, and Antigravity. Tier-aware scoring with per-tool overlays.
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
Auto-updated multi-skill reference for the whole Anthropic doc ecosystem. 8 skills covering claude-code, claude-agent-sdk, anthropic-api, anthropic-platform-features, claude-connectors, claude-cowork, mcp-spec, and anthropic-pulse (news + research digests). Pipeline refreshes daily.
One plugin to bridge and delegate across Claude Code, Codex CLI, and Gemini CLI — single-source AGENTS.md, shared skills, mirrored hooks and MCP servers, and full Claude↔Codex bidirectional delegation.
Create, validate, and render Mermaid diagrams
MCP server for previewing Mermaid diagrams in Claude Code
Trim and optimize markdown files for LLM agent consumption
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