Preface¶
When switching agent presets in DeepSeek Harness (DSH), the system prompt is usually assembled from built-in harness copy and several runtime context segments. If you want a specific session to run entirely on your own system instructions and decide which tools are available yourself, without modifying the preset in the source code, you need a mode that is configurable in the UI and can keep up with changes in the plugin ecosystem. Below is an introduction to the community plugin dsh-custom-prompt-mode (Maintainer: OSHANG-NOVA, Category: Workflow): it adds Custom prompt to the mode list, completely replacing the DSH built-in System Prompt with the text from your settings page, automatically scanning and toggling individual tools already mounted in the current profile, and also supports generating Chinese summaries for tool descriptions using the selected model.
What is this¶
dsh-custom-prompt-mode is a global DSH plugin published on npm (MIT, current version 1.0.0). Its positioning can be summarized as: adding a Custom prompt mode (agent preset id = custom-prompt, order = 12), where the system prompt for sessions in this mode is entirely determined by the text on the settings page, and the DSH built-in System Prompt does not take effect in this mode; the tool list is not hardcoded but is obtained by scanning the runtime registry, then subtracted based on your selections via tools.restrict(). Tools brought by third-party plugins will appear in the list, and English descriptions can be translated to Chinese with the help of the model on the settings page.
Community Directory: SkillHub — dsh-custom-prompt-mode. Source code and detailed documentation: GitHub — OSHANG-NOVA/dsh-custom-prompt-mode. The directory site is an independent ecosystem index and has no official affiliation with DeepSeek / Huanfang.
Core Features¶
Complete Replacement of System Prompt¶
In this preset scope, register the complete segment of deployment:persona-prefix. The assembler restores it to a single prompt segment, avoiding residual text from DSH’s built-in copy. At the same time, suppressRuntimeContext() is called to hide runtime contexts such as sandbox, approval, and delegation; and working-directory:current within this scope is changed to required: false with empty text to avoid the “Current runtime context …” paragraph bleeding through.
After the prompt is saved on the settings page, it takes effect in the next turn of conversation without needing to restart the process: the text in the middle section of persona.js is a function () => prompt.text, which is re-evaluated every time SystemPrompt.assemble() is called. The user text uses interpolate: false to avoid triggering template parsing errors with {{…}} in the prose.
Automatic Tool Scanning and Toggle¶
scanTools() reads {name, description} via ctx.tools.schemas() (no scope parameter, global view) and filters to keep only run_code. The settings page displays them in six groups: file read/write, command execution, internet access, tasks and scheduling, agents and orchestration, and others. The default values are consistent with the minimalist mode: only enabling “view image” and the platform-specific PowerShell persistent or bash persistent shell.
Tools already on the global profile are mounted by bundles like dsh-base; presets can only add layers or mask within their own scope and cannot delete the global layer. Therefore, gate.js executes tools.restrict({ deny }) for unchecked tool names within the preset sub-plugin scope and listens to tools/change to recalculate the deny list when plugins are mounted late. Tool switch changes take effect by unloading and re-registering via agentPresets.register(): ongoing sessions retain the tool set from that time, while new sessions use the new configuration.
This plugin mounts the persistent shell (including dsh-terminal and the platform backend) on its own within the isolate: { terminals: true } group, as this profile does not have a persistent shell mounted globally. One-off dsh-tool-pwsh / dsh-tool-bash are not listed in the scan results because the shell service they depend on is not mounted in this profile. The compaction group always exists (not a tool) and is used for long session summaries.
Tool Description Translation¶
For items scanned that do not match the built-in Chinese text table (about 50 harness tools), you can generate a Chinese summary in the “Tool Description Translation” area using the current profile’s provider and model (llm.listProviders() / llm.listModels()). It supports full translation, incremental translation, canceling, and clearing translations; runs in parallel of 3 streams, 60-second timeout per item, and writes to disk immediately upon completion. Profiles without model routing can still use the mode, with the translation area only indicating no available routes.
Settings Persistence and Web API¶
Configuration is written to custom-prompt-mode.json in the profile directory, with fields including text, tools, translations, and updatedAt. Items not appearing in tools are considered disabled; unknown tool names are preserved to avoid losing selections if a plugin fails to load. Directory resolution order: profileContext.dir → DSH_PROFILE_DIR → $DSH_HOME/profiles/$DSH_PROFILE (default ~/.dsh/profiles/web).
The browser reads/writes snapshots, resets, triggers translations, etc., via GET/POST /custom-prompt-mode/api; the routes carry the same loopback / same-origin fence as dsh-preset-studio, used to reduce DNS rebinding and CSRF risks, rather than for authentication.
Installation and Enablement¶
Choose any installation method; after installation, restart DSH once (ESM is cached by URL). New sessions can select Custom prompt from the mode list.
Install from npm (Recommended):
plugin_manager install_bundle target=dsh-custom-prompt-mode
Install from source directory:
plugin_manager install_bundle target=<absolute path to this repository>
The plugin runs with the permissions of the current DSH process. Before installing, please review the repository source code and the MIT license yourself to ensure it meets your security and compliance requirements.
Typical Usage¶
-
After installing and restarting DSH, create a new session and select Custom prompt from the mode list (sessions that have already started are restricted by
agent-preset/lockedand require a new session to change modes). -
Open Settings → Custom prompt, edit the full system prompt, and check/uncheck tools as needed (select all / deselect all is available). After saving, the next user message will use the new prompt and tool set.
-
If English tools from third-party plugins appear in the list, select the provider and model in the translation area and perform full or incremental translation; you can cancel while in progress, and completed translations will be preserved in
translations. -
When you need to restore the default prompt and default tool switches, initiate
{ reset: true }via the API or settings page (this does not clear stored translations).
Configuration example (excerpted from README):
{
"text": "Your system prompt...",
"tools": { "read_image": true, "bash": true, "pwsh": true, "edit": false },
"translations": { "ppt_themes": "List the built-in visual themes in dsh-ppt..." },
"updatedAt": "2026-01-01T00:00:00.000Z"
}
Applicable Scenarios and Notes¶
Suitable for: Developers who need fixed role/process instructions but don’t want to fork the preset; scenarios where the tool set should change dynamically with installed plugins and be finely toggled in the UI; experimental or deployment environments that need to downplay the default DSH runtime instructions and only retain custom system text.
Notes:
- Global plugin: Install once, and Custom prompt will be visible in the mode list for all sessions.
- You need to restart the DSH process after modifying the plugin source code; HMR is not enabled for the root module in this profile (the
hmrline indsh-baseisroot: []). - Translation consumes model quota; summary quality depends on the selected model and the quality of the English description.
Conclusion¶
dsh-custom-prompt-mode incorporates “custom system prompt + dynamic tool gate + optional translation” into a global mode for workflows, suitable for quickly customizing agent personas and capability boundaries under DSH’s premise of “everything is a plugin”. For further details, see the repository README and DEVELOPMENT.md; for index and introduction, see the SkillHub directory page.