dsh-system-prompt
A DeepSeek Harness (DSH) plugin that appends custom system-prompt text to locally configured models: rules match an exact provider/model route or a provider-wide provider/* wildcard and are injected into the system prompt tail. Rules are managed per model from a Settings page and are persisted across DSH restarts.
Features
- Per-route injection — on every model step, prompts of matching rules are appended to the system prompt (registered at order 9950, after every shipped tool and structured-output section). Applies to main sessions, subagents, and workflow children alike.
- Two rule levels — a
provider/* rule applies to every model of that provider; a provider/model rule applies only to that exact model. When both exist they stack in order: provider-wide first, then exact-model.
- Settings page — Settings → System Prompt lists every locally configured provider and its models (same data source as the Models settings page). Each row can add/edit/clear a rule; injected rows show a badge and a content preview.
- Persistent — rules live in
<DSH_HOME>/system-prompt/config.json (default ~/.dsh/system-prompt/config.json) and are restored after a DSH restart.
- Instant effect — saving a rule takes effect on the next model request, no restart required.
Install (standard DSH bundle)
dsh plugin --profile web add @datawork-technology/dsh-system-prompt --registry=https://registry.npmjs.org
Pin the npmjs registry explicitly so a local/mirror registry config does not redirect the install. Restart DSH afterwards (host load, typert registration, and client bundle injection all happen at startup); the System Prompt page then appears in Settings.
Uninstall:
dsh plugin --profile web remove @datawork-technology/dsh-system-prompt
Usage
- Open Settings → System Prompt (right after the Models page).
- The page lists a card per locally configured provider; the first row of each card is All models (provider-wide), followed by one row per model in that provider's config.
- Click Add prompt / Edit on a row, write the text to append, and Save — it takes effect immediately. Clear rule deletes that entry.
- Matching is an exact route match (
provider/model, case-sensitive, e.g. minimax-cn/MiniMax-M3); model ids are exactly what the Models settings page is configured with.
Rule examples
| Rule key | Scope |
|---|
deepseek-official/* | Every model on the DeepSeek official route |
minimax-cn/MiniMax-M3 | MiniMax-M3 only |
zai-coding-cn/glm-5.3 | GLM-5.3 only |
Typical use: append a strict working protocol (verify before claiming, minimal diffs, contract alignment, …) to weaker models, or attach project conventions / output-format requirements to a specific model.
Implementation notes
- Injection is a dynamic section on the
systemPrompt service: the section text is a function evaluated each time the model step is assembled. The runtime assembly context carries the agent, and the target route for this request is resolved with the same precedence the host's model-selection layer uses (UI selection → logged request header → creation-time options; since DSH 0.1.5 agent.options alone is only a creation-time snapshot). Unmatched routes return "", and the renderer drops empty sections (zero cost).
- The section registers at order
9950 (SECTION_ORDER in index.js). That is after every shipped tool / structured-output section, but not the absolute last order on newer hosts, which also register HARNESS_SOURCE = 10000, WEB_SURFACE = 10100, and DEPLOYMENT_PERSONA_SUFFIX = 10200. Raise the constant above those if the text must land after them too.
- Rules are read/written through the plugin's own Typert Remote service (
systemPromptInjector.getState / setRule); the client mounts the namespace itself via ctx.remote.$mount.
Development
npm run check # node --check index.js client.js typert.host.js
Local link: install (the plugin directory must already have node_modules, see AGENTS.md):
npm install --no-save --registry=https://registry.npmjs.org @deepseek-ai/cordis@4.0.2 @deepseek-ai/dsh-typert-protocol@0.1.2-rc.1 zod@4.5.4
dsh plugin --profile web add /path/to/dsh-system-prompt
# restart DSH to take effect
Release
Push a v* tag: .github/workflows/release.yml builds the tgz, publishes a GitHub Release, and publishes to npm through OIDC Trusted Publishing (configure the trusted publisher on npmjs.com first: this repository + .github/workflows/release.yml).
Attribution
dsh-system-prompt is a rebranded derivative of MoonlitDropOfBlood/dsh-model-prompt-injector (MIT © duke). The logic is unchanged; the package name, identifiers (plugin id, service name, section name, persistence directory), repository metadata, UI branding, and documentation were rebranded. The upstream MIT notice is retained in LICENSE.
License
MIT © datawork-technology — see LICENSE.