Tools & Capabilities
dsh-prompt-inject
h1a3x/dsh-prompt-inject · ★ 1
System prompt injection template manager for the DeepSeek Harness web UI.
安装
dsh plugin --profile web add github:h1a3x/dsh-prompt-injectGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
For install and environment setup, plus plugin development tutorials, see DSH community docs ↗
README
简体中文 | English
A system-prompt template injection manager for the DeepSeek Harness web GUI.
Maintain named prompt templates under Settings → Plugins → Prompt Template Injection, and inject the selected template into the system prompt of every session. One global default plus an independent template per workspace — selection is all it takes (no separate on/off switch), and a change applies to the very next message.
Features
- 🗂️ Named templates: add, edit, delete, and preview any number of prompt templates
- 🌐 Global + per-workspace: one global default; each workspace can independently choose Inherit global / No injection / a specific template
- ⚡ Instant effect: the template variable is resolved at every assembly, so a mid-session switch applies to the next message and new sessions pick it up automatically
- 🧩 System-prompt injection: order 50 (after the deployment persona, before tool guidance)
- 🌍 Bilingual UI: card copy follows the Harness UI locale (zh / en)
- 🎨 Theme-aware: UI uses Harness theme CSS variables (light / dark)
Install
npx dsh-prompt-inject install
The installer is idempotent and performs two steps:
- Installs the package to
$DSH_HOME/profiles/node_modules/dsh-prompt-inject(the dsh plugin resolution root) - Writes the composition row into
$DSH_HOME/profiles/<profile>/cordis.patch.yml
Then restart dsh and refresh the browser. The restart is the only manual step — the host module and composition are cached in-process.
From source
git clone https://github.com/H1a3x/dsh-prompt-inject.git
cd dsh-prompt-inject
node scripts/install.js --from . --force
Options
| Option | Meaning |
|---|---|
--profile <name> |
Target profile (default web) |
--force |
Overwrite an already-installed package |
--from <path> |
Install from a specific directory (defaults to the package root) |
Usage
After installing and restarting, open Settings → Plugins → Prompt Template Injection:
- Click Add template and enter a name and prompt text
- Pick a Global active template (used by any workspace without an override)
- In Per-workspace overrides, assign a workspace its own template, or choose No injection
- Each template row has a Preview button to inspect its text
Selection is all it takes — there is no separate switch. A change applies to the next message, and new sessions inherit it automatically.
Workspace matching keys on the host-side realpath-canonical path, which is the same source as an agent session's
cwd, so they correspond one-to-one.
How it works
lib/index.js host half: settings namespace + systemPrompt variable/section + /prompt-inject routes
lib/client.js browser half: settings card (shell module-table format, no build step)
scripts/install.js one-shot installer
Injection uses systemPrompt.variable() + systemPrompt.section(): the section text is fixed at {{dsh_prompt_inject_text}}, and the variable provider reads the current settings plus the agent's workspace at every assembly, returning the template text that workspace should receive.
Plugin loading contract:
package.jsondeclaresdsh.client.platform = "web"andinjectdependencies; the host scanner builds awindow.__DSH_BOOT__graph row and serves/plugins/<id>/client.js- The browser half is bundled in the shell module-table format; its factory returns
{ apply, inject } - The UI registers through
ctx.slots.inject('settings.plugin.item', …) - Hot-reload boundary:
lib/client.jschanges take effect on page refresh;dsh.clientdeclaration changes need a dsh restart
Uninstall
Delete $DSH_HOME/profiles/node_modules/dsh-prompt-inject and remove the following lines from cordis.patch.yml, then restart dsh:
- insert:
- id: prompt-inject
name: dsh-prompt-inject
You can also keep the row and disable the plugin from the Harness settings plugin inventory.
Development
npm run check # syntax check
npm run install:local # local install verification
License
MIT © H1a3x