dsh-prompt-refine: A DSH Plugin That Makes Requirements Actionable

Introduction

When writing prompts in DSH (DeepSeek Harness), a common problem is that user input tends to be brief and colloquial — something like “build me a login page” or “what’s up with this error?” Sending such input directly to the model often leads to output that misses the mark, either lacking specificity or with unclear requirements.

dsh-prompt-refine was built to solve exactly this: it adds a Refine Input button to the left side of the input toolbar. When clicked, it rewrites the draft into a clear, well-structured description that the model can handle correctly in one pass. The result is written back into the input box in place, and the user reviews it before hitting send.

What It Is

dsh-prompt-refine is a DSH plugin maintained by HitMargin, categorized under Model Inference. It does not modify the submission pipeline — it only rewrites the draft at the exact moment the user clicks the button. The rewritten result lands in the input box first, and the user confirms before sending.

Core Features

Rewriting User Input

A Refine Input button appears on the left side of the input toolbar (to the right of the permission control). When clicked:

  1. The button shows a spinner, indicating the rewrite is in progress.
  2. The draft is replaced with the rewritten result, and the button turns green with the label Refined.
  3. Clicking again reverts the change, restoring the original text (as long as the draft is still showing the rewritten result).
  4. If the input box is empty when clicked, the button turns red and displays Input box is empty — no request is sent.

Rewriting examples:

What you typed What appears in the input box after clicking
Build me a login page Create a login page with input fields for username and password and a submit button; validate that all fields are non-empty on submission, displaying a red error message below the field if validation fails; no backend is connected, so simulate a successful login using local state.
What's going on with this error? Explain the meaning and root cause of the following error: first describe what it says, then list the most common triggers, and finally provide a recommended troubleshooting sequence. Do not modify any code — explain thoroughly first.

Preventing the Rewrite from Turning into a Counter-Question

Sometimes the model rewrites the input into a question directed back at the user, for example:

Please tell me what you’d like to optimize — what you want to write, where it will be used, and what form the result should take.

This kind of result overwrites the user’s actual request. If sent as-is, the model will likely respond with something like “This message looks like a template prompt.”

dsh-prompt-refine uses two layers of defense to prevent this:

  1. Prompt-level prohibition — The rewrite instructions explicitly forbid asking questions back, requesting additional information, speaking in an assistant voice (“I can help you,” “Please tell me what you need,” “If you still need more,” “As an AI,” etc.), or outputting meta-language.
  2. Code-level hard block — A prompt alone is not a guarantee, so if the output is detected as a counter-question, the request is retried once with additional hard constraints appended. If both attempts produce a counter-question, the rewrite is marked as failed: the original text is left in the input box as-is, and the button displays the reason in red.

The principle is simple: it’s better to have no refinement than to replace the user’s words with a counter-question.

Style Consistency

The button is intentionally styled to match its sibling controls in the composer toolbar, rather than having its own look. The design spec is taken from .select in dsh-client-ui-conversation/src/client/skeleton/InputBar.module.css (the same class used by the Plan / Read-only / model selector):

Property Value
Height 28px
Font size / weight / line height 13px / 500 / 20px
Padding 0 8px
Border none
Text color --dsw-alias-label-secondary
Hover Only changes background-color; text color is untouched

The detection logic only flags first-person references directed at the user (e.g., “you”), to avoid false positives on legitimate uses of “you” in normal requests — for example, “Add a hint on the login page: tell the user ‘Password is incorrect’ when the password is wrong” would not be flagged as a counter-question.

Customizing the Rewrite Prompt

The rewrite instructions are stored in ~/.dsh/prompt-refine/prompt.md and are auto-generated on the first click. Edits take effect on the next request — no restart needed. Deleting the file and clicking again will regenerate the built-in version.

Installation & Activation

Desktop / Local

Create a Junction in the profile’s directory pointing to the plugin directory:

New-Item -ItemType Junction `
  -Path "$env:USERPROFILE\.dsh\profiles\desktop\node_modules\dsh-prompt-refine" `
  -Target "D:\Projects\dsh-prompt-refine"

Then in the profile’s package.json:

{
  "dependencies": { "dsh-prompt-refine": "link:D:/Projects/dsh-prompt-refine" },
  "dsh": { "profile": { "bundles": [ "…", "dsh-prompt-refine" ] } }
}

Restart DSH after making changes (client bundles are injected at startup).

CLI

dsh plugin --profile web add github:HitMargin/dsh-prompt-refine

Desktop UI

Plugins page → Add Plugin → Enter HitMargin/dsh-prompt-refine in the package name or URL field → Install.

Typical Workflow

  1. Write a brief, casual request in the DSH input box, e.g., “Build me a login page.”
  2. Click the Refine Input button on the left side of the toolbar.
  3. Wait for the spinner; the result is written into the input box and the button turns green with Refined.
  4. Review the rewritten text, then click send when satisfied.

If the rewritten result isn’t satisfactory, click the button again to revert, or manually edit the text in the input box before sending.

Use Cases & Notes

This plugin is suited for scenarios where colloquial, brief requests need to be converted into clear, actionable prompts. The plugin runs with the current DSH process’s permissions — review the source code and license before installing.

This plugin does not touch the submission pipeline. The rewrite only happens at the moment you click the button; the result lands in the input box first, and you review and send it yourself. A similar plugin (e.g., dsh-prompt-hardener) silently rewrites the user message before a turn begins. Both can be installed simultaneously: one handles “how to phrase this more forcefully,” the other handles “how to phrase this more clearly.”

Summary

dsh-prompt-refine provides the ability to directly rewrite a requirement description right in the input toolbar, turning brief, colloquial input into clear, actionable prompts and reducing model output deviation. The result is written back into the input box in place for the user to review before sending — it doesn’t change the timing of submission and doesn’t make decisions on the user’s behalf.

Plugin directory: https://www.skillhub.cn/plugins/HitMargin/dsh-prompt-refine
GitHub: https://github.com/HitMargin/dsh-prompt-refine

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

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

Xiaoye