Introduction

DSH extensions are typically integrated as profile plugins. For developers using DSH Web, prompt drafts in Composer often require further rewriting: making goals, constraints, and context clearer, or adjusting the expression into a form more suitable for the current model request.

Here we introduce dsh-prompt-polish. It is a prompt optimization plugin for the DeepSeek Harness (DSH) input bar. Once installed on the web profile, you can click Optimize in Composer to send the current draft to the model service configured in DSH, view a clearer and more specific version, and decide whether to adopt it.

This plugin does not add a new independent API endpoint, nor does it act as a standalone shell command or a model tool exposed to agents; optimization uses the provider and model currently selected in DSH.

What is this

dsh-prompt-polish is maintained by 1321928757 and targets DSH-compatible Web profiles. It is a browser composer extension that integrates prompt optimization into the Composer-side process: it reads the current draft, requests the model service based on the user’s selected mode, language, custom instructions, and optional context, and displays the original and optimized drafts in a result popup.

The package metadata lists the license as MIT, directly depends on zod ^4.4.3, and lists several peer dependencies.

Core Capabilities

Optimization Entry and Result Confirmation

  • Click Optimize in Composer to send the current draft to the model service configured in DSH.
  • The result popup displays the original and optimized drafts, and provides Adopt optimized result, Keep draft, and Later actions.
  • The result is not automatically adopted; adoption requires explicitly clicking Adopt optimized result.
  • Adoption requires the composer draft to remain exactly the same as when optimized; the adoption button is disabled when the draft changes.
  • Failed results remain visible, displaying the original draft and a Retry action.

Modes, Languages, and Custom Instructions

The plugin provides six prompt rewriting modes:

  • Default
  • Concise
  • Structured
  • Creative
  • Translate and optimize
  • Code request

The plugin provides three language options:

  • Follow draft
  • Chinese
  • English

Explicit language selection is applied after optional custom instructions. Custom instructions are limited to 500 characters and influence optional behaviors.

Session Context

The plugin supports optional injection of current session context:

  • goal
  • todo list
  • compaction summary
  • recent messages
  • short tool result summaries when tool summaries are enabled

Context collection is opt-in and is subject to limits such as message nodes, scroll characters, single message truncation, compaction summary length, number and length of tool-result summaries, and Host context budget; some context may be omitted.

When context is enabled, the request may include recent messages, current goal and todo list, compaction summary, and optional tool-result summaries. The draft and enabled context are visible to the current model provider; privacy and retention policies should be reviewed before sensitive sessions.

Runtime Limits, Cancellation, and History

  • Empty drafts or drafts consisting only of whitespace are rejected; drafts exceeding 20,000 characters are rejected.
  • Stream timeout is 30 seconds without a new chunk or a total of 120 seconds; timeouts return a retryable error.
  • Output limit is 4,000 output tokens, subject to the selected model and remaining context; request minimum is 1,200 tokens, and results may be marked as potentially truncated when the model reaches its limit.
  • The model can be stopped while streaming; when the DSH conversation-block API is available, the composer block is cleared immediately, and late results from a cancelled run are ignored.
  • The plugin maintains a history of the last 5 optimization attempts in the current component’s memory; successful entries can be viewed or explicitly filled back into the composer, while failed entries are retained as failure records.
  • Settings are saved locally and synchronized to the workspace file as best as possible.

UI and Settings Entry

  • The browser UI uses DSH theme tokens, supporting light/dark themes, keyboard focus, Escape/click outside to close, reduced motion, and high contrast borders.
  • Via the gear in Composer, you can view quick settings or full settings for context, tool summaries, mode, and language.
  • In DSH Settings → General, you can see the Reference conversation context switch line; other options remain in composer settings.

Installation and Enablement

First, install to the web profile using the verified v0.3.1 tag:

dsh plugin --profile web add github:1321928757/dsh-prompt-polish#v0.3.1

After installation, restart the existing DSH Web process to allow the plugin to enter the current profile. Then verify the profile composition:

dsh --profile web --dump-config | findstr dsh-prompt-polish

After the steps above, the Optimize button and gear should appear on the left side of the composer after restart. Seeing these two entry points indicates the plugin is loaded into this Web profile.

For updates, use the same add command, replacing v0.3.1 with a newer published tag, then restart that profile.

Typical Usage

First, perform a basic optimization:

  1. Write the draft in Composer.
  2. Click Optimize.
  3. View the original and optimized drafts in the result popup.
  4. If the draft has not changed, click Adopt optimized result to fill it back; otherwise, choose Keep draft or Later.

When you need to adjust behavior:

  1. Open the gear in Composer.
  2. View or switch context, tool summaries, mode, and language settings.
  3. Go back to Optimize, regenerate, and view the result.

To view the global context switch in DSH settings, go to DSH Settings → General and find the Reference conversation context switch line.

Suitable Scenarios and Considerations

Suitable for use in the following scenarios:

  • Writing prompts in the DSH Web Composer, wanting to quickly rewrite, clarify, or adjust expression.
  • Wanting to generate an optimized draft based on current session context, but still adopting the result after manual confirmation.
  • Needing to see failure results, the history of the last 5 attempts, and the ability to stop or retry during the streaming process.

Pre-use considerations:

  • This plugin runs in the plugin environment of the current DSH Web profile and calls the model service configured in DSH. Source code, license, dependencies, and team security policies should be checked before installation.
  • It requires a DSH-compatible Web profile and a configured DSH model provider.
  • Node.js 20 or newer is a prerequisite reported by the installer and DSH setup; this package does not declare an engines field.
  • When context is enabled, the draft and context are visible to the current model provider. Privacy and retention policies of the provider should be reviewed before sensitive sessions.
  • Optimized results require manual confirmation; generated content must still be checked for compliance with the original intent before adoption.

Entry Points

GitHub: https://github.com/1321928757/dsh-prompt-polish

Directory page (task clue provided, not directly confirmed in the scraped package materials): https://www.skillhub.cn/plugins/1321928757/dsh-prompt-polish

The community directory is an independent site and is not equivalent to the official app store.