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

ToolArgumentsReturns
md_outlinemd (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_lintmd (string, required)Style findings with line, column, rule id, severity, and a fix hint, plus errors / warnings / infos counts.
md_extract_codemd (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

RuleSeverityTrigger
image-alt-missingerror![](src) — an image with no alt text
link-text-missingerror[](src) — a link with no label
heading-spaceerror#Title — no space after the # markers
heading-levelerrorseven or more # — deeper than markdown defines
heading-emptyerrora heading marker run with no text
code-fence-unclosederrora fence opened with no matching close
heading-skipwarninga level jump such as H1 straight to H3
bare-urlwarninga raw http(s):// URL in prose (links, autolinks, and code are exempt)
code-fence-languagewarninga fenced block with no language tag
line-lengthinfoa prose line over maxLineLength
no-top-headinginfothe document has no H1

Fenced code blocks are never linted, so example markup inside them stays quiet.

Configuration

FieldTypeDefaultMeaning
maxLineLengthnumber120Soft line budget for the line-length rule.
flagBareUrlsbooleantrueWhether 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