Preface¶
When writing Composer sessions in DeepSeek Harness (dsh), drafts tend to be colloquial and lack structure, often requiring several rounds of revision to look decent. Products like WorkBuddy have built-in “prompt optimization” in the input area, while the dsh desktop client lacks an equivalent entry by default. The community plugin dsh-prompt-polisher (maintainer yuluo554) adds an “Optimize Prompt” button to the toolbar of the chat input box: it reads the current draft, rewrites it via a model, and writes the result back, still allowing further editing or restoration. The following covers its capabilities and boundaries in terms of installation, configuration, and daily usage.
What Is This¶
dsh-prompt-polisher is a desktop plugin for the dsh web profile, with the npm package name dsh-prompt-polisher, current version 0.2.0 (MIT). In classification it belongs to “model inference”: the core is handing the input box draft to a model for rewriting, rather than modifying conversation routing or the tool chain.
The interaction form mirrors WorkBuddy’s built-in prompt optimization; the button icon is self-drawn. The plugin mounts onto conversation.input.right via a Cordis patch, and provides status and restore entries in conversation.input.dock.
Core Features¶
One-Click Optimize and Restore¶
After clicking the button, the flow is: read the current draft → model rewrite → write the result back to the input box. The original text is saved in the plugin state, and the status bar provides two entries:
- Restore last step: return to the draft before this optimization.
- Restore first: return to the draft you hand-typed before the first optimization of this session.
Dual Model Paths¶
By default it uses the session model: leveraging the agent() single agent of the dsh workflow engine, available with zero extra configuration. After installation, the plugin enables the workflow engine (workflow-ptc) from the web profile’s default disabled state, which is the prerequisite for the session model path.
You can also configure an OpenAI-compatible standalone API (Base URL, model, key) in settings. When enabled and fully configured, optimization prefers the standalone API; when disabled or unconfigured, it uses the session model. API call failures do not silently degrade to the session model; the interface shows an error, based on which you can switch back to the session path. Keys are stored only on the host side and are never sent to the browser.
Style Presets and Custom Templates¶
Two built-in styles are available, switchable in the menu next to the button; the choice is written to localStorage as the default:
concise: concise and clear.structured: structured enhancement.
In settings you can fill in a full custom template for each style; it must contain the {draft} placeholder; invalid templates automatically fall back to the built-in prompts.
Race Protection and Reference Safety¶
If you continue typing while an optimization request is in progress, a “Replace / Discard” prompt appears before writing back, avoiding silent overwriting of new input. Switching conversations automatically cancels in-flight requests.
When the draft contains @ or / references (reference chips), optimization is disabled, because rewriting would break the reference markers. Optimization is also disabled when the draft has fewer than 8 characters after trim.
Installation and Activation¶
Requires dsh ^0.2.0-rc.1 (0.2.x, including pre-releases); the threshold is expressed via peerDependencies in package.json, and dsh will refuse to load it if not satisfied. Versions verified in the README: 0.2.0-rc.1, 0.2.1-rc.2; 0.3 is not within the support scope of this version.
Run the official install command in the terminal:
dsh plugin --profile web add dsh-prompt-polisher
The plugin runs with the permissions of the current dsh process. Before installing, it is recommended to read the GitHub repository source code and the MIT license to confirm it meets your environment policy.
Configuration¶
Path: Web Settings → Plugins → Prompt Polisher. All fields are volatile; after modification they take effect immediately without restart (configuration is read fresh on each optimization).
| Field | Description |
|---|---|
| Enable standalone API | When on, optimization prefers the standalone API; when off/unconfigured, uses the session model |
| API Base URL | OpenAI-compatible endpoint, default https://api.deepseek.com (auto-appends /chat/completions) |
| API Key | Leave the password field blank to keep the stored value; stored on the host side, stripped across wires |
| Key env var name | Fallback credentials, default DEEPSEEK_API_KEY (credentials service → process environment) |
| Model | Default deepseek-chat |
| Custom template ×2 | Override the built-in concise / structured prompts; must contain {draft} |
| Client diagnostic reporting | Reports browser-side plugin failures to host logs (never leaves this machine), enabled by default |
Typical Usage¶
- Open a Composer session in the dsh web interface and write your draft in the input box (no
@//references, and at least 8 characters after trimming). - Click “Optimize Prompt” in the toolbar; if needed, select
conciseorstructuredfrom the menu next to the button. - Wait for the rewrite to complete, check the filled-back content, then continue editing or send.
- If you modified the input while optimization was in progress, choose “Replace” or “Discard” in the dialog.
- For the standalone API: enable “Enable standalone API” in settings, fill in the Base URL, model, and key (or configure an environment variable), save, then click optimize again.
For non-loopback connections (remote access to the local GUI), configuration runs in memory mode and cannot be persisted.
Use Cases and Cautions¶
Suitable for: developers who frequently write long prompts in dsh, want to quickly organize tone and structure, and are already using the dsh 0.2.x web profile.
Cautions:
- Style presets, error codes, and template ids form a frozen contract; currently there are only two levels:
concise/structured. - Drafts with reference chips or too short cannot be optimized; you need to remove the references or complete the content first.
- The community catalog SkillHub plugin page and the GitHub repository are maintained by the community, with no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem philosophy is “everything is a plugin”, so please evaluate the trust boundary yourself before installing third-party plugins.
Links¶
- Community catalog: https://www.skillhub.cn/plugins/yuluo554/dsh-prompt-polisher
- Source code and README: https://github.com/yuluo554/dsh-prompt-polisher