dsh-prompt-enhancer: Think Through the Problem, Then Craft Clear Prompts

Preface

In DeepSeek Harness (DSH), before sending a message, many users habitually drop a colloquial draft into the input box and expect the model to fill in the context itself. There are quite a few “prompt enhancement” plugins of this type, most of which produce a rewritten prompt as their core output. While the quality of the rewriting can be very good, “facts, inferences, assumptions, and unknowns” are often mixed together, and in multi-turn conversations, the entire text is easily regenerated every time.

shiliumu/dsh-prompt-enhancer (maintainer: shiliumu, Category: Workflow) is a dual-engine plugin for the DSH Web UI: one pipeline handles structured rewriting of drafts and directional decision-making, while the other uses a Situation Model as its core to transform a one-sentence idea into a result that is auditable, comparable, and iterable. There are at least 11 plugins with the same name in the ecosystem; according to the repository description, the maintainer read through the complete source code of 27 peers to identify the differences—this plugin treats “thinking the problem through clearly” as a first-class citizen, where rewriting is merely one of the outputs. The current version is v0.3.0, licensed under MIT, and uses only official slot extension points without modifying DSH source code.

What is this

The plugin package name is @linxin666/dsh-prompt-enhancer, requiring DSH engine >=0.2.0-rc.1. The Host side provides HTTP routes, and the browser side injects React components via official slots; model calls go through the provider already configured by the host, without hardcoding token limits. If the body is empty due to max-tokens truncation, it automatically retries once with a larger quota.

The two engines can be understood separately:

  1. Prompt Enhancer: Colloquial draft → multiple structured candidates + direction options for pending points → Adopt and write back to the input box.
  2. Advisor Direction Engine (v0.3): One sentence (e.g., a decision-making question) → Situation Model (Intent, Facts/Inferences/Assumptions/Unknowns, Key Contradictions, Directions, Recommendations, etc.) → An indented tree is one of the model’s views, supporting incremental updates for further research and manual review.

Core Features

Prompt Enhancer (Input Box Side)

  • Entry Point: Registered at the official slot conversation.input.right (right side of the input box tool row, left side of the model selector). The shortcut Ctrl+Shift+Enter is equivalent to the button.
  • Candidate Panel: Registered at conversation.input.dock (the full row above the input card). After generation, it displays multiple candidates; the header allows viewing the current model, and clicking allows switching the model to immediately regenerate based on the same draft.
  • Model Selection Strategy: Prioritizes models with flash in their id/name, and prefers the current default provider; if there is no flash model, the candidate area becomes a model list, selectable via number keys (remembered until the session is restarted).
  • Pending and Decision (v0.2.0): For places where the model should not decide for you, besides <To Confirm: ...>, it provides 2–4 Direction Options, each with a one-sentence “Effect” description; the candidate card displays Pending N / Decided N/N. Tab switches focus between selecting candidates and deciding directions.
  • View Direction Map: The header button “View Direction Map” expands an indented tree, juxtaposing the directions and consequences of each pending point, with the current selection highlighted; collapsed by default.
  • Adoption: Uses the official inputActions.setDraft(text) to replace the entire draft and enters the undo stack (Ctrl+Z to revert). Inline placeholders are replaced in place; new constraints without corresponding placeholders are appended to the end of the text under 【Supplementary Requirements】.
  • Generation Constraints: Only performs structured completion; prohibits fabricating files, errors, or requirements; preserves @references, /commands, paths, and original error text.

Advisor Direction Engine (Host API)

  • POST /prompt-enhancer/advisor: Input text, mode (e.g., decision), optional resume: true for continued research—carrying over the previous model, marking invalidation judgments, and updating incrementally rather than regenerating the entire block.
  • Valid Output: When information is insufficient, it can return “No Recommendation at This Time” along with up to three questions to confirm; facts and inferences are forced into a four-part split (Fact / Inference / Assumption / Unknown), each with source and confidence; the Situation Model also includes fields for Key Contradictions, Directions, Recommendations, etc., and includes tree view nodes (with attributes like Type / Source / Confidence / Impact / Status).
  • POST /prompt-enhancer/review: Manual “Review”, where the reviewer checks fidelity, hallucinations, directional differences, and conditions for turning, item by item.
  • Failure Handling: Distinguishes between “reasoning-only” output and “completely blank”, and can automatically pop up a model switch selection; failed drafts are preserved as is.

Differences from Common prompt-enhancers (Summary)

Dimension Common Implementations This Plugin
Core Output Rewritten Prompt Situation Model + Rewriting Output
Multi-turn Often regenerates entire block Incremental updates for continued research
Indented Tree Hierarchical List Situation Model View, nodes with multi-attribute badges
Insufficient Info Forces a conclusion Can return “No Recommendation” + ≤3 questions

For a full comparison, see docs/peer-landscape.md in the repository.

Request and Security Boundaries

Prompt Enhancement:

POST /prompt-enhancer/enhance
Content-Type: application/json

{
  "text": "Draft",
  "provider": "tokenrhythm",
  "model": "deepseek-v4-flash-0731",
  "sessionId": "…",
  "count": 3,
  "direction": "Optional: Rewriting angle"
}

On success, returns candidates (including text and gaps direction options); error codes include reasoning-only, empty-output, etc. Only accepts local origins; request body limit is 256 KB, draft limit is 6000 characters, single call timeout is 90 seconds.

The Host does not require the model to output JSON but uses line-delimited DSL (e.g., 【Candidate】, 【Pending】 sections) to reduce the probability of invalid JSON from flash models. See the GitHub README for routing and DSL details.

Installation and Activation

The installation method provided in the official README is to execute a PowerShell script in the local terminal (you need to run it yourself due to sandbox/permission reasons; standard PowerShell, no administrator required). The example path is based on the documentation; if your Desktop profile is different, specify it with -ProfilePath.

cd C:\Users\ROG\dsh-workspace\dsh-prompt-enhancer
powershell -ExecutionPolicy Bypass -File .\install.ps1

The script will: Create a junction pointing to the plugin directory under the profile’s node_modules\@linxin666\; Idempotently append a registration section to cordis.patch.yml (backed up as cordis.patch.yml.bak-prompt-enhancer); Write the package to the dependencies in the profile’s package.json (the Desktop plugin graph is derived from dependencies; it will not load if only patched without registering the dependency); and perform a Node self-check.

After installation, completely exit and restart DeepSeek Harness Desktop (Desktop profile has no patchReload, so it does not hot-reload). The enhancement button should appear on the right side of the input box in any session.

Other profile examples:

powershell -ExecutionPolicy Bypass -File .\install.ps1 -ProfilePath "C:\Users\ROG\.dsh\profiles\desktop"

Uninstallation:

powershell -ExecutionPolicy Bypass -File .\uninstall.ps1

Does not delete the plugin source code directory, only removes the junction, patch section, and package.json dependency.

Real-machine Verification without Restarting the App (Optional)

powershell -ExecutionPolicy Bypass -File .\verify-live.ps1

The script temporarily creates a pe-verify profile, starts a one-time DSH host, checks configuration dump, Host routes (405/400/404), browser-side button DOM, and end-to-end button candidate generation, number key write-back. It deletes the temporary profile by default; -KeepProfile and -Port can be used according to the README.

Typical Usage

The following workflow comes from the interaction diagram in the README (troubleshooting crawler disconnections), to facilitate comparison with UI behavior.

  1. Write a colloquial draft in the input box, e.g.: Help me see why this crawler keeps disconnecting.
  2. Click the enhancement button on the right side of the input box, or press Ctrl+Shift+Enter.
  3. In the dock candidate box: ↑/↓ to switch candidates, 1–3 or Enter to adopt; ←/→ to switch angles and regenerate; if there are pending items, use Tab to enter decision-making, number keys to select direction, 0 to clear the current pending selection.
  4. When needing to compare branch consequences, click “View Direction Map” to view the indented tree (e.g., effect descriptions for “Only Diagnose Without Changing Code” vs “Diagnose + Fix”).
  5. After adoption, the input box becomes a structured prompt; your selected direction replaces the <To Confirm: ...> in the text, and other new constraints enter 【Supplementary Requirements】.

Decision-making questions can go through the Advisor Engine: Pass ideas and mode to POST /prompt-enhancer/advisor, use resume: true for multi-turn; for existing Situation Models, you can use POST /prompt-enhancer/review to review.

Summary of common shortcuts:

Key Behavior
Ctrl+Shift+Enter Generate (Closes if candidate box is open)
1–9 Adopt Item N / Decide Direction / Select Model from List
Tab Switch focus between candidates and decision-making
Esc Close or return to previous level

Use Cases and Notes

Who is it for: Users who often use long conversations in DSH and want to clarify goals, constraints, and undecided items before sending; people who need to sort out decisions, want to preserve the “Fact vs Inference” boundary, and are willing to take an extra step to decide or view the direction map; peers developing or debugging DSH plugins who need to reference official slot and Host routing implementations.

Usage Notes:

  • The plugin runs under the current DSH process permissions. Before installation, please read the source code and MIT license yourself to confirm the profile path modified by the junction/patch is correct.
  • The installation documentation uses Windows + Desktop profile as an example; Linux users need to adapt to the profile layout themselves, or first use the verify-live.ps1 logic to understand the verification items before adapting to local paths.
  • The community directory site SkillHub Plugin Page and the GitHub repository are independently maintained; it has no official affiliation with DeepSeek / High-Flyer, and is a community workflow plugin in the DSH “Everything is a Plugin” ecosystem.
  • The repository states the star count is 0 (subject to the directory page), and features are subject to the v0.3.0 README and CHANGELOG.

Conclusion

If your pain point is “It only rewrites prompts but cannot clearly explain the situation and undecided items”, dsh-prompt-enhancer uses a dual-engine to put structured rewriting and the Situation Model together: the former is responsible for adoptable prompts and directional decision-making, while the latter is responsible for advisor outputs that are resumable and reviewable. For details and installation scripts, see GitHub: shiliumu/dsh-prompt-enhancer; for browsing and categorization, see the SkillHub Directory Page.

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

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

Xiaoye