DeepSeek Harness Plugin: Prompt Optimizer

Preface

When using DeepSeek Harness (DSH), draft text in the input box is often casual, for example, “help me optimize that thing and make it look better.” This kind of description is not clear enough, making it difficult for the model to generate high-quality responses. The plugin uses prompt engineering rules to rewrite vague drafts into prompts with clear objectives, specific constraints, and verifiable acceptance criteria, and directly replaces the input box content.

What It Is

This is a zero-dependency prompt optimization plugin designed for DeepSeek Harness.

  • Plugin name: dsh-plugin-prompt-optimizer
  • Maintainer: LiWenzhuo001
  • License: MIT
  • Core value: One-click rewriting of input box drafts into clear, verifiable prompts.

Core Features

The plugin provides three usage modes, all of which support automatic fallback to a local deterministic rule engine when the model is unavailable.

  1. One-click rewrite: Click the “Optimize Prompt” button in the input box toolbar to directly rewrite the draft.
  2. Slash command support:
    • /optimize <prompt>: model rewriting.
    • /optimize --analyze <prompt>: local diagnosis, analyzing structure, vague expressions, and redundancy.
    • /optimize --offline <prompt>: local rule rewriting without invoking the model.
  3. Model tool support: The Agent can invoke the optimize_prompt (rewriting) and analyze_prompt (diagnosis) tools.
  4. Automatic fallback: When the model is unavailable or fails, it automatically switches to the built-in deterministic rule engine for rewriting.

Installation and Enabling

Before installing, ensure the environment meets the dependency requirements: Node.js >= 22 and DeepSeek Harness >= 0.2.0-rc.2.

Run the following command in the terminal to install:

dsh plugin --profile desktop add dsh-plugin-prompt-optimizer

After installation, you must completely quit and restart the DSH application for the plugin to take effect. Newly installed bundles are loaded only at startup.

Typical Usage

1. Input Box Button

On the left side of the DSH input box toolbar, click the “Optimize Prompt” button. The button automatically changes state based on the draft content (idle, in progress, rewritten, error), and the rewritten result directly replaces the input box content.

2. Slash Commands

Enter the following command in the conversation:

  • Rewrite:
    /optimize <original prompt>
  • Local diagnosis (analysis only, without consuming model resources):
    /optimize --analyze <original prompt>
  • Offline rewrite (using local rules):
    /optimize --offline <original prompt>

3. Model Tools

In the Agent configuration, directly invoke the model tools:
* optimize_prompt: Rewrites the prompt into a clearer version.
* analyze_prompt: Analyzes the structure and compliance of the prompt, and returns a score and issue list.

Notes

  • Architecture isolation: The browser-side UI does not make model calls and only sends POST requests; model calls and rule engine logic are located on the Host side. This ensures a small browser bundle size (about 17KB) and prevents meaningless events from appearing in the conversation flow.
  • Version compatibility: The rule engine only serves the Host and is not included in the browser bundle.
  • State management: If you manually edit the draft after rewriting, the restore button is automatically invalidated.

Conclusion

Prompt Optimizer is a lightweight auxiliary tool that combines the rewriting capability of an LLM with a local rule engine to solve the problems of vague prompts and difficulty in reuse. For developers who need to quickly build high-quality prompts, this is a plugin worth enabling in your Profile.

  • Catalog page: https://www.skillhub.cn/plugins/LiWenzhuo001/dsh-plugin-prompt-optimizer
  • GitHub repository: https://github.com/LiWenzhuo001/dsh-plugin-prompt-optimizer
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye