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

  1. Type a draft into the input box (for example, “Optimize my code”).
  2. Click the “✨ Polish” button at the bottom of the sidebar.
  3. Wait about 20–30 seconds; the optimization panel will display the processing status.
  4. When completed, the polished text is automatically inserted into the input box.
  5. In the optimization panel, you can continue adjusting via ↩ Undo, 🔄 Rewrite, or ⏩ Multi-round Rewrite.
  6. 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:

  1. DSH Settings Panel: Open the sidebar “⚙️ Settings” → left-side “✨ Prompt Optimization” section.
  2. 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/logs via webServer.register, and calls llm.stream to execute agent logic.
  • Client side: It is declared via dsh.client and scanned by dsh-client-modules, loading a hand-written window.__ModuleLoader__ bundle to achieve zero build.

Note: This project is not officially affiliated with DeepSeek.