For non-expert users who struggle to write clear prompts: on every message the plugin (agent/pre-step hook) auto-completes the vague/incomplete input into a full instruction with goal/constraints/deliverable, and marks the key requests with "► 重点". The original text is always kept first and wins on conflict; the completion preview is shown to the user; failures never break the conversation (fail-open). Self-contained pure-JS, zero host-private deps.
Install
# from a prebuilt release tarball
dsh plugin --profile web add "https://github.com/haidashu79-prog/dsh-prompt-booster/releases/download/v0.4.0/dsh-prompt-booster-0.4.0.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:haidashu79-prog/dsh-prompt-booster
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
This plugin publishes its README in Chinese only.
给"不会写提示词的人"用的提示词自动补全插件。
你说一句不完整的话("帮我搞个方案"),插件在你按回车之后、模型开始干活之前, 先让一次小模型调用读懂你的真实意图,把这句话补成完整提示词,再交给主线模型执行。 每一条输入都会自动触发,不需要点按钮,不需要记命令。
为什么默认不改你的原话
插件不改写你输入的消息,而是在原话后面追加一条 [提示词补全] 消息:
[提示词补全] 下面是系统对用户上一条原话的补全稿:意图与原文一致,只是补上了原文省略的背景/目标/约束/交付形式。
执行规则:按补全稿理解需求;补全稿与用户原话冲突时,以用户原话为准。
## 用户原话
帮我搞个方案
## 补全后的提示词
帮我写一份针对昆明中小企业的 GEO 优化方案,面向企业主,600 字左右,给出三步可执行动作。
## 待确认
没说清给谁看
处理方式:不要因为待确认而停下来追问,先按最合理的解释把事做完;做完后用一两句话说明你采用了什么假设,并只在结果会明显不同时补一句追问。
这样安排的理由:
- 可审计:原话永远在,补全稿在旁边,出问题能倒查。
- 不篡改:补全稿猜错了,原话还在,模型按"以原话为准"的规则回退。
- 不打断:待确认点不会变成弹窗追问,先干活、事后说明假设。
补什么
只补四类缺口,不换任务、不加用户没提的需求:
| 缺口 | 例子 |
|---|---|
| 目标 | "搞个方案" → 什么方案、达成什么结果 |
| 输入 | 基于哪份素材、什么对象、什么数据 |
| 约束 | 范围、风格、字数、不要什么 |
| 交付 | 要什么形式、给谁看、什么算达标 |
原话已经说清的部分原样保留,不会为了"显得有用"而注水。原话已经足够清楚时,补全稿基本等于原话。
三档强度
| level | 行为 | 长度控制 |
|---|---|---|
low |
只补最必要的缺口,几乎不动措辞 | 原话 1.0~1.5 倍 |
high(默认) |
补齐四类缺口,措辞可整理,不扩写 | 原话 1.3~2.5 倍 |
max |
追加必要的执行细节(步骤/检查点/验收标准),所有推断都标 (假设: …) |
原话 2~3.5 倍,≤600 字 |
重点标注(v0.4.0 起)
补全稿除了"补全后的提示词"和"待确认",还会产出一节"重点标注":把这条任务最关键的 1~4 个要求(目标、对象、硬约束、交付标准)单独拎出来。
- 模型输出里用
重点:(也认关键点/核心要求/要点)小节承载,可以多行。 - 推送给你的补全摘要里,重点会单独成段,每条前面加
► 重点:标记;追加给主模型的[提示词补全]里也有## 重点标注一节。 - 默认开启(
showRewrite: true),你每次发完一句话,会立刻在对话里看到"已补全提示词 + 重点标注",更直观。
用上一轮对话消除指代
"再改改它"这种话离开上下文无法理解。插件会把最近 contextTurns 轮的对话(截到 contextChars 字)
一起给补全模型,让它知道"它"指的是什么;同时明确要求不要把上一轮的旧要求硬塞进这一轮。
什么时候跳过
| 原因 | 说明 |
|---|---|
slash-command |
以 / 开头的命令是 DSH 自己的指令,不补 |
too-short |
短于 minChars(默认 4 字),"好""嗯""继续"这类不补 |
too-long |
超过 maxInputChars(默认 4000 字),本身已足够详细 |
has-attachment |
带图片/文件的消息不补,避免误解附件 |
contains-skip-marker |
命中 skipIfContains 里任一字符串就跳过 |
already-seen |
同一条消息已经补过(同一轮多步不会重复调用模型) |
配置
~/.dsh/profiles/desktop/cordis.patch.yml 里 - id: prompt-booster 一节:
| 键 | 默认 | 说明 |
|---|---|---|
enabled |
true |
总开关 |
level |
high |
low / high / max |
showRewrite |
true(v0.4.0 起) |
把补全稿 + 重点标注也推给用户看一眼(需宿主提供回复服务) |
announce |
false |
预留 |
contextTurns |
2 |
带几轮历史,0 关闭 |
contextChars |
1200 |
历史截断长度 |
minChars |
4 |
少于这个字数不补 |
skipIfContains |
[] |
命中即跳过 |
provider / model |
"" |
留空则跟随当前会话模型 |
maxInputChars |
4000 |
超过不补 |
maxOutputTokens |
900 |
补全稿 token 上限 |
timeoutMs |
20000 |
超时放行原话 |
failOpen |
true |
补全失败时按原话继续,不阻塞对话 |
改动后重启 DeepSeek Harness 生效。
补全时用哪个模型(v0.3.1 起)
补全本身是一次独立的小模型调用,不占用你的对话回合。路由按下面的顺序解析,第一个能拿到的就用:
| 顺序 | 来源 | 说明 |
|---|---|---|
| 1 | 配置里的 provider + model |
想固定用便宜的小模型补全就填这两个 |
| 2 | session.requestContext() |
该会话上一次真实请求解析出的 provider/model(默认走这条) |
| 3 | session.requestHeader().config |
同上,从请求头里读 |
| 4 | agent.options.provider/model |
兜底 |
历史 bug(v0.2.0,已修):曾用
agent/request事件的payload.agent做 WeakMap 键记路由。 但这是 agent 级 scope 派发的事件,payload 里根本没有agent字段,键全是undefined, 结果每条输入都报no route并 fail-open 放行原话。另外插件必须在 plugin 里export const inject = ['llm'],否则取不到ctx.llm服务(llm service unavailable)。
校验
- 已通过 canary 自测:首步补全、同一轮多步去重、带历史补全、斜杠命令跳过、短句跳过、模型调用次数符合预期。
- 路由矩阵自测:配置写死 /
requestContext/requestHeader/agent.options四种来源都能补全,全无路由时 fail-open 不崩。 - 全链路自测:pre-step → 路由解析 →
llm.stream→BlockAssembler→parseRewrite→ 追加注入,注入消息source正确、原话仍在首位、模型只调一次。 - 真机验证方式:会话日志里出现
"kind":"plugin","plugin":"dsh-prompt-booster"。
文件
- 插件代码:
/Users/a1234/.dsh/plugins/dsh-prompt-booster/lib/index.js - 开关与配置:
/Users/a1234/.dsh/profiles/desktop/cordis.patch.yml的- id: prompt-booster一节 - 改完必须重启 DeepSeek Harness 才生效;插件是 fail-open 的,出问题只会退化成"按原话执行",不会卡住对话。
设计取舍(与市场同类对比)
市场上同类插件(如 dsh-prompt-rewriter、dsh-prelude)多为按钮触发;少数支持自动触发(如 dsh-prompt-clarifier)。 本插件的差异点:默认每条输入自动补全、不改写原话、失败自动放行, 并且把"意图不明"处理成"先按最合理解释做完 + 事后说明假设",而不是拦下来弹窗追问。
Links
More in this category
bowenliang123/dsh-context★ 5191
DSH context insight panel: Context dashboard + /context command + Context browser — one-stop context lifecycle management with categorized composition, content details, evolution trends, compaction/injection events, and stats.
Han-1413141/dsh-cost-meter★ 705
Per-session and daily API cost, budget with usage %, official balance, history dashboard, and one-click official price sync with peak/off-peak pricing.
wssfk12138/dsh-damage-pulse★ 290
Tracks DeepSeek token usage, per-call and session costs, and account balance with cache-aware charge animations in the DSH Web UI.
zh667/TokenLedger★ 205
Sidebar usage panel that attributes tokens to the relay site that served each request, read from your existing provider config: today/month/all-time totals, per-site and per-model breakdowns, a year activity heatmap, and New API / Sub2API / DeepSeek balances.
Ychris12138/dsh-usage-stats★ 190
Multi-provider usage dashboard with provider/model token breakdowns, calendar drill-downs, account balances, and OpenCode Go / Z.ai subscription quota tracking.
Mt-Youya/dsh-plugins#sessions-insight★ 166
Browse Claude Code, DSH and Codex session logs by working directory, with per-turn context composition, token usage, compaction markers and cost estimates.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.