wmengxiang/dsh-prompt-optimizer

Plugin插件 Native原生 ⭐ 2 MIT Prompts & Skills提示词与技能

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 密钥。所有注册资源随插件卸载自动清理,无残留。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • 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 并重启。

方式四:动态插件(临时试用,不持久化)

仅用于临时验证、重启即失效:

  1. 打开 DSH Web 的 Cordis 插件开发能力;
  2. 分别把 lib/index.js(Host)与 lib/client.js(Client)的 apply 逻辑封装为动态 Package;
  3. 运行并批准。

使用说明

  1. 在输入框输入一段提示词;
  2. 点击输入框工具行左侧的 ✨ 图标按钮;
  3. 按钮进入加载状态(旋转图标 + 底部进度条);
  4. 完成后,优化后的提示词自动替换输入框内容;
  5. 将鼠标悬停在按钮上可查看说明文字。

常见问题 (FAQ)

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-narrative-ledger 下一个 Next dsh-move-session →