dsh-prompt-studio: Multi-Style Optimization and Pre-send Automatic Rewriting

Introduction

Chatting with models in DSH often starts with a casual draft: lacking background, constraints, or acceptance criteria. Completing these details one by one is time-consuming, and it’s easy to forget items until after hitting send. Common workarounds include copying the text to external tools for revision and pasting it back, or piling generic rules into the system prompt—the former disrupts the workflow, while the latter lacks specificity for the “current message.”

Below is an introduction to dsh-prompt-studio (Prompt Optimization Workshop): a DeepSeek Harness plugin that integrates “Rewrite Prompt by Style” into the input box and the sending pipeline. It supports one-click previews of rewrite results and automatic optimization on the host side before sending, while keeping the original wording in the conversation history.

What is this

  • Repository: zywnb-2/dsh-prompt-studio
  • Maintainer: zywnb-2
  • Category: Model Inference (Community Directory Classification)
  • Version: 1.0.0 (MIT)
  • Positioning: Applies selected styles to “casual one-liners” and rewrites them into prompts that models can get right in one attempt. Styles can be added, deleted, or modified in the settings page; 7 styles are built-in.

The plugin consists of a host pane (configuration, model invocation, agent/pre-step) and a browser pane (input box controls, settings page). Both optimization paths share the same optimizePrompt() implementation.

Core Features

One-click Input Box Optimization

An entry ✦ Optimize › is added to the right side of the conversation input box, before the send button. Upon expanding the panel, you can:

  1. Select a style (single select, icon + name per row)
  2. Fill in “Additional requirements for this session” (optional)
  3. Toggle “Auto-optimize before sending” and “Reference project conversation”
  4. Click “Start Optimizing”—the draft is replaced by the rewritten result; if it fails, an error is reported in the panel without destroying the original draft.

After successful optimization, ↩ Undo appears next to the entry, allowing you to revert to the original text before the rewrite. Undo is only valid when “Rewritten, not yet sent, and input box is not empty”; the state is cleared after sending or clearing the input box to prevent accidental restoration of already-sent content.

Auto-optimization before Sending

When “Auto-optimize before sending” is enabled, every send will rewrite the content sent to the model according to the selected style; the conversation history will still display your original wording. The implementation is hooked into the host agent/pre-step waterfall, completing the rewrite before the model request is submitted. If auto-optimization fails, it sends the original draft and logs a warning in the host logs, without blocking the current conversation turn.

Settings Page: Style Library and Optimization Parameters

Path: Settings → Prompt Workshop.

  • General: Auto-optimize before sending, Auto-optimization style, Default input box style, Show input box entry, Keep one-click undo, Optimization model (default follows current default model), Temperature, Max output tokens.
  • Style Library: Each entry contains Name, Icon, Description, and “Optimization Instructions”; supports enable/disable, sorting, copying, deleting, adding, and restoring built-ins.
  • Optimizer Prompt: The framework shared by all styles, supporting {{styleName}} and {{styleInstruction}} placeholders.

Configuration is written to $DSH_HOME/prompt-studio/config.json (not written in the package directory to avoid upgrade overwrites). Modifying styles or toggles takes effect immediately upon saving; changing host code requires restarting DSH, while changing client code requires refreshing the page.

Built-in Seven Styles (Summary)

Style Usage
Light Polish Fix typos, word order, and colloquialisms, preserving original meaning and length.
Structured Requirements Specification: Goals / Background / Constraints / Deliverables / Acceptance Criteria.
Step Planning Execution plan with dependencies and checkpoints.
Domain Expert Supplement terminology, implicit constraints, and boundaries.
Visual Style Enhancement Composition, materials, atmosphere, etc., for image / 3D / UI tasks.
Acceptance Criteria Supplement verifiable definitions of done while retaining original requirements.
Hard-core Direct, mobilizing tone, preserving facts from the original draft.

Project Context (Optional)

The “Reference project conversation” option in the panel and settings controls whether to read the existing conversation in the current project as 【Reference Context】 during optimization. There are budget and filtering rules (e.g., number of recent messages, single message word limit); if the conversation cannot be read, it silently degrades to the no-context path, consistent with behavior when not enabled. Enabled by default.

During rewriting, shared rewriting constraints (keep short requests short, preserve negations and scope, do not fabricate, etc.) are appended after the user-saved base prompt, completing within the same model call without extra rounds of model invocation.

Installation and Activation

System Requirements (as stated in README): Windows 10/11; DSH Desktop version 0.2.0-rc.2; requires internet connection to install from GitHub; no separate Node installation required at runtime (plugin uses Node built-in modules). macOS / Linux compatibility has not been declared as tested in the documentation.

This package has not yet been published to npm; please do not fill in only dsh-prompt-studio in the “Package name or address”.

  1. Open Settings → Plugins → Add Plugin
  2. Paste into “Package name or address” (Keep #v1.0.0):
github:zywnb-2/dsh-prompt-studio#v1.0.0
  1. Click “Install”, and after application: applied appears, Restart DSH (Host pane new code requires a full restart to load).

Installation location example: %USERPROFILE%\.dsh\profiles\<profile>\node_modules\dsh-prompt-studio\ (if DSH_HOME is set, it corresponds to profiles under it).

Method B: Command Line

dsh plugin --profile desktop add github:zywnb-2/dsh-prompt-studio#v1.0.0

If a specific DSH version does not recognize add, you can switch to install.

Upgrade: Uninstall the old version via the plugin page, reinstall using the new tag, and restart DSH. Directory page: SkillHub Plugin Entry.

Typical Usage

Edit, Review, then Send

  1. Write a draft in the input box, e.g., a one-line image generation request.
  2. Click ✦ Optimize › and select “Visual Style Enhancement” or “Structured Requirements”.
  3. Optionally fill in “Additional requirements for this session” and click “Start Optimizing”.
  4. Confirm the rewritten result; if unsatisfied, click ↩ Undo or select another style to retry.
  5. Send normally once satisfied.

Auto-optimize before Sending, Keep Original in Records

  1. Enable “Auto-optimize before sending” in the panel or Settings → Prompt Workshop.
  2. Set the “Auto-optimization style”.
  3. Every subsequent send: The model receives the rewritten version, but the conversation list still shows the original text you input.

Custom Styles

Add a new entry in Settings → Prompt Workshop → Style Library, fill in “Optimization Instructions”; adjust the global framework in “Optimizer Prompt”. Built-in styles can be restored with one click after being deleted.

Use Cases and Notes

Who it’s for: Developers who frequently write requirements, modify prompts in DSH, and want to avoid switching to external tools; those needing structured specifications, step plans, acceptance criteria, or visual prompt expansions.

Architecture and Isolation (Documentation Notes): Zero runtime dependencies; does not rely on other plugins; configuration and namespace carry the prompt-studio / dsh-ps- prefix. Optional services (such as locale, remote) degrade defensively when missing, avoiding dragging down sibling plugins due to assembly failures.

Security and Trust: The plugin runs with the current DSH process privileges, and optimization requests will call your configured model Provider; please read the Source Code and LICENSE before installing to ensure the rewrite content and context reading scope meet your compliance requirements. The community directory SkillHub is an independent site and has no official affiliation with DeepSeek / High-Flyer.

Version Binding: Prompt Workshop 1.0.0 corresponds to DSH 0.2.0-rc.2; switching to other DSH versions may cause failures due to interface changes.

Conclusion

dsh-prompt-studio integrates “Multi-style Rewriting” into the input box and pre-sending pipeline: one-click optimization facilitates previewing, automatic optimization facilitates daily sending without distorting original records, and the style library and optimization framework can be maintained long-term in the settings page.

  • Directory Page: https://www.skillhub.cn/plugins/zywnb-2/dsh-prompt-studio
  • GitHub: https://github.com/zywnb-2/dsh-prompt-studio
  • Installation Spec: github:zywnb-2/dsh-prompt-studio#v1.0.0
羽毛球分组比赛记分
小程序二维码

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

Xiaoye