DSH ecosystem follows the philosophy of “everything is a plugin.” When building agents or performing complex reasoning, the clarity and structure of prompts directly affect output quality. prompt-polish aims to solve problems of vague input drafts and missing structure by invoking a dedicated prompt engineering agent before sending to polish, complete, and expand the text.
Features¶
- One-click polishing and completion: Based on prompt engineering best practices, it adds elements such as objective, target, scope, and constraints, removes ambiguity, and organizes structure.
- Multi-round rewriting and version rollback: Supports single rewrites, multi-round iteration (automatic 3 rounds), and step-by-step undo. Use version labels to quickly jump to prior states.
- Automatic input box population: After polishing is complete, the result is directly inserted into the input box and can be sent immediately.
- Built-in logging system: Displays diagnostic logs from both Host and Client sides, including endpoint status, model routing, and health checks, for easier troubleshooting.
- Custom API configuration: Supports OpenAI-compatible APIs (OpenAI / DeepSeek / Azure / Ollama, etc.) and does not rely on dsh’s built-in model routing.
- Zero build: The Client side uses a hand-written
window.__ModuleLoader__bundle, requiring no build toolchain.
Installation and Enablement¶
Required environment: DeepSeek Harness web mode (dsh --profile web) ≥ 0.1.1-rc.2.
The plugin includes a dsh.bundle declaration and can be automatically installed and registered into the profile composition via dsh plugin add:
dsh plugin --profile web add github:JOJO666888888/prompt-polish
After installation, restart dsh and refresh the browser. Two buttons, “✨ Polish” and “📋 Logs,” will appear at the bottom of the sidebar.
Usage¶
- Type a draft into the input box (for example, “Optimize my code”).
- Click the “✨ Polish” button at the bottom of the sidebar.
- Wait about 20–30 seconds; the optimization panel will display the processing status.
- When completed, the polished text is automatically inserted into the input box.
- In the optimization panel, you can continue adjusting via ↩ Undo, 🔄 Rewrite, or ⏩ Multi-round Rewrite.
- Click version labels (original / v1 / v2…) to return to any previous version for comparison or manual fine-tuning.
Custom API Configuration¶
The configuration file is stored in ~/.dsh/plugins/prompt-polish.json. Two configuration methods are supported:
- DSH Settings Panel: Open the sidebar “⚙️ Settings” → left-side “✨ Prompt Optimization” section.
- Quick settings inside the polish panel: Click the “⚙️ Settings” button in the optimization panel header.
Configuration fields include:
* Enable: Toggles between custom API and dsh’s built-in routing.
* API URL: Base URL of the OpenAI-compatible endpoint.
* API Key: Authentication key.
* Model Name: Model ID.
* Max Tokens: Output limit.
Examples of common service configurations:
* DeepSeek: https://api.deepseek.com/v1, model deepseek-chat or deepseek-reasoner
* OpenAI: https://api.openai.com/v1, model gpt-4o
* Ollama (local): http://localhost:11434/v1, model llama3.1
Uninstall¶
dsh plugin --profile web remove prompt-polish
This command removes the plugin from profile dependencies and the bundle layer stack. A dsh restart is required for the change to take effect. The custom API configuration file must be deleted manually.
Technical Implementation¶
- Host side: A standard Cordis plugin. It exposes same-origin endpoints such as
/pp-api/polish,/pp-api/config, and/pp-api/logsviawebServer.register, and callsllm.streamto execute agent logic. - Client side: It is declared via
dsh.clientand scanned bydsh-client-modules, loading a hand-writtenwindow.__ModuleLoader__bundle to achieve zero build.
Note: This project is not officially affiliated with DeepSeek.