Introduction¶
The DSH ecosystem emphasizes “everything is a plugin”. For agent developers, a practical problem is: user drafts or one-shot task inputs need optimization, but you don’t want to directly invade the agent loop. Below is an introduction to lizhecome/deepseek-harness-prompt-optimizer. It is an installable DeepSeek Harness profile bundle that uses a single auxiliary LLM request to rewrite or supplement the prompt.
What is it¶
First, let’s clarify the positioning: it is maintained by lizhecome, the package name is @lizhecome/dsh-prompt-optimizer, the version is 0.2.0, and the license is MIT.
It solves the core problem: adding an optional prompt optimization for direct user messages without modifying the agent loop. The Web side provides a sparkle button next to the send control; the Host side can automatically optimize direct user messages in the agent/pre-step waterfall; the Host also exposes the /optimize-prompt <prompt> operation.
Core Capabilities¶
Here are the main behaviors of the plugin.
- Web Button: Provides a sparkle button next to the send control. Upon clicking, it executes an auxiliary request and replaces the unsent draft.
- Auto Optimization: The Host plugin can automatically optimize direct user messages in the
agent/pre-stepwaterfall. - No modification to agent loop: Optimization happens before sending or before the step, rather than patching the main loop.
- Delivery Mode: Supports
appendandreplace.appendkeeps the original content and adds the optimized text;replaceonly delivers the optimized text. - Routing Resolution: The optimization route is resolved based on the configured
provider/model, the session’s last routing request, or the agent’s explicitprovider/modeloptions. - Failure Preservation: When the user is editing, during transmission, routing, or model failure, the draft is preserved, and the failure is placed in the button’s accessible status and tooltip.
- One-time Bypass: If the button’s successful result is sent without modification, it triggers a one-time exact match bypass, not triggering a second optimizer request.
- Pass-through: Multimodal and mixed-block direct user messages pass through as-is.
Installation and Removal¶
This plugin requires DeepSeek Harness 0.1.0-rc.6 or higher.
First, clone the repository, then enter the directory, and install via the web profile:
gh repo clone lizhecome/deepseek-harness-prompt-optimizer
cd deepseek-harness-prompt-optimizer
dsh plugin --profile web add --ignore-workspace-root-check .
After the steps above, the Web UI will have the sparkle button next to the send control.
If you wish to enable auto optimization for one-shot tasks, use the headless profile instead of the web profile. The send control button is only available in the web profile.
If you need to remove it:
dsh plugin --profile web remove --ignore-workspace-root-check @lizhecome/dsh-prompt-optimizer
Configuration¶
Configuration items include:
provider
model
maxTokens
minChars
delivery
failureMode
instruction
provider and model are atomic pairs. Partially configured routes, non-integer boundaries, or empty instruction will fail at plugin load time.
maxTokens is the output limit for the auxiliary call; responses reaching the limit are rejected as incomplete.
delivery can be append or replace.
failureMode can be pass-through or fail. turn cancellation always propagates.
The optimization routing is resolved in the following order:
- Configured
providerandmodel. - Session’s last routing request.
- Agent’s explicit
provider/modeloptions.
If no available route can be resolved, it falls into failure handling.
Typical Usage¶
Web Button¶
In the web profile, clicking the sparkle button next to the send control triggers an auxiliary request and uses the result to replace the current unsent draft.
If the user continues editing during optimization, the response is not applied, and the current draft is preserved. If transmission, routing, or model fails, the draft is also preserved, and the failure is placed in the button’s accessible status and tooltip.
If the button’s returned result is sent without editing, it triggers a one-time exact match bypass; if the result is modified before sending, the exact match condition is no longer satisfied.
Host Operation¶
The Host exposes the same operation:
/optimize-prompt <prompt>
This operation is used to trigger optimization for a given prompt.
One-shot Tasks¶
For one-shot tasks, using the headless profile instead of the web profile enables auto optimization. The send control button is only provided in the web profile.
Model and Cost Impact¶
First, regarding request count: each qualified automatic optimization adds a separate model request; clicking the button also adds a request; sending button results without modification does not trigger a second optimizer request.
Next, regarding persistence: the auxiliary model interaction is not stored as a separate model event; button results enter the durable command lifecycle, and auto-delivered results enter the main turn.
The delivery method also affects the main request: append preserves the original prompt and adds optimized text; replace only preserves the optimized text.
Applicable Scenarios and Notes¶
Suitable scenarios for using this plugin:
- Manually optimizing drafts before sending in the DSH Web UI.
- Automatically rewriting direct user messages before
agent/pre-step. - Needing to keep the agent loop unchanged while adding a configurable optimization point.
Points to note:
- Prompt optimization is semantic model output and may still distort intent; use
appendpreferentially when auditing. - Multimodal and mixed-block direct user messages pass through as-is.
- The plugin runs with the current dsh process permissions. Check the source code and license before installing.
- This project is licensed under MIT, the package name is
@lizhecome/dsh-prompt-optimizer, and the version is0.2.0.
Conclusion¶
Through the introduction above, the value of DeepSeek Harness Prompt Optimizer is clear: it provides a lightweight, configurable, non-intrusive entry point for prompt optimization, suitable for adding a single auxiliary rewrite to a DSH workflow.
Related links:
- GitHub: https://github.com/lizhecome/deepseek-harness-prompt-optimizer
- Directory link: https://www.skillhub.cn/plugins/lizhecome/deepseek-harness-prompt-optimizer
This directory page is an independent site link and has no official affiliation with DeepSeek / Hypothesis.