dsh-prompt-enhance: One-Click Prompt Rewriting Next to the Composer Input Box

Introduction

When writing tasks in DeepSeek Harness (DSH), a common practice is to type a brief requirement into the input box and expect the model to flesh out the structure itself. This approach often lacks goals, constraints, and acceptance criteria, causing the first response to go off track. Opening a separate conversation specifically to “write prompts” consumes extra context and requires an additional model call.

Below is an introduction to the community plugin dsh-prompt-enhance (maintainer xiex16070-jpg): It registers an “Enhance” chip at the bottom of the conversation input box, to the left of the model selector. Using the provider/model already selected in the current session, it rewrites your draft into a clearer, actionable prompt and writes it back to the input box—without sending a new message or writing to the conversation history.

The DSH ecosystem follows the “everything is a plugin” philosophy; the SkillHub directory page is a community site and has no official affiliation with DeepSeek or HFTC (High-Flyer). Before installing, please review the GitHub source code and the MIT license yourself; the plugin runs under the permissions of the current dsh process, and rewrite requests will invoke the LLM via the host.

What is this?

dsh-prompt-enhance is categorized as a “Model Inference” related plugin (directory description: One-click prompt enhancement for the DeepSeek Harness composer). The current npm package version is 0.1.1, requiring DSH >=0.2.0-rc.1 and Node >=22.19.

Its positioning can be summarized as: it is not a separate “prompt assistant” conversation, but rather an in-input-box editor—it structures the meaning you have already written (goals, constraints, context, deliverables, acceptance criteria), preserving proper nouns, paths, commands, and version numbers verbatim as much as possible; background information supplemented by the model must be marked as “Assumption: …”.

Core Features

Chip and Slot near the Input Box

The chip is registered via the official DSH slot conversation.input.right (conversation scope, list type, capable of coexisting with other plugins), defaulting to the left of the model selector. If the current shell does not declare this slot, the plugin will detect conversation.composer.dock, conversation.input.left, and conversation.input.dock in order of priority, using the first available slot; you can see a log similar to [prompt-enhance] chip seated in conversation.input.right in the console.

Three Trigger Methods

  1. Single click on the “Enhance” chip: Rewrites the input box draft according to the current default mode and writes it back.
  2. “▾” to the right of the chip: Select a mode and rewrite immediately. Modes listed in the README include: structured, concise, detailed, translate-en, spec.
  3. Slash command: Execute /enhance <your prompt> in the conversation. The result is returned as a command reply and does not modify the input box, suitable for pure keyboard operation.

After a successful rewrite, the chip briefly displays “Enhanced” and provides a single “Undo” option (the original text is stored only in page memory and disappears upon refresh). On failure, it expands a panel to explain the reason and provides a copy option if necessary.

Host and Browser Division of Labor

  • Host side (lib/index.js): Registers the HTTP route prompt-enhance/*, calls ctx.llm.stream to perform the rewrite, reads/writes configuration, and registers the /enhance command.
  • Browser side (lib/client.js): Registers the UI chip, reads/writes the input box draft; the rewrite itself is completed via a same-origin, document-relative path POST prompt-enhance/rewrite (to avoid failure of root absolute paths during sub-path deployments).

The rewrite uses the current model obtained via ctx.agentDefaultModel.currentSelection(), without additional key configuration or switching of the billing model.

Configuration (Optional)

The default path for user configuration is ~/.dsh/prompt-enhance/config.json (can also be located via $DSH_HOME); it is re-read on every request, so changes take effect without restarting DSH. Common fields include:

Key Default Meaning
enabled true If disabled, rewrite returns disabled
mode structured Default rewrite mode
language auto auto / zh / en
temperature 0.3 Temperature for rewrite tasks
timeoutMs 45000 Timeout per request
maxDraftChars 8000 Refuse if draft exceeds length (no silent truncation)
maxOutputChars 12000 Discard if output exceeds length

Example:

{
  "mode": "spec",
  "language": "zh",
  "temperature": 0.2,
  "maxDraftChars": 4000
}

Installation and Activation

DSH plugins are installed as npm packages into a profile (default directory ~/.dsh/profiles/<name>/, common local profile name is desktop) and registered in the profile’s dsh.profile.bundles.

Recommended: Install from GitHub using official commands (README warning: Packages with the same name on the npm registry may point to someone else’s repository; do not install by writing the package name only):

# Install from GitHub repository (Recommended)
dsh plugin --profile desktop add github:xiex16070-jpg/dsh-prompt-enhance

# Install from local directory (for development; use file: for local development, use link: with caution)
dsh plugin --profile desktop add file:~/code/dsh-prompt-enhance

# Uninstall
dsh plugin --profile desktop remove dsh-prompt-enhance

dsh plugin add installs the package into the profile’s node_modules (internally using pnpm) and writes it to bundles. The package’s cordis.patch.yml is automatically stacked with the bundle, so generally there is no need to manually modify the profile’s cordis.patch.yml.

Restarting DSH is mandatory after installation: The host side registers routes at startup, and the browser side registers slots when the page loads.

To temporarily disable it, set disabled: true for the corresponding id in ~/.dsh/profiles/desktop/cordis.patch.yml:

- id: prompt-enhance
  disabled: true

Typical Usage

  1. Write a brief requirement in the Composer input box, e.g., Help me write a crawler, needs to be fast.
  2. Ensure a usable provider/model is selected in the current session.
  3. Click “Enhance”, or select a mode like “Spec” first and then rewrite.
  4. Check the structured prompt written back; if satisfied, send it as usual; if modified incorrectly, click “Undo” to restore the original text.

Keyboard flow example: Directly input /enhance Help me write a crawler, view the rewrite result in the command reply, then paste it yourself or continue editing.

To verify successful loading (README suggestion):

  1. Check if the “Enhance” chip appears on the action row of the input box in a new conversation.
  2. Execute in the browser console: fetch('prompt-enhance/health').then(r=>r.json()), expecting a response like {ok:true, value:{enabled:true, model:"…", llm:true}}.
  3. Try /enhance Help me write a crawler, the rewrite text should appear in the command reply.

Health check route: GET prompt-enhance/health; Rewrite: POST prompt-enhance/rewrite, body format like { draft, mode?, locale? }.

Use Cases and Notes

Suitable for: Developers who are already using the Composer in DSH to write tasks, wish to organize drafts into structured prompts before sending, and are willing to use the current session model for one additional rewrite call (still not occupying conversation turns or writing to history).

Notes:

  • Rewriting goes through the host LLM and is subject to the current model’s capabilities, timeout (default 45s), and draft/output length limits; empty drafts, drafts containing the plugin delimiter <<<Draft Start>>>, or no model selected will be rejected with an error.reason according to the README.
  • Reading and writing Composer drafts relies on heuristic adaptation for the Lexical editor (explained in the README’s “Known Boundaries” section); extreme UI or DOM structure changes may cause “rewrite successful but write-back failed”, in which case the result will appear in the error panel for copying.
  • Although the plugin is classified as model inference, it is essentially a prompt editor; please read the source code and permission boundaries before installing or enabling it. Do not blindly add third-party bundles to unauditable profiles.

Conclusion

dsh-prompt-enhance converges “a random requirement” into “a sendable structured prompt”, integrated next to the input box and model selector, and uses the session’s own model to complete the rewrite, avoiding context pollution. For details, complete API, and error code descriptions, please refer to the repository README.

  • Directory Page: https://www.skillhub.cn/plugins/xiex16070-jpg/dsh-prompt-enhance
  • GitHub: https://github.com/xiex16070-jpg/dsh-prompt-enhance
羽毛球分组比赛记分
小程序二维码

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

Xiaoye