본문으로 건너뛰기
S

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.

설치

dsh plugin --profile web add github:socool666/dsh-global-prompt

README

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.

License: MIT DSH

English · 简体中文


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

  1. Open DSH and go to Settings → Plugins.
  2. Click Add plugin and choose this repository's directory (or a clone of it).
  3. Find Global prompt in the plugin list and make sure it is enabled.
  4. 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 schemastery from DSH's own profile directory, which is a built-in DSH dependency — you do not need to install anything extra.

Usage

  1. Click Settings in the lower-left corner and open General.

  2. Find the Global prompt row.

  3. Type the prompt you want injected, for example:

    Always reply in English. Be concise and structured, and list the key reasons at the end.
    
  4. Click Save. Seeing Saved means it was written successfully.

  5. From then on, every new conversation and subagent includes this text in its System Prompt.

UI states

StateMeaning
Unsaved changesText edited but not saved yet
Saving…Writing the configuration
SavedSaved; effective from the next request
Save failed, retryWrite 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 systemPrompt section named global-prompt:user. Its text is 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 on 0.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.yml is 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

MIT

관련 플러그인