In DeepSeek Harness (DSH), directly inputting vague requirements often makes it difficult to obtain high-quality execution results. DSH Prompt Optimizer is a persistent web plugin designed to rewrite vague requirements into structured, executable super prompts through one-click optimization using the currently selected model.
Core Features¶
This plugin mainly addresses the issue of inconsistent prompt quality. Its key capabilities include:
- One-click optimization and input lock: After clicking the ✨ button, the input box is locked to prevent the optimization result from overwriting content that the user is currently typing. At the same time, the input box displays an animated rainbow gradient border, and the status line above it shows the optimization progress.
- Model reuse: The optimization process fully uses the provider and model already selected by the user in the model selector, requiring no additional configuration.
- Intelligent rewriting strategy: Designed for programming agents, it includes a built-in dual-template adaptive mechanism (content tasks use structured instructions, while execution tasks use Agent execution specifications). It adopts an “exploration-first protocol” and “Skills awareness.” Missing information is not assumed by default; instead, it guides the agent to first inventory its own skills and configuration.
- State visibility: During optimization, the status line above the input box displays “✨ Optimizing (model name).” After completion, it displays “✓ Completed” or “⚠️ Failure reason.”
Installation and Enablement¶
This is a persistent plugin. After installation, it is automatically loaded when the DSH process starts.
dsh plugin --profile web add .
After installation, restart DSH or refresh the page. The ✨ button will then appear on the left side of the input box.
Usage Flow¶
- Enter a vague requirement in the input box (for example: “Help me write a nice-looking homepage”).
- Click the ✨ button on the left side of the model selector.
- Wait a few seconds and observe the input lock, rainbow border, and status line prompts.
- The optimization result is automatically filled into the input box. At this point, you can send it directly to the agent.
Technical Implementation¶
- Frontend interaction: Uses DSH’s
conversation.blocksmechanism to implement input locking and uses CSS animations to create the animated rainbow gradient border. - Backend communication: The host endpoint receives requests through
POST /prompt-optimizer/api/optimize, allowing access only from the local loopback address. It usesllm.streamto invoke the current model and includes a built-in LRU cache and single-flight mechanism to improve performance. - Plugin structure: Mounted through
dsh.bundle.patch, withdsh.clientspecifying the browser-side injection path.
Notes¶
- The plugin is open-sourced under the MIT License.
- The optimization feature is restricted to local loopback access only.
- After installation, you must restart DSH or refresh the page to see the button.
Resource Links¶
- GitHub: https://github.com/xinmo114514/dsh-prompt-optimizer
- Directory page: https://www.skillhub.cn/plugins/xinmo114514/dsh-prompt-optimizer