- Início
- Plugins
- Desenvolvimento e ferramentas de plugins
- dsh-global-prompt
dsh-global-prompt
socool666/dsh-global-prompt
Global prompt (全局提示词) plugin for the agent runtime (DSH). Set it once in Settings → General; injected via ctx.systemPrompt.section() into every new conversation and subagent. Live save, no restart, no context bloat.
Instalar
dsh plugin --profile web add github:socool666/dsh-global-promptREADME
dsh-global-prompt
A global prompt plugin for DeepSeek Harness (DSH). Write a prompt once in Settings; every new conversation and subagent gets it in its System Prompt automatically.
What it does
This is a DeepSeek Harness plugin. It adds a Global prompt section with a textarea and a Save button under Settings → General. Whatever you save is injected as a System Prompt section into every new conversation and subagent you create afterwards.
If you have instructions that should apply to every chat — tone, language, output format, a role — you no longer need to paste them each time or bury them in one conversation. Set them once and they apply globally.
Features
- Global: applied to new conversations and subagents automatically.
- No context bloat: injected via
ctx.systemPrompt.section(), never appended to conversation history; your old turns do not repeat it. An empty prompt costs no context at all. - Live: takes effect on the next request after saving — no DSH restart, and already-finished turns are untouched.
- Native UI: registered in the General settings page and uses DSH theme tokens, so it follows light/dark themes.
- Stable: uses only React from the browser module table and official Host services — no removed client-runtime modules, so no module-table errors.
- Persistent: stored in the active profile, intact across restarts.
Installation
Option 1: Plugin Manager (recommended)
- Open DSH and go to Settings → Plugins.
- Click Add plugin and choose this repository's directory (or a clone of it).
- Find Global prompt in the plugin list and make sure it is enabled.
- Go to Settings → General to find the Global prompt row.
Option 2: From source
git clone https://github.com/SOCOOL666/dsh-global-prompt.git
Then pick the cloned dsh-global-prompt directory in the Plugin Manager.
Option 3: npm / local package
npm install -g dsh-global-prompt
# or install a packed tarball
npm install -g ./dsh-global-prompt-1.0.0.tgz
Then enable the plugin in the Plugin Manager.
Note: a local-directory install is a linked install. The plugin resolves
schemasteryfrom DSH's own profile directory, which is a built-in DSH dependency — you do not need to install anything extra.
Usage
-
Click Settings in the lower-left corner and open General.
-
Find the Global prompt row.
-
Type the prompt you want injected, for example:
Always reply in English. Be concise and structured, and list the key reasons at the end. -
Click Save. Seeing Saved means it was written successfully.
-
From then on, every new conversation and subagent includes this text in its System Prompt.
UI states
| State | Meaning |
|---|---|
| Unsaved changes | Text edited but not saved yet |
| Saving… | Writing the configuration |
| Saved | Saved; effective from the next request |
| Save failed, retry | Write failed (for example, the profile config is not writable) |
Turning injection off
Clear the textarea and click Save. While it is empty the plugin stays registered but injects nothing, costing no context.
How it works
- On the Host side, the plugin registers a global
systemPromptsection namedglobal-prompt:user. Itstextis a function: every time DSH assembles a System Prompt (including for subagents), it reads the latest saved text. - Saving uses
settings.update()to write this plugin's slice of the profile config. The fields are declared.volatile(), so a save updates the value in place without remounting the plugin. - The Client reads and saves through the same-origin HTTP endpoint
/global-prompt/api, which only accepts loopback addresses. - The UI uses only React from the browser module table and DSH theme tokens. It imports no Harness Client packages, avoiding module-table errors caused by client-runtime changes.
Compatibility
- Target DSH version:
>=0.2.0-rc.1(developed and verified on0.2.2-rc.3) - Host services used:
systemPrompt(required),webServer,settings/configEditor(optional injection) - Node.js:
>=18
Troubleshooting
- No input box in Settings: make sure the plugin is enabled; if just installed, refresh the page.
- Save fails: check that the active profile's
cordis.patch.ymlis writable; managed profiles may forbid config edits. - New conversations lack the prompt: this plugin only affects conversations and requests created after saving; existing ones are never rewritten. Also confirm the text is not empty.
Development
npm run check # syntax check
npm run pack:check # preview the packed file list
License
Plugins relacionados
deepseek-harness
deepseek-ai/deepseek-harness
dsh-market
dsh-market/dsh-market
dsh-web (dsh-plugin-manager)
zhu1090093659/dsh-web
dsh-web
zhu1090093659/dsh-web