Makes the AI default to Mermaid diagrams in development conversations — system prompt guidance, a mermaid_validate syntax-check tool with real-parser validation, and an output gate that auto-fixes or removes broken diagrams. Rendering via dsh-mermaid.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-mermaid-comm
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:kp-z/dsh-mermaid-comm
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Make the AI default to Mermaid diagrams in development conversations. Rendering is handled by dsh-mermaid; this plugin focuses on prompt guidance, syntax validation, and output safety.
Features
| Capability | What it does |
|---|---|
| A. Behavior guidance | Injects a systemPrompt.section: architecture, data flow, sequence, state, and dependency topics default to Mermaid — diagram first, then a short explanation. |
| B. Syntax validation | Registers the mermaid_validate tool: dangerous-character scan first, then real parsing via the same-version mermaid-runtime shipped with dsh-mermaid. |
| C. Output gate | Listens for assistant message events; auto-fixes Unicode arrows / dangerous labels in Mermaid fences, and removes broken diagrams from the visible surface when they cannot be confirmed. |
| D. Mermaid Vault | Persists validated diagrams to <workspace>/.dsh/mermaid/ as versioned assets: <name>.mmd (current version) + <name>.history.md (evolution history) + INDEX.md. The index is injected into the system prompt so later conversations evolve existing diagrams instead of redrawing from scratch. |
Mermaid Vault (diagram persistence)
New in 0.2.0. Diagrams worth keeping — architecture, data models, core flows — are saved to the vault as a same-topic versioned series:
<workspace>/.dsh/mermaid/
├── INDEX.md # vault index (topic/type/version/updatedAt)
├── payment-flow.mmd # current active version (always renderable)
└── payment-flow.history.md # v1/v2/... with per-version change notes
Four model-visible tools:
mermaid_vault_list— list the vault index (optional type filter)mermaid_vault_read— read a topic: current code + evolution historymermaid_vault_save— save/update a diagram (forced real-parser validation; syntax errors are rejected, so the vault only ever holds renderable diagrams)mermaid_vault_delete— delete a topic (main file + history + index entry)
The vault index is injected into the system prompt (lightweight table only — diagram contents are read on demand via mermaid_vault_read). When a topic already exists, the model is guided to read its history and evolve it with save (creating v2/v3/...) rather than redrawing from zero — that is how later conversations see the diagram's continuous change and stay consistent with earlier work.
Safety: topic names are sanitized to [a-zA-Z0-9-_] (no path traversal), writes are locked inside the vault directory, files are written atomically, and size/version limits prevent unbounded growth.
Installation
dsh plugin --profile web add dsh-mermaid-comm
# also install dsh-mermaid (handles chat rendering)
dsh plugin --profile web add dsh-mermaid
Restart dsh web. If dsh-mermaid is not installed or its runtime is unavailable, mermaid_validate fails explicitly instead of reporting unvalidated diagrams as passing; the output gate never silently lets a broken diagram through.
Usage
The model defaults to Mermaid output for:
- Architecture / module relationships →
flowchartorclassDiagram - Call chains / request sequences →
sequenceDiagram - State / lifecycle →
stateDiagram-v2 - Data models / table relationships →
erDiagram - Branching strategy / Git history →
gitGraph - Plans / schedules →
gantt
Validation rules
mermaid_validate returns:
ok: whether the current code passes;built: the code after rule-based fixes;fixes: the fixes applied;errors: dangerous characters, missing runtime, or parse errors;mode: "true-runtime": mode marker for backward compatibility with older callers.
The output gate supports both ```mermaid and ```mermaidd fences. Each broken block is independently re-evaluated; a fixed version that passes the same runtime parser replaces the original block, and blocks that still fail are replaced with a safe notice instead of being handed to the renderer.
Safety boundary
- Unicode arrows, unpaired quotes, and subgraph special characters are scanned/fixed first;
- Real parsing uses dsh-mermaid's
lib/mermaid-runtime.jsdirectly — no reliance on the error-prone.hashfield; - Original events stay in the transcript; the fixed version overrides the visible message via a surface
replace; - The output gate only handles
assistant/messageappend events and uses agateFixedmarker to prevent reprocessing.
Development
pnpm install
pnpm --filter dsh-mermaid-comm build
pnpm --filter dsh-mermaid-comm typecheck
Install from a checkout:
dsh plugin --profile web add file:/path/to/packages/dsh-mermaid-comm
License
MIT
Links
More in this category
tt-a1i/archify#integrations/deepseek-harness★ 89901
Generate validated, self-contained interactive architecture, workflow, sequence, data-flow, and lifecycle diagrams from repositories or system descriptions.
dream-num/dsh-univer-office★ 614
Give DeepSeek Harness a real office environment. Univer Office Plugin brings spreadsheets, docs, slides, canvases, relational tables, and more into one runtime — with connected data, validation, versioned changes, and isolated worktrees for multi-agent collaboration.
ECNU/EduWork#dsh-knowledge-studio★ 246
A workspace-based Studio for source-grounded reports, slides, tables, mind maps, quizzes, flashcards, audio and video, using DSH models and shared artifact services. Office generation requires Python 3.12+ with its dependencies and DSH_OFFICE_PYTHON configured; media rendering requires Chromium, and local ASR additionally requires whisper.cpp and a model.
PerryLink/dsh-industry-research★ 214
Deterministic industry research reports for DeepSeek Harness — company and industry research flows produce structured, verifiable reports from staged evidence.
HuanLinOTO/dsh-plugin-mineru★ 48
Expose MineRU document parsing tools to the model.
PolinniZhong/dsh-knit★ 47
Puts the Markdown documents, source files, images and video that already exist anywhere in the session workspace into the DSH sidebar, ranked by relevance to the current conversation. The default lexical mode matches your recent messages against title, summary and body locally with IDF weighting (BM25) — no model calls, no network, nothing leaves the machine. The list comes from scanning the workspace rather than from a recent-files list, so restarting DSH or opening a new session does not empty it. Results are organised into a three-tier reading order (primary / supporting / related) with a verifiable reason on every row — which field matched, which document cites this one — and one click opens an in-place preview: Markdown as rendered text, relative-path images actually drawn, source code with the host's own syntax highlighting, video streamed over HTTP Range. The same Context Pack is exposed to the agent as a knit_docs tool. Later versions added read evidence and lifecycle tracking (attribution is frozen at the moment of reading), pin / exclude (exclusion applies before retrieval, and is undoable), relation evidence (references / imports / tests, with line numbers) and an incremental index reused across restarts. Since v0.23 there is also an optional hybrid mode: it is off by default and only runs once you configure an Ollama or OpenAI-compatible embedding provider yourself. When it runs, what leaves the machine is your query text plus each candidate file's title and summary — a Markdown summary is an excerpt of the body's first paragraph (at most 60 characters), a code file's summary is its workspace-relative directory, and an image or video contributes its file name; full bodies and absolute paths are not sent, and a loopback provider keeps everything on this machine. Since v0.24 it also associates uncommitted changes: a read-only git status (fixed argv, no shell, whitelisted child-process environment) combined with the same reference / import / test / mention evidence shows which files a change is likely to drag along, and it is off by default. The benefit of semantic retrieval still awaits a real-provider run, so no recall improvement is claimed.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.