dsh-prompt-optimizer: An Offline Prompt Optimization Plugin for DeepSeek Harness

Introduction

DeepSeek Harness (DSH) enables developers to extend its capabilities through plugins. When writing prompts, people often start with just a rough, one-sentence idea lacking structured elements such as role, constraints, and output format. Tackling this with model-based optimization would introduce dependencies on API calls, API keys, and network access. dsh-prompt-optimizer adds an offline prompt optimization panel to DSH’s Web/desktop interface, expanding a casual one-liner into a well-structured prompt.

Plugin Overview

  • Name: dsh-prompt-optimizer
  • Maintainer: Zexue (zeyeyuki)
  • Type: DeepSeek Harness plugin (model reasoning category)
  • Core value: A local rule engine running in the browser — no model calls, no network, no key transmission

Core Features

  • Entry point & panel: A new “Optimize Prompt” button appears on the toolbar. Clicking it opens a “Prompt Optimization” page in the right sidebar, leaving the conversation area unobstructed.
  • Task types: Auto / Code / Writing / Analysis / Solution / Image Generation / Roleplay / General. The Auto mode uses keyword and fixed-phrase scoring for identification.
  • Intensity levels:
  • Light: Result-focused only
  • Standard: Adds context, format, and self-check
  • Deep: Further adds fact-vs-inference separation, acceptance criteria, and open questions
  • Result actions: Copy, insert into input box (confirms first if the box already has content), edit, or regenerate with a different phrasing.
  • Local memory: Remembers only the last input and selections; does not save generated results; does not upload any content.

Output Structure

Expanded in a fixed order: Role → Task (preserving the original wording) → Context & Known Information (items marked【To Be Filled】can be skipped) → Specific Requirements → Output Format → Quality Standards (self-check) → Handling Insufficient Information (provide a solution based on reasonable assumptions first, then list items to confirm). Implied constraints in the input—such as word count, format, tone, audience, prohibitions, and mandates—are extracted via regex into explicit requirements.

Installation & Activation

Requires DSH’s Bundles / plugin installation capability (desktop version or dsh CLI).

Method 1: Local directory

git clone https://github.com/zeyeyuki/dsh-prompt-optimizer.git
  • Desktop version: Plugins → Add Plugin, then select the cloned directory.
  • Or within a profile: install the directory path as the target of plugin_manager’s install_bundle.

Method 2: Add to profile
Add "dsh-prompt-optimizer": "file:/path/to/dsh-prompt-optimizer" to the dependencies in $DSH_PROFILE_DIR/package.json, then append the following line to the profile’s cordis.patch.yml:

- insert:
    - id: prompt-optimizer
      name: dsh-prompt-optimizer

After installation, refresh the page (client-side modules load at startup). If the button doesn’t appear, restart the application once.

Typical Usage

  1. On the toolbar to the left of the input box (after the + and mode buttons), click “Optimize Prompt”.
  2. The “Prompt Optimization” page appears in the rightmost sidebar; any existing draft in the input box is carried over.
  3. Type or paste a rough one-line prompt. Select a task type and intensity if needed (the default “Auto + Standard” is usually sufficient).
  4. Click “Start Optimization” — the result appears below; Ctrl/⌘ + Enter also triggers optimization directly.
  5. Use “Copy” to take it away, “Insert into Input Box” to write it back, “Edit” for fine-tuning, or “Rephrase” to get a different set of requirements and closing.

Use Cases & Notes

  • Suited for scenarios where you need to quickly convert casual, colloquial ideas into structured prompts.
  • The plugin runs with the current DSH process permissions. Review the source code and license (MIT) before installing.
  • The plugin does not author content; it only completes structure and constraints. Type identification is heuristic — for edge cases, specify the type manually.
  • The panel uses local localStorage to remember the last input and selections; no content is uploaded.

In Summary

dsh-prompt-optimizer uses a local rule engine to expand rough prompts into structured ones — no API, no keys, no network required. See the GitHub repository for installation and configuration: https://github.com/zeyeyuki/dsh-prompt-optimizer

羽毛球分组比赛记分
小程序二维码

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

Xiaoye