wmengxiang/dsh-prompt-optimizer
Project Overview项目介绍
This is a native plugin built exclusively for DeepSeek Harness (DSH), which adds a sparkly icon button to the left side of the conversation input toolbar. When clicked, it calls the currently active DSH model to refine the raw prompt text in the input box, making it clearer and more specific for AI coding assistants. It is packaged as a reusable, persistent DSH web plugin bundle that automatically loads after composition mounting and deployment. There are four installation methods available: local path, GitHub, manual addition to your profile, and a temporary dynamic install for testing.
The typical usage workflow is straightforward and only takes a few steps. First, you enter your raw prompt draft into the conversation input box. Then, click the sparkly icon button to trigger the optimization process. While the prompt is being generated, the button switches to a spinning loading icon and shows a progress bar at the bottom. Once generation completes, the optimized prompt automatically replaces the original text in the input box. The button is automatically disabled when the input box is empty to prevent accidental triggers.
The plugin is released under the permissive MIT open source license, so you can use or modify it freely for personal or commercial projects. It uses the currently active default model in your DSH instance for optimization, so you can switch the model by simply changing your selected DSH model. If you encounter a Permission denied (publickey) error when installing from GitHub, this is because pnpm defaults to SSH for GitHub sources; you can fix this by using a local install or configuring an SSH key on your machine. All registered resources are automatically cleaned up when the plugin is uninstalled, leaving no residual data.
这是专为 DeepSeek Harness(DSH)开发的原生 Web 插件,会在对话输入框的工具行新增一个✨图标按钮,点击后调用当前激活的模型,把输入框内的原始提示词优化得更清晰具体,优化完成后自动回填到输入框。它封装为可复用、可持久化的插件包,挂载后可自动加载,支持本地路径、GitHub、手动接入等多种安装方式。
使用流程非常简单,用户只需要先在输入框输入原始提示词,点击输入框工具行左侧的✨按钮,按钮就会进入加载状态(显示旋转图标加底部进度条),优化完成后,新提示词会自动替换输入框原有内容。鼠标悬停在按钮上可以查看功能说明,输入框为空时按钮会自动置灰避免误触发,适合需要提升提示词质量的 DSH 用户使用。
插件采用 MIT 许可开源,优化过程使用当前 DSH 激活的默认模型,切换模型即可更换优化所用模型,不会改变原提示词的任务意图和使用语言。如果从 GitHub 安装遇到权限错误,是因为 pnpm 默认走 SSH,需要改用本地路径安装或者配置 GitHub SSH 密钥。所有注册资源随插件卸载自动清理,无残留。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-prompt-optimizer(wmengxiang/dsh-prompt-optimizer)
仓库:https://github.com/wmengxiang/dsh-prompt-optimizer
本站详情页:https://www.yhbd.top/plugins/wmengxiang-dsh-prompt-optimizer/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 2 · 最近提交 2026-09-11 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add github:wmengxiang/dsh-prompt-optimizer
把 wmengxiang/dsh-prompt-optimizer 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-prompt-optimizer
一个 DeepSeek Harness(DSH)Web 插件:在输入框工具行新增一个 ✨ 图标按钮,点击后调用当前激活模型,把输入框里的提示词优化得更清晰、更具体,并自动回填。
核心功能封装为可复用、可持久化的 DSH Web 插件包,随组合(composition)挂载后即可随部署自动加载。
功能特性
- 一键优化提示词:点击 ✨ 按钮,将当前草稿改写为更适合 AI 编程助手的高质量提示词;
- 保留意图与语言:只做清晰化、具体化改写,不改变原任务意图与语言;
- 图标按钮 + 悬停提示:界面不显示说明文字,仅在鼠标悬停时显示「优化提示词」;
- 进度反馈:优化过程中按钮切换为旋转加载圈,并在按钮底部显示滑动进度条;
- 空内容保护:输入框为空时按钮自动置灰,避免误触发;
- 流式生成:Host 端通过
ctx.llm.stream流式读取模型输出,再统一回填。
目录结构
dsh-prompt-optimizer/
├── package.json # 包元信息 + dsh.bundle / dsh.client 清单
├── cordis.patch.yml # 组合补丁:向组合挂载本插件
├── lib/
│ ├── index.js # Host 半:注册 /api/prompt-optimizer 数据路由
│ └── client.js # Client 半:__ModuleLoader__ 图标按钮 UI
├── LICENSE # MIT
└── README.md
工作原理
- Host 半(
lib/index.js):导出 Cordis 插件,inject依赖webServer、llm、agentDefaultModel,注册精确路由POST /api/prompt-optimizer。收到{ text }后读取当前默认模型(agentDefaultModel.currentSelection()),组装优化提示词,通过ctx.llm.stream流式生成并返回{ optimized }。 - Client 半(
lib/client.js):通过window.__ModuleLoader__.load注册,apply时向conversation.input.left槽位注入图标按钮,读取草稿(props.input.draft)、调用接口、再写回(props.inputActions.setDraft)。
安装步骤
方式一:本地路径安装(已验证,无需网络 / SSH)
dsh plugin --profile web add "file:/绝对路径/to/dsh-prompt-optimizer"
dsh plugin add 会自动完成两步:把包写入 profile 的 dependencies,并注册进 dsh.profile.bundles。重启对应 profile 的 Web 界面后,插件即随组合自动加载,无需每次手动激活。
方式二:从 GitHub 安装
dsh plugin --profile web add "github:<owner>/dsh-prompt-optimizer#main"
⚠️ 注意:pnpm 对
github:源走 SSH(git+ssh://git@github.com/...),要求本机已配置 GitHub SSH 密钥。没有 SSH 密钥时会报Permission denied (publickey),此时请改用方式一(本地路径)。也可以先把仓库发布到 npm 再用dsh plugin --profile web add dsh-prompt-optimizer安装。
方式三:手动接入组合
在目标 profile 的 package.json 中把本包加入 dependencies 与 dsh.profile.bundles,然后运行 dsh plugin --profile web install 并重启。
方式四:动态插件(临时试用,不持久化)
仅用于临时验证、重启即失效:
- 打开 DSH Web 的 Cordis 插件开发能力;
- 分别把
lib/index.js(Host)与lib/client.js(Client)的apply逻辑封装为动态 Package; - 运行并批准。
使用说明
- 在输入框输入一段提示词;
- 点击输入框工具行左侧的 ✨ 图标按钮;
- 按钮进入加载状态(旋转图标 + 底部进度条);
- 完成后,优化后的提示词自动替换输入框内容;
- 将鼠标悬停在按钮上可查看说明文字。
常见问题 (FAQ)
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
titanwings/distilly
YuJunZhiXue/dsh-purge
Clearailhc/clearai-dsh
yejiming/MuseAI
superdesigndev/superdesign-skill
Miaotofu01/Study-Mate