dsh-visual-explainer: Clarify terms first, then generate illustrated cards

Introduction

In DeepSeek Harness (DSH), when asking the model to “draw a picture to explain clearly,” a common problem is that readers don’t understand the technical terms on the diagram: no matter how beautiful the flow is, the information doesn’t stick. Conversely, piling up text explanations alone makes it difficult to scan. The community plugin dsh-visual-explainer (maintainer biubiuandmiaomiao) embeds this sequence into the toolchain: first conduct a terminology round (plain language), then render PNG cards or an offline clickable mermaid interactive page. If you skip the terminology round and draw directly, the gate will reject it, preventing the silent production of an incomprehensible diagram.

Below is an introduction to the plugin’s positioning, four tools, installation configuration, and typical usage. Facts are based on the GitHub repository README; Community directory page: skillhub.cn/plugins/biubiuandmiaomiao/dsh-visual-explainer (Not officially affiliated with DeepSeek / Quant well).

What is this

dsh-visual-explainer is an explanation-focused plugin for DeepSeek Harness (Category: Model Reasoning). Summary: First explain professional/technical terms in plain language, then turn the explanation into PNG cards, or generate a clickable offline mermaid interactive page.

Current package version 0.2.2, License MIT. Rendering depends on the local Chrome or Edge headless mode; no additional browser driver is installed, and the image generation process is offline.

Core Design: Terms First, Diagrams Second

The plugin fixes the pipeline into two steps:

  1. visual_terms: Round 0. Write the terms in this explanation as { term, plain, context?, analogy?, pitfall? }, generate markdown that can be placed at the beginning of the answer, and save to disk as terms.md / terms.json.
  2. visual_explain: After the terminology round, render PNGs one by one according to <section id="fgN"> in the HTML (measure real height before screenshotting to reduce bottom whitespace).

If the order is reversed, visual_explain will be directly rejected by the gate (e.g., prompt: Explain terms first, then draw). If there are indeed no terms to explain, you can use visual_terms({ terms: [], note: '…' }), or pass skipTerms: true to visual_explain only in scenarios like re-rendering old diagrams.

In addition to the two main tools above, there are:

Tool Function
visual_template Optional: Write out a starter template (1240px canvas, semantic color scheme, card styles, height measurement script, etc.)
visual_interactive Generate a clickable offline interactive explanation page (Left steps + Right mermaid + Plain language); check uses headless browser to self-check if every step can render

The plugin also registers an on-demand skill manual skill.md, describing the process of “explaining a diagram so a layman can understand” and mermaid considerations.

Environment Requirements

  • DeepSeek Harness Desktop Edition (The plugin is a host-side bundle; README states it is verified on Windows, and browser path detection also covers common paths on macOS / Linux).
  • Local installation of Chrome or Edge.
  • Node.js ≥ 20 (Required when running tests or using the standalone command-line renderer).

Installation and Activation

The installation method provided in the official README is as follows (PowerShell):

git clone https://github.com/biubiuandmiaomiao/dsh-visual-explainer.git
cd dsh-visual-explainer
pwsh -File .\install.ps1            # Default link: Changes in source code will take effect on next reload
# Or: Package as tgz then install, decoupled from the source directory
pwsh -File .\install.ps1 -Mode pack

The script will parse pnpm (-Pnpm → DSH_DESKTOP_PNPM → DSH built-in runtime → PATH) and select the package into the profile’s dsh.profile.bundles.

You must restart DeepSeek Harness once after installation: Tools are registered to ctx.tools at process startup; the record of whether the terminology round has been done is in-process. After restart, the first drawing will again require explaining terms first (README explains this is intentional design).

Verification points:

  • dsh-visual-explainer should be visible in the sidebar Plugins;
  • pluginVersion, toolsRegistered, appliedAt in %TEMP%\dsh-visual-explainer-status.json should match this startup;
  • Ask the model to do a “diagram explanation”, and it should be able to call visual_terms.

If not using install.ps1, you can add dependencies and dsh.profile.bundles in the profile’s package.json (default %USERPROFILE%\.dsh\profiles\desktop\package.json), then run pnpm install in the profile directory; the cordis.patch.yml inside the package will insert the plugin line (See README “Manual Wiring” collapsed section for details).

Configuration

Override by line ID in the profile’s cordis.patch.yml (You can also modify the default values in the package):

- id: visual-explainer
  name: dsh-visual-explainer
  config:
    outDir: .dsh-visual   # Relative to session working directory
    scale: 2              # 2 → 1240px canvas outputs 2480px width
    width: 1240
    browser: ""           # Leave empty to auto-find Chrome / Edge
    maxCards: 12          # Single render limit
    termsFirst: true      # true=Terminology round must be done before drawing; false=Turn off gate
    explainerDir: .dsh-explain  # Default output directory for visual_interactive

Typical Usage

Dialogue Side Prompts

You can directly say, for example:

  • “Explain X with diagrams”
  • “Understand X in one picture”
  • “Explain these terms first, then draw them into a picture”
  • “Explain this sequence diagram so a coding layman can understand, and make it into a clickable mermaid page”

Once the skill description is hit, the model calls tools in the manual order; you can also directly name the tool.

Four-Step Pipeline (Model / Tool Calls)

// 1. Round 0: Terms
visual_terms({
  topic: 'mem0 add / search flow',
  terms: [
    { term: 'Embedding', plain: 'Turn a sentence into a string of numeric coordinates; similar meanings have similar coordinates' },
    { term: 'BM25', plain: 'Old-style keyword scoring: only recognizes literals, doesn't understand meaning' }
  ]
});

// 2. Optional: Write starter template
visual_template({ path: 'explain.html' });

// 3. Output image
visual_explain({ html: '<!doctype html>…', outDir: 'figs' });

// 4. Or: Clickable interactive page
visual_interactive({ action: 'scaffold', dir: 'explain', title: 'Understand this system' });
// Modify const steps=[...] in explain/index.html, then:
visual_interactive({ action: 'check', dir: 'explain' });

The mem0 add / search flow example in the README shows multiple pipeline cards and scoring-related illustrations, which can serve as a reference for the output form (see repository docs/screenshots/).

Card Conventions

  • One card corresponds to one conclusion; id must be fg1, fg2, fg3… (Renderer sorts by number);
  • Height budget is about 800px; if exceeded, split to the next card;
  • Must retain the height measurement script in the template (Write the bottom edge of the visible section to document.title); Do not change to documentElement.scrollHeight, otherwise unified height and bottom whitespace will appear when content is short.

Standalone Rendering without DSH

node renderer.mjs --html explain.html --out figs --scale 2
node renderer.mjs --html explain.html --out figs --figs 1,3
node renderer.mjs --html explain.html --out figs --whole
node renderer.mjs --html explain.html --out figs --height 900

Applicable Scenarios and Notes

Who it is for: Developers who need to stably produce “plain first, visualized later” explanation materials in DSH conversations; scenarios requiring both PNG cards embedded in answers and offline mermaid step-by-step explanation pages.

Permissions and Security: The plugin runs with the permissions of the current DSH desktop process, reads and writes output directories under the session working directory (e.g., .dsh-visual, .dsh-explain), and calls the local browser for screenshots and self-checks. Please read the repository source code and MIT license before installation; third-party mermaid browser build instructions are in THIRD_PARTY_NOTICES.md.

Interactive Page Limitations (README Summary): Each step corresponds to a separate small image; avoid “incremental display” in mermaid causing alt to be unclosed; sequenceDiagram single message is recommended to be ≤10 Chinese characters to avoid narrow swimlane word breaking.

Troubleshooting: Tool not appearing → Restart Harness, check %TEMP%\dsh-visual-explainer-status.json; 0 cards rendered → Check lastFailures, browser path (browser or CHROME_PATH), whether HTML contains id="fgN". For the complete comparison table, see the README “Troubleshooting” section.

Conclusion

dsh-visual-explainer uses “Terminology Round + Gate” to split diagram explanations into a reproducible two-stage pipeline, supplemented by four tool paths: templates, PNG rendering, and offline interactive pages. If you are doing technical interpretation or training materials in DSH, start with the README’s quick start and four-step examples.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye