dsh-prompt-reforge: Refine Drafts into More Precise Prompts in the DSH Input Field

Preface

When writing prompts in DeepSeek Harness (DSH), a common practice is to type a rough draft into the input box first, then manually polish it, add constraints, and adjust the structure. The draft and the final prompt often undergo several rounds of revision; if edited too heavily, you may need to retrieve the original text from memory or elsewhere. The DSH community plugin dsh-prompt-reforge (maintainer: Cloud017, Category: Model Reasoning) turns this step into a control on the input area toolbar: it uses the model already selected in the current session to rewrite the draft into a more specific and usable prompt, with support for one-click restoration of the text before rewriting.

The following introduces its positioning, interaction methods, installation steps, and boundaries to be aware of during use.

What is this

dsh-prompt-reforge is a Composer control plugin for DSH. It attaches to the input box toolbar, right next to the model selector, without opening an additional panel or pop-up; the rewriting result is written directly back to the input box you are editing.

Rewriting requests go through the provider / model already routed by the local Harness, and the draft is not sent to any service outside the plugin. The plugin only adds a host registration and a toolbar button, without altering your model routing, provider configuration, or default model.

Core Features

Reforging and Restoration on the Toolbar

Toolbar schematic (from the project README):

[ + ]  [ permission ]            [ ✨ ]  [ ▾ model ]
                                   │
                                   └─ press to reforge, press again to revert

Depending on the state, the button will be in stages such as unavailable, ready to reforge, reforging, or ready to restore. The main behaviors summarized in the README are as follows:

Situation Behavior
Input is empty Button is unavailable, tooltip prompts to write content first
No model selected Unavailable, prompts to select a model first
Model list failed to load Still clickable, clicking retries loading
Draft contains reference chips Unavailable, chips must be removed first (rewriting will lose chips)
Ready Clickable, starts reforge
Reforging Shows progress state, clicking again cancels
Reforge complete Draft is replaced, the same button becomes “Restore Original”
Continue typing after reforge Backup is discarded to avoid silently overwriting your new edits
You keep typing during reforge Result is discarded and explained via tooltip
Failure Draft remains unchanged, tooltip gives the reason

Server-side and Browser-side Division

Two parts inside the package work together:

  1. Host half (lib/index.js): Registers POST /plugins/dsh-prompt-reforge/enhance on the Harness Web service. It validates requests, calls the model routed to the current session via ctx.llm.stream(), and returns normalized text. It rejects non-loopback requests; the request body limit is 256 KiB, and the draft limit is 20,000 characters; the call is aborted if the browser disconnects or after 60 seconds.
  2. Browser half (lib/client.js): Registers the control to the conversation.input.right slot, maintains the button state machine, calls the above route via fetch, and writes the result back via Composer’s inputActions.insertText; if the editor API is unavailable or rejects editing, it falls back to inputActions.setDraft.

Rewriting is written as a whole insertText to facilitate a single-step undo; when the response arrives, it reads the current draft using a ref, and if it differs from what was sent, it discards the result to avoid overwriting content being typed.

Request Conventions (Excerpt)

Example request body for POST /plugins/dsh-prompt-reforge/enhance:

{ "draft": "rough text", "provider": "workbuddy", "model": "deepseek-v4.1-flash", "sessionId": "session-…" }

Success: 200 { "ok": true, "text": "…" }. Failure: { "ok": false, "error": { "code": "…", "message": "…" } }. Common status codes include 400 (empty draft, missing provider/model, etc.), 403 (untrusted source), 413 (too long), 499 (aborted), 502/503/504 (upstream or timeout), etc. See the project README table for details.

Installation and Activation

In the DSH ecosystem, third-party plugins can be installed via the plugin manager or GUI. The community directory site dsh-prompt-reforge page on SkillHub and the GitHub repository are public sources and are not officially affiliated with DeepSeek / Hiai.

Plugin Manager

Install by package name:

plugin_manager action=install_bundle target=dsh-prompt-reforge

Or specify a release archive (README example is v0.2.2):

plugin_manager action=install_bundle target=https://github.com/Cloud017/dsh-prompt-reforge/releases/download/v0.2.2/dsh-prompt-reforge-0.2.2.tgz

Or point to a local directory:

plugin_manager action=install_bundle target=<absolute path to this directory>

There is an alias dsh-prompt-reforge.tgz on the same release track; you can replace the fixed version URL with .../latest/download/dsh-prompt-reforge.tgz to track the latest package.

GUI

Path: Plugins → Add plugin → Install third-party plugin. Paste the package name, release URL, repository URL, or local directory, then restart DSH.

After installation, dsh.profile.bundles will add a bundle record. The current package version is 0.2.2 (see package.json), License MIT © Cloud017.

Compatibility

The engines.dsh requirement is: >=0.2.1-rc.1 <0.3.0-0 || >=0.2.2-0 <0.3.0-0 (the README explains the reason for the prerelease interval notation). @deepseek-ai/* type peer dependencies are declared as optional within the package and provided by the Harness composition; if missing, functionality degrades rather than directly crashing the client.

Typical Usage

  1. Select provider and model for the current session in DSH (rewriting uses this pair, consistent with the assistant you are about to chat with).
  2. Write a rough draft in the Composer input box; if reference chips are attached, remove them before rewriting.
  3. Click the reforge button (✨) on the toolbar. You can click again to cancel while waiting.
  4. If satisfied, send the chat directly; if not satisfied, click the same button again to restore the original text, provided you have not continued editing it significantly.
  5. If you continue editing the input box after rewriting is complete, the original backup is discarded. At this point, do not expect “Restore” to overwrite your new content—this is a deliberate design to avoid silently swallowing edits.

No configuration file is needed by default. If you want to fork and adjust limits, the README lists constant locations: MAX_DRAFT_CHARS (20,000, host and client must match), MAX_BODY_BYTES (256 KiB), MAX_TOKENS (2048), TIMEOUT_MS (60,000), prompt-side LENGTH_BUDGET (800 characters), etc., located in lib/index.js, lib/client.js, and lib/prompts.js respectively.

Use Cases and Notes

Who it is for: Developers who frequently write long prompts in DSH and want to quickly “compress the structure” using the currently selected model; those who need a panel-free, in-place, undoable prompt polishing workflow.

Permissions and Security: The plugin runs with the current DSH process permissions, and the host route will call the local LLM runtime to process your draft. It is recommended to read the repository source code and MIT license before installation; although only enhance requests from loopback are accepted, you should still install third-party bundles in environments you trust.

Limitations: Drafts with reference chips cannot be rewritten; drafts exceeding 20,000 characters will be rejected; rewriting depends on model output, and the original text remains unchanged upon failure.

Conclusion

dsh-prompt-reforge consolidates “Draft → More precise prompt → One-click restoration” into the Composer toolbar. Rewriting and chatting share the same session model, and interaction states are fully documented in the README. For further information, please visit the SkillHub Directory Page and GitHub: Cloud017/dsh-prompt-reforge.

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

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

Xiaoye