dsh-enhance-prompt: One-Click Prompt Enhancement Plugin

Preface

When writing Prompts in DeepSeek Harness (DSH), a vague draft often requires repeated iterations to achieve high-quality output. WorkBuddy once provided an “Enhance prompt” feature, but its implementation encapsulated the entire logic in a single RPC call within app.asar, with quality entirely dependent on its internal Prompt. tong174 created the dsh-enhance-prompt plugin, which extracts and rewrites that Prompt to transform a draft into a clearer, more specific task description while preserving the user’s original intent.

Plugin Positioning

dsh-enhance-prompt is a “one-click prompt enhancement” tool for DeepSeek Harness, developed by maintainer tong174, categorized under “Model Inference.” It is a reverse-engineered and benchmarked reimplementation of WorkBuddy’s “Enhance prompt” feature, delivering enhancement capabilities as a standalone plugin.

Core Features

1. One-Click Enhance Button

A “blinking star” button appears on the right side of the DSH composer input field. After entering a draft, the user clicks this button, and the plugin rewrites the draft into a more specific Prompt. Since v0.5.0, the rewrite result is first displayed in a preview panel, supporting streaming output, token-by-token diff comparison against the draft, and an eight-level undo stack. Only after the user clicks “Use it” will the enhanced content be written into the composer.

2. Preview Panel and Undo Stack

The enhanced result is displayed in the preview panel with streaming rendering. Compared to the draft, the plugin marks token-level differences (retained vs. modified vs. added). The undo stack supports up to eight levels, stored in localStorage, allowing users to revert to previous versions.

3. Four Enhancement Modes

Four mode options are available on the chip row:

  • light: Length budget 1.2×
  • standard: Length budget 2.5× (default)
  • deep: Length budget 4×
  • system: Generates a structured system Prompt (no length budget)

enhanced is the legacy name for standard, and workbuddy is the A/B comparison baseline (chip not displayed).

4. Model and Reasoning Effort Selection

The plugin provides a /models endpoint that lists supported provider groups, including some dormant models. Reasoning effort is only sent when the model declares support; if the gateway rejects it, the plugin automatically degrades and retries.

5. Quality Gates

  • Fidelity Guard (fidelityGuard): Before enhancement, fact anchors are extracted from the draft (such as commands, URLs, paths, filenames, version numbers, numbers with units, camelCase/snake_case/CONST_CASE identifiers, @references, and quoted text). After enhancement, each anchor is verified for retention. If any are missing, a repair injection is triggered.
  • Length Guard (lengthGuard): If the rewritten length exceeds the current mode’s multiplier, one convergence adjustment is executed. system and workbuddy modes have no length limit, but all modes enforce a 600-character minimum to ensure execution details are not lost.
  • Language Guard: Rejects flipping a single-language draft into bilingual output.

6. Disable Conditions

When a user attaches @references files to the draft, the enhance button is disabled to prevent silently dropping mounted files.

7. Agent Tool and HTTP API

The plugin exposes an enhance_prompt tool, allowing the model to self-enhance Prompts. It also provides the following HTTP endpoints:

  • /enhance: Synchronous enhancement request
  • /stream: SSE streaming enhancement
  • /models: List available models and groups
  • /info: Plugin information and startup check
  • /report: Enhancement report
  • /selftest: Self-diagnostic test

8. Provider Fallback Chain

Enhancement requests attempt multiple provider routes in priority order. Authentication/balance errors trigger automatic degradation with cooldown on failed routes, and successful routes are recorded for subsequent use.

Installation and Activation

Marketplace Installation

In DSH, navigate to “Plugins → Discover,” search for “Enhance Prompt,” and install (requires the directory to have indexed it).

Manual Installation

  1. Copy the plugin to the target profile:
Copy-Item . -Recurse "$HOME\.dsh\profiles\desktop\node_modules\dsh-enhance-prompt"
  1. Register the plugin in that profile’s package.json:
{
  "dsh-enhance-prompt": true
}
  1. Enable the plugin (no restart required):
plugin_manager set_bundle { "action": "set_bundle", "target": "dsh-enhance-prompt", "enabled": true }
  1. Refresh the browser page (Ctrl+R) to activate the new plugin bundle.

Configuration

All configuration resides in the profile’s cordis.patch.yml plugin section, with defaults provided for all fields.

Field Default Description
promptStyle standard Enhancement style: light / standard / deep / system / workbuddy (baseline)
lengthGuard true Enable length guard
fidelityGuard true Enable fidelity guard
fidelityRepair true Enable fact repair injection
refineMode true Allow the model to transform vague drafts into actionable tasks
contextAware / contextTurns / contextChars true / 6 / 4000 Context awareness: include the last N turns only when the draft is referential
stream true Enable SSE streaming response
provider / model '' Empty value means automatic candidate chain
providerPriority [] List of provider IDs to try first
reasoningEffort '' Reasoning effort; empty value means not sent
maxAttempts 6 Number of candidate routes per enhancement attempt
totalBudgetMs 90000 Wall-clock time limit for the entire chain
maxConcurrency 2 Concurrent enhancement requests; excess returns 429 busy
idempotent true Enable SHA256 caching and single-flight (prevents duplicate clicks from triggering multiple model calls)
temperature 0.3 Model temperature
maxTokens 4000 Reasoning tokens count toward this limit
timeoutMs 60000 Per-route timeout
minTextLength 1 Minimum text length, matching WorkBuddy
maxInputChars 8000 Enhancement rejected beyond this length (returns too_long)
customSystemPrompt / customUserTemplate '' Custom system/user templates; must include {input} placeholder
stripWrappingQuotes / stripCodeFence true Same cleaning logic as the original
announceToAgent / toolsEnabled true Whether to expose the enhance_prompt tool to the Agent
allowRemote false Only allow loopback clients to call the HTTP API
requireHeader true Browser requests must carry x-dsh-enhance: 1
rateLimitPerMinute 30 Per-client token bucket rate limiting
selfTestOnStart false Perform one real model call at startup

Typical Usage

Enter a draft in the composer:

帮我写个爬虫

Click the blinking button on the right, and the plugin rewrites the draft into:

请帮我编写一个网络爬虫程序,并说明目标网站的页面结构与需要采集的字段;
明确采集范围(页面数量、分页规则)、数据输出格式(如 CSV 或 JSON)、
请求频率与并发限制,以及需要处理的异常情况(反爬机制、超时重试、编码问题)。

The rewritten result is displayed token by token with streaming in the preview panel, with clear diff highlighting. Once confirmed, click “Use it” to write the enhanced Prompt into the composer.

Use Cases and Cautions

Use Cases

  • Developers who need to transform vague requirements into specific, actionable Prompts
  • Users who want to leverage WorkBuddy’s “Enhance prompt” capability in DSH but prefer better control
  • Scenarios where enhancement results require quality gates and fidelity validation

Cautions

  • The plugin runs with the current DSH process permissions. Review the source code and license (MIT) before installation.
  • The plugin depends on dsh >= 0.2.1-rc.2 < 0.4.0; version compatibility is required.
  • Setting allowRemote to true opens the HTTP API to cross-site requests; assess the security risk accordingly.
  • HTTP API requests must include the header x-dsh-enhance: 1; otherwise, they will be rejected.

Summary

dsh-enhance-prompt extracts and rewrites WorkBuddy’s Prompt to provide one-click draft enhancement in DeepSeek Harness. With its preview panel, quality gates, multiple enhancement modes, and a complete HTTP API, it is not merely an interactive enhancement tool but can also be embedded into more complex agent workflows. For developers who frequently write high-quality Prompts, it is a plugin worth adding to your toolchain.

  • Directory page: https://www.skillhub.cn/plugins/tong174/dsh-enhance-prompt
  • GitHub: https://github.com/tong174/dsh-enhance-prompt
羽毛球分组比赛记分
小程序二维码

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

Xiaoye