DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

kongchenhui /

kongchenhui/dsh-prompt-tuner

Verified

A DeepSeek Harness plugin that adds a toolbar button to rewrite the current draft into a clearer, executable prompt, with undo, cancellation, and customizable prompt/model settings.

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHubProject homepage
READMESource: main@72fc6525

提示词优化

输入框工具栏里的一个按钮:把当前草稿改写为更清晰、可执行的提示词,同时纠正错别字、标点、语法、术语和前后矛盾。使用哪条提示词、调用哪个模型,都可以自行设置。

把草稿「测试一下」改写为可执行的提示词

使用

  • 点击按钮开始优化,完成后草稿被替换,按钮变为「恢复原文」,再点一次还原。
  • 优化过程中可以随时取消:再点一次按钮即可中止,不会继续消耗模型额度。
  • 优化失败时按钮变成红色,鼠标悬停可查看原因;修改草稿或重新点击即可清除。
  • 草稿被手动修改后,「恢复原文」自动失效,避免覆盖新输入。

设置

打开「设置 → 提示词优化」:

字段 说明
优化提示词 决定草稿如何被改写,每次优化都使用它。
模型 默认「跟随当前会话」,即使用输入框当前选择的模型;也可固定为指定模型。
最大输出 tokens 单次改写的输出上限,最高 2048。

模型选择器支持搜索、按服务商分组,方向键上下移动、回车确认。

配置文件

设置保存在:

~/.dsh/prompt-tuner/settings.json

设置页底部会显示这个路径,点击即可用系统编辑器打开。删除该文件将恢复默认设置。

{
  "prompt": "你是一名提示词工程师兼校对员。……",
  "model": { "provider": "", "model": "" },
  "maxOutputTokens": 1024
}

"provider": "" 表示跟随当前会话。

打开动作走系统自己的默认应用解析(Windows 上交给 explorer.exe,macOS 上强制文本编辑器),因此与双击打开的行为一致;文件尚不存在时会先按默认值生成。

自定义提示词时的注意事项

优化结果会直接替换草稿,因此提示词应当要求模型只输出改写后的正文,不要附加解释、开场白或代码块标记。否则这些多余内容会一并进入输入框。

安装

dsh plugin --profile <profile> add @kongchenhui/dsh-prompt-tuner

(<profile> 换成你的 profile 名。)

需要 DeepSeek Harness 0.2.1-rc.5 或更高版本。

开发

源码用 TypeScript 编写,构建产物不提交:

src/host/     宿主端:设置文件、模型调用、原生打开器、HTTP 路由
src/client/   浏览器端:输入框控件、设置页、模型选择器(按组件拆分)
tests/        vitest 测试
npm install        # 安装依赖,并因 prepare 脚本触发一次构建
npm run build      # 构建 lib/index.js、lib/client.js 与 lib/types
npm run typecheck  # tsc 类型检查
npm run lint       # ESLint
npm run format     # Prettier 写入
npm test           # vitest
npm run verify     # 依次执行以上全部

浏览器端由 tsdown 打包成 harness 的 closure-factory 产物(window.__ModuleLoader__.load),样式写在 .module.css 里,构建期编译为哈希类名;模块解析只允许 react 等平台模块,引入其它 harness 包会在构建期报错。

locale/*.json 由 src/client/locales.ts 生成,不要手改:

npm run gen:locale      # 重新生成
npm run verify:locale   # 校验是否过期

许可证

MIT

—/ 5

No ratings yet

Verified DSH bundle

Commit 72fc6525aa50

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout