dsh-prompt-enhancer: The Prompt Enhancer Wand in Composer

Preface

When writing Composer drafts in DSH, one often encounters unclear expressions or incomplete constraints. RooCode provides an Enhance Prompt (✨ wand) button in the top-right corner of the input box: it reads the current draft, runs a separate LLM rewrite, and replaces the content in place without sending it. The DSH community plugin dsh-prompt-enhancer (maintainer misaka15527, version 0.1.3, MIT) offers similar functionality in the Composer toolbar. By default, it uses zai / glm-5.3-flash, but the model and template can be changed in the plugin settings card.

The following sections cover its positioning, behavior, configuration, and installation. Facts are based on the GitHub repository README; the community directory can be found at the SkillHub plugin page (no official affiliation with DeepSeek or High-Flyer).

What is this

dsh-prompt-enhancer is the DSH equivalent of RooCode’s Enhance Prompt: it adds a ✨ control to the Composer toolbar (between the model selector and the send button). It performs a side-channel LLM call on the current draft, replaces the result in place, and supports one-click undo; it will never send messages for you.

Entry Point and Behavior

  1. Entry Point: The ✨ control on the Composer toolbar (conversation.input.left slot, list position).
  2. Flow: Read current draft → Perform a side-channel call using the host’s ctx.llm.stream() (purpose: 'prompt-enhancer', no tools, single turn) → Replace the draft in place via inputActions.setDraft(text).
  3. Empty Draft: Only prompts “Write a draft first before clicking ✨”; does not send or modify content.
  4. Undo: The plugin retains a snapshot from before the rewrite and provides an “Undo” button. If the draft is edited after the rewrite, the undo becomes invalid and prompts a message to avoid overwriting new input (this is not the editor’s native Ctrl+Z stack).
  5. Reasoning Content: The protocol layer only accumulates text-delta; reasoning-delta is always discarded to prevent reasoning blocks from leaking into the final Prompt (addressing a class of known issues found on the RooCode side).

Models and Templates

The default rewrite uses provider zai and model glm-5.3-flash. Models that “always think” like glm-5.3-flash require configuring reasoningEffort (low / high / max), defaulting to low; leaving it empty means the option is not included in the request at all. Requests will retry with step-by-step downgrading based on {source, effort}, so switching to a model that doesn’t support a certain tier should not cause an error.

The default enhancement template is identical to RooCode’s and can be modified in settings. If the template does not contain ${userInput}, the draft will be appended to the last line, ensuring the input is not lost:

Generate an enhanced version of this prompt (reply with only the enhanced prompt - no conversation, explanations, lead-in, bullet points, placeholders, or surrounding quotes):${userInput}

Settings items are .volatile(): changes take effect the next time you click ✨ after saving, without needing to restart the app (this differs from the host/client assembly required after installation; see the installation section below).

Configuration Items (Plugin Settings Card)

The following fields can be modified in the sidebar under Plugins → dsh-prompt-enhancer:

Field Default Description
enabled true If disabled, clicking ✨ returns “Disabled” immediately without sending a request
provider zai Provider used for rewriting
model glm-5.3-flash Model used for rewriting
reasoningEffort low Reasoning level; empty = do not send this option
template See above Enhancement template (${userInput} placeholder)
maxTokens 2048 Output limit for a single rewrite (string, for form convenience)
timeoutMs 45000 Timeout is treated as cancellation, and the UI resets

If editing long templates in the card is inconvenient, you can directly modify the profile’s patch/json.

Installation and Activation

The plugin must appear in both the profile’s dsh.profile.bundles and dependencies; if bundles is missing, it will not be mounted. The Windows example flow provided in the README is as follows (it is recommended to back up profiles\desktop\cordis.patch.yml before use):

# 1) Clone to local-plugins under the main DSH directory for unified management
git clone https://github.com/<you>/dsh-prompt-enhancer.git $env:USERPROFILE\.dsh\local-plugins\dsh-prompt-enhancer

# 2) Install into the profile using the official CLI (forwarded to pnpm)
& 'F:\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd' plugin --profile desktop add `
  "$env:USERPROFILE\.dsh\local-plugins\dsh-prompt-enhancer"

Manual method: Add "dsh-prompt-enhancer": "file:../../local-plugins/dsh-prompt-enhancer" to dependencies in profiles\desktop\package.json, and add "dsh-prompt-enhancer" to the end of dsh.profile.bundles. Then run pnpm install in the profile directory.

After completing the dependency assembly, restart the desktop application (both the host and client assemble at startup). Open any conversation, and the ✨ should appear on the input toolbar; modify provider / model / reasoningEffort in the plugin card as needed.

Typical Usage

  1. Write a first draft in the Composer (task description, constraints, output format, etc.).
  2. Click ✨ in the toolbar, wait for the side-channel rewrite to complete, and the draft will be replaced with the enhanced version.
  3. If not satisfied, click “Undo” to restore; if satisfied, review it yourself before sending (the plugin will not send it for you).
  4. Adjust template or the model in the plugin card; after saving, click ✨ again to test with the new configuration (the test area is simply clicking ✨ directly).

Security, Boundaries, and Unsupported Features

  • The endpoint POST /dsh-prompt-enhancer/enhance consumes tokens and includes a browser trust barrier: non-loopback Host, Sec-Fetch-Site: cross-site, or an Origin different from Host will return 403. If the host provides connection.requestRejection, it is delegated, and exceptions are treated as rejections (fail closed).
  • Only accepts POST; request body ≤ 256 KB, draft ≤ 20,000 characters, otherwise 400.
  • Not yet supported: Context enhancement with conversation history (RooCode’s “Include task history”); also does not write to conversation audit events (the README mentions referring to the official dsh-session-title-llm’s session/title-llm-request approach).

Use Cases and Notes

Suitable for DSH users who need to quickly polish or structure prompts before sending, while wanting to isolate the rewrite from the main conversation and use a dedicated model. The plugin runs under the permissions of the current DSH process. Before installation, please review the source code and LICENSE yourself to ensure the endpoint and token consumption are acceptable.

Uninstallation: Remove dsh-prompt-enhancer from dsh.profile.bundles and dependencies and restart; the plugin does not write independent state files.

Conclusion

dsh-prompt-enhancer implements the RooCode-style “single-turn side-channel enhancement + in-place replacement + undo” directly in the DSH Composer toolbar. It defaults to zai / glm-5.3-flash, with configuration centralized in the plugin card. For further details and installation information, see GitHub and the SkillHub directory page.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye