dsh-prompt-optimizer: One-click optimization of prompt drafts in the input box

Preface

When writing prompts in DSH, a common practice is to edit them elsewhere and paste them back, or ask the model in conversation “help me clarify this text” — which adds an extra round trip, and the result doesn’t necessarily land directly in the input box. If you want to use the model selected in the current session, optimize the draft at the bottom of the input box and write it back, while retaining restore and style options, you can install the community plugin kee0012/dsh-prompt-optimizer (a client-side plugin). Below is an introduction to what it does, how to install it, how to use it, and the permissions and limitations to be aware of before installation.

What Is This

dsh-prompt-optimizer is a DSH prompt optimization plugin: it registers a compact ✨ button in the toolbar at the bottom of the conversation input box (to the left of the model selector); clicking it uses the large model selected in the current conversation to optimize the draft in the input box and writes the result back directly. Style, context, restore, and other settings are collected in the ▾ popover to the right of ✨. The maintainer is kee0012; the source code and documentation are available in the GitHub repository, and the community directory page is the SkillHub entry. The current plugin version is 0.3.1, licensed under MIT.

Core Features

The following capabilities are derived from the repository README and implementation notes.

  • One-click optimization: Just click ✨; it automatically reads the current draft and current model (including provider / model / reasoningEffort), optimizes according to the active settings, and writes the result back to the input box.
  • Uses the current model: No need to configure a separate model for optimization; it follows the model selection in the current session.
  • Optimization styles: Choose from three options — Concise / Standard / Detailed — switchable in the ▾ popover; the choice is remembered across sessions (localStorage).
  • Restore original: Before applying, the original text is backed up to localStorage; when a backup exists, a small dot appears at the right edge of the ✨ group, and you can select “↩ Restore original” in the ▾ popover.
  • Preview confirmation: You can change the apply mode to “Preview confirmation”, comparing the original text with the optimized result before writing it in.
  • Overwrite protection: When applying directly, if the draft has been modified during the request, it automatically switches to a preview dialog instead of overwriting the new input.
  • Context awareness: You can enable “Context” so optimization references the most recent messages in the current session.
  • Stable output: The server fixes temperature = 0.4.
  • Failure notification: If the request fails or the model returns nothing, an error toast appears next to the button, and the button’s title retains the error message.
  • Compact UI: The ✨ + ▾ controls are approximately 50px wide, with all settings in the popover.

The server registers a same-origin HTTP route POST /dsh-prompt-optimizer/optimize, which only accepts requests from the local UI on the same origin (otherwise 403), with a request body limit of 1 MiB; the request body only passes fields such as provider, model, text, style, and does not touch credential files. The client is mounted in the conversation.input.right slot.

Installation and Activation

The plugin is hosted on GitHub and is not published to npm; DSH supports installation via git dependencies. The command provided in the README is as follows.

# Install from GitHub (recommended, for daily use; pulls the latest commits from the default branch)
dsh plugin --profile desktop add github:kee0012/dsh-prompt-optimizer

After installation, you need to restart DSH for the new server code and client bundle to take effect.

Compatibility: Works with both the desktop version and dsh web.

Typical Usage

  1. Type or paste a prompt draft into the input box.
  2. Directly click the ✨ icon to the left of the model selector.
  3. Wait for the current model to return; the optimized result is automatically written into the input box (the original text has been backed up).
  4. To restore: click ▾ next to ✨ → “↩ Restore original”.
  5. (Optional) Click ▾ to expand settings: switch optimization style, enable “Context”, switch to “Preview confirmation”, or restore defaults; these options are remembered across sessions.

The system prompt instructs the model to first analyze the literal meaning, true intent, role, task, context, audience, input, constraints, output format, and ambiguity points, then rewrite the draft — the specific wording is assembled by the plugin server, and users only need to choose the style and whether to include context.

Use Cases and Considerations

Who it’s for: People who frequently write long prompts in the DSH input box, want to quickly polish them using the currently selected model and write them back, and need restore or preview capabilities.

Quality and duration: Optimization quality depends on the currently selected model; optimization is a full-text rewrite, so the longer the draft, the longer it takes (limit 1 MiB).

Restore limitations: “Restore original” relies on localStorage and is only valid within the same browser and the same session; it cannot be restored after clearing site data or switching devices.

Security and trust: The plugin runs with the permissions of the current dsh process; before installing, it is recommended to review the source code (src/index.js, client/client.js) and the MIT license to confirm that the routes and data flow comply with your environment policies. Issues and suggestions can be submitted via GitHub Issues.

The DSH ecosystem emphasizes “everything is a plugin”; community directories such as SkillHub are independent sites and have no official affiliation with DeepSeek / Hithink RoyalFlush. This article introduces a community-maintained client plugin, not an official app store entry.

Conclusion

dsh-prompt-optimizer condenses “optimize the draft with the current model and write it back to the input box” into a ✨ + ▾ next to the input bar: one-click optimization for daily use, with advanced options for style, context, and preview, and localStorage-based restore support. See the installation command above; for details and updates, refer to the repository.

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

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

Xiaoye