Introduction

To get an agent to “draw a flowchart” within DeepSeek Harness (DSH), there are two common approaches: one is to let the model output a snippet of Mermaid source code, which is then manually pasted into a renderer to generate the image; the other is to write a script tool that directly manipulates the file system, allowing the model to generate the file and write it to disk autonomously. The former breaks the workflow outside of the conversation, while the latter bypasses Harness’s file writing approval and sandbox policies.

deepseek-harness-flowchart takes a different path: it mounts a render_flowchart tool for DSH that renders the Mermaid flowchart locally into a themed, self-contained SVG, delegating file writing nestedly to Harness’s registered write tool. DSH’s philosophy is “everything is a plugin,” and this repository serves as a directly installable profile bundle.

About This

lizhecome/deepseek-harness-flowchart is a DeepSeek Harness plugin maintained by lizhecome. Its npm package name is @lizhecome/dsh-flowchart, version 0.1.0, and it is released under the MIT license. Upon installation, it adds the render_flowchart tool, rendering Mermaid flowchart source code into exquisite, themed, and self-contained SVGs. The community directory page categorizes it under the “Fun Outfit” category.

The rendering is completely local and deterministic, involving no LLM or network requests. It is built upon beautiful-mermaid 1.1.3 to handle Mermaid parsing, layout, theming, and SVG generation.

Core Features

render_flowchart Tool

The tool parameters are as follows:

Parameters Required Description
source Yes Complete Mermaid flowchart source code
file_path Yes SVG target path, parsed by the installed write tool, must end with .svg
theme No One of 15 themes; defaults to the deployed configuration’s default theme if omitted
transparent No Removes the theme background, default false
padding No Canvas padding, 0200, default 40
node_spacing No Horizontal spacing between nodes in the same layer, 8160, default 24
layer_spacing No Vertical spacing between layers, 8240, default 40

There are 15 supported themes in total: zinc-light, zinc-dark, tokyo-night, tokyo-night-storm, tokyo-night-light, catppuccin-mocha, catppuccin-latte, nord, nord-light, dracula, github-light, github-dark, solarized-light, solarized-dark, one-dark.

Input Restrictions

It only accepts Mermaid flowchart/graph documents with explicit directions (TD/TB/BT/LR/RL). Sequence diagrams, class diagrams, state diagrams, ER diagrams, XY diagrams, and other Mermaid chart types are rejected.

Rendering Security

Before distributing the SVG, the plugin performs a cleanup: it removes external font imports from the renderer, rejects scripts, event handlers, embedded browser documents, JavaScript URLs, and external hrefs, and applies a maxSvgBytes limit to the final self-contained result.

Reusing the write Tool

The plugin never writes files directly via Node’s environment file system. The generated SVG content is distributed via nested calls to Harness’s registered write tool. Consequently, tool limitations, approvals, sandbox policies, read-before-overwrite rules, cancellations, and final result normalization remain fully enforced. If the write tool is unavailable or rejected, render_flowchart will fail rather than claim success.

Installation and Enablement

Requires DeepSeek Harness 0.1.0-rc.6 or later, and the GitHub CLI must have access to the repository (the README marks it as private). The installation consists of three steps:

gh repo clone lizhecome/deepseek-harness-flowchart
cd deepseek-harness-flowchart
dsh plugin --profile web add --ignore-workspace-root-check .

First clone the repository using the GitHub CLI, then add it to the web profile within the repository directory. The README explains that add . anchors to the checkout directory of the invocation before pnpm switches to the profile directory. The package manifest declares a dsh.bundle patch, which automatically mounts the tool and its invariant companion package during installation.

For one-off tasks, you can use the headless profile instead of web. The uninstall command is as follows:

dsh plugin --profile web remove --ignore-workspace-root-check @lizhecome/dsh-flowchart

Typical Usage

Describe the desired flowchart to the agent and specify the SVG output location, for example:

Create a left-to-right flowchart of the checkout process and save it as docs/checkout.svg. Use the catppuccin-mocha theme.

The model will call render_flowchart, with the passed Mermaid source code looking like:

flowchart LR
  cart([Cart]) --> payment{Payment valid?}
  payment -->|Yes| success([Order placed])
  payment -->|No| retry[Retry payment]
  retry --> payment

A successful call only returns the output path, theme, and byte count; the SVG body is passed through the nested write tool and will not be copied into the parent model’s result. The model only sees a tool schema; changes in configuration or tool availability are reflected in the request’s tool-schema prefix.

Configuration

Subsequent profile patches replace the config line-by-line, so you need to re-declare all fields you wish to preserve:

- id: flowchart
  config:
    defaultTheme: github-light
    maxSourceChars: 50000
    maxSvgBytes: 2000000
Field Default Value Description
defaultTheme tokyo-night The theme used when the theme argument is omitted during tool invocation
maxSourceChars 50000 Positive integer upper limit for the complete Mermaid input
maxSvgBytes 2000000 Positive integer upper limit for the complete UTF-8 SVG

Invalid boundary values or the configuration of unavailable themes will cause the plugin to fail directly during loading.

Use Cases and Notes

Suitable for teams that frequently need to generate flowchart documentation in DSH: architecture descriptions, checkout processes, etc. They want the results to be directly themeable, self-contained SVGs ready for storage, without relaxing file writing policies.

Before use, there are a few points to confirm:

  1. Only supports flowcharts; other Mermaid charts are rejected. Only outputs SVG, no PNG/PDF conversion.
  2. Overwriting existing files follows the policy of the installed write tool; the agent may need to read the file first.
  3. After removing web font imports, viewers will use the local Inter font or system sans-serif fonts.
  4. The plugin runs with the permissions of the current dsh process. It is recommended to check the source code and license before installation (this project is MIT).
  5. The README marks the repository as private; cloning requires the GitHub CLI to have corresponding access permissions.

Conclusion

The value of this plugin lies in integrating the step from “Mermaid source code” to “deliverable SVG file” into the agent’s toolchain: local, deterministic rendering with no network requests, file writing still goes through Harness’s existing write tool and its policies, and the 15 themes allow the output to be directly inserted into documentation.

  • Directory page: https://www.skillhub.cn/plugins/lizhecome/deepseek-harness-flowchart
  • GitHub: https://github.com/lizhecome/deepseek-harness-flowchart