DeepSeek Harness Plugin

SongMiao-tech/dsh-prompt-optimizer

Stars ★ 1 Category UI Enhancements Added 2026-08-15

Optimize Prompt button under the composer: one click rewrites your draft into a clearer, more executable prompt, with a before-and-after dialog and one-click replacement.

Install

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:SongMiao-tech/dsh-prompt-optimizer

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

A prompt-optimizer plugin for DeepSeek Harness (dsh). It adds an ✨ Optimize Prompt button right below the chat composer: click it to rewrite your draft into a clearer, more executable prompt — then apply it back into the input box with one click.

Features

  • Button rendered under the composer (via the conversation.composer.dock slot)
  • Reads the current composer text on click; friendly prompt when empty
  • Rewrites the draft through the host's ctx.llm with a fixed six-step procedure (intent → context → hidden constraints → gaps → restructure → language check)
  • Before/after dialog with a Replace into input button that writes the result back
  • Output always matches the input language; code, terms, and URLs are preserved

Requirements

  • DeepSeek Harness dsh (web profile) with a configured model (e.g. a DeepSeek API key in Settings → Models)

Install

dsh plugin --profile web add https://github.com/SongMiao-tech/dsh-prompt-optimizer

Or clone and install from source:

git clone https://github.com/SongMiao-tech/dsh-prompt-optimizer.git
cd dsh-prompt-optimizer
pnpm install
pnpm run build

Then register the bundle in your profile's cordis.patch.yml:

- insert:
    - id: prompt-optimizer
      name: '@deepseek-ai/dsh-prompt-optimizer'
    - id: ui-prompt-optimizer
      name: '@deepseek-ai/dsh-client-ui-prompt-optimizer'

Usage

  1. Type a rough draft in the composer
  2. Click ✨ Optimize Prompt
  3. Review the rewrite in the dialog
  4. Click Replace into input to swap it in, then send

Development

pnpm install
pnpm run build     # tsc + tsdown for both packages
pnpm run test      # vitest unit tests

Structure

.
├── cordis.patch.yml            # bundle manifest patch (host + client rows)
├── packages/
│   ├── prompt-optimizer/       # host half: promptOptimizer Remote over ctx.llm
│   └── ui-prompt-optimizer/    # client half: dock button, dialog, write-back
└── scripts/                    # vendored tsdown client-bundle preset

License

MIT

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.