dsh-markdown-preview
September 12, 2026 · View on GitHub
DeepSeek Harness plugin: markdown outline, style linting, and fenced-code extraction as model tools.
The three tools are pure functions over the markdown text the model passes in — they read no files, spawn no subprocesses, and touch no network — so they are cheap, deterministic, and safe to run in parallel.
Install
npx -y @deepseek-ai/dsh plugin --profile web add @qingshanjiluo/dsh-markdown-preview
The bundle layer (cordis.patch.yml) inserts the plugin into the profile's layer stack with the
defaults below.
Tools
| Tool | Arguments | Returns |
|---|---|---|
md_outline | md (string, required), maxLevel (integer, optional — default 6) | Heading tree in document order: level, text, GitHub anchor slug, 1-based line, and ancestors breadcrumb. Headings inside fenced code blocks are ignored. |
md_lint | md (string, required) | Style findings with line, column, rule id, severity, and a fix hint, plus errors / warnings / infos counts. |
md_extract_code | md (string, required), lang (string, optional filter) | Fenced code blocks: 1-based document index, lang, line/endLine, lines, verbatim code; a per-language languages tally; unclosed when the document ends inside a fence. |
Lint rules
| Rule | Severity | Trigger |
|---|---|---|
image-alt-missing | error |  — an image with no alt text |
link-text-missing | error | [](src) — a link with no label |
heading-space | error | #Title — no space after the # markers |
heading-level | error | seven or more # — deeper than markdown defines |
heading-empty | error | a heading marker run with no text |
code-fence-unclosed | error | a fence opened with no matching close |
heading-skip | warning | a level jump such as H1 straight to H3 |
bare-url | warning | a raw http(s):// URL in prose (links, autolinks, and code are exempt) |
code-fence-language | warning | a fenced block with no language tag |
line-length | info | a prose line over maxLineLength |
no-top-heading | info | the document has no H1 |
Fenced code blocks are never linted, so example markup inside them stays quiet.
Configuration
| Field | Type | Default | Meaning |
|---|---|---|---|
maxLineLength | number | 120 | Soft line budget for the line-length rule. |
flagBareUrls | boolean | true | Whether bare URLs in prose are reported. |
Development
npm install
npm run typecheck # tsc --noEmit
npm run build # tsc + tsdown -> lib/index.js, lib/index.d.ts
npx vitest run # behavior tests
node scripts/load-smoke.mjs # loads the built artifact and registers the tools
License
MIT