SongMiao-tech/dsh-prompt-optimizer
Prompt optimizer plugin for DeepSeek Harness: rewrite a composer draft into a clearer, more executable prompt with one click.
已收录
0
Ui
Bundle 已验证
功能介绍
输入框下方「优化提示词」按钮:一键把草稿重写为更清晰、更可执行的提示词,弹出前后对比,支持一键替换回输入框。
适合
- 先在输入框中写粗略草稿、发送前希望提示词更清晰且更可执行的用户。
- 希望并排审阅原文和改写结果后再决定是否替换的工作流。
- 要求改写保持输入语言,并保留代码、术语和 URL 的多语言提示词工作流。
不适合
- 未配置模型的 DSH Web profile,因为优化过程需要调用宿主 LLM。
- 空白草稿,或已经定稿且必须保持原文不变的提示词。
- 需要全自动提交的工作流,因为插件会显示审阅对话框并替换输入框内容,而不会直接发送。
README
dsh-prompt-optimizer
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.dockslot) - Reads the current composer text on click; friendly prompt when empty
- Rewrites the draft through the host’s
ctx.llmwith 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
- Type a rough draft in the composer
- Click ✨ Optimize Prompt
- Review the rewrite in the dialog
- 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
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:SongMiao-tech/dsh-prompt-optimizer。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。