Introduction¶
The design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” In practical development, writing clear prompts often requires repeated polishing. The dsh-prompt-optimizer plugin aims to solve this problem. It adds an icon button to the input toolbar in the DSH Web interface, uses the currently active model to optimize the entered content, and automatically fills the optimized result back into the input box.
Plugin Positioning¶
This is a DSH Web plugin maintained by wmengxiang under the MIT License. Its core purpose is to add an interactive entry point to the input toolbar row in a Web profile. By calling the current default model, it rewrites user-entered prompts to make them clearer and more specific.
Core Features¶
- One-click optimization: Click the button to trigger the optimization workflow without manual copying and pasting.
- Intent and language preservation: The optimization process only improves clarity and specificity; it does not change the original task intent or language style.
- Interactive feedback: The button displays a tooltip on hover. During optimization, the button icon changes to a rotating loading state, and a progress bar appears at the bottom.
- Empty-content protection: When the input box is empty, the button is automatically disabled to prevent accidental operations.
- Streaming generation: The backend reads model output through
ctx.llm.streamto enable streaming backfilling.
Installation and Enablement¶
Install the plugin using the DSH CLI:
dsh plugin --profile web add "github:wmengxiang/dsh-prompt-optimizer#main"
After installation, restart the Web interface. The plugin is automatically loaded as part of the bundle. If you encounter SSH permission issues with the GitHub source, consider installing from a local path or publishing it to npm first.
Usage Steps¶
- Enter a prompt in the input box.
- Click the icon button on the left side of the input toolbar row (hover to see the “Optimize Prompt” tooltip).
- Wait for optimization to complete. The content in the input box will be automatically replaced with the optimized result.
- Continue the interaction using the optimized prompt.
How It Works¶
The plugin consists of Host and Client halves.
- Host half (lib/index.js): Registers the POST /api/prompt-optimizer route, receives the input text, calls the current default model, reads the result as a stream through ctx.llm.stream, and returns it.
- Client half (lib/client.js): Registers through window.__ModuleLoader__.load, injects an icon button into the conversation.input.left slot, reads the draft content, calls the API, and writes the result back through props.inputActions.setDraft.
Notes¶
- The plugin uses the currently active default model for optimization. Switching models in the interface changes the model used for optimization.
- If installing from a
github:source, pnpm uses the SSH protocol by default, so ensure that a GitHub SSH key is configured. If not configured, install from a local path or publish to npm and install from there instead.
Summary¶
This plugin provides DSH Web users with a convenient method for prompt optimization. By using streaming generation and good interactive feedback, it improves the efficiency of writing high-quality prompts in the Web interface. For more details, see the GitHub repository.