nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:xdr531955724/dsh-prompt-manager
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
给 DeepSeek Harness(DSH) 输入框加两件事:提示词库(一键把收藏的提示词写进输入框)和提示词优化(用大模型把输入框里正在写的东西改写得更清晰可执行,满意就一键替换)。
一个 bundle,Host 半边 + Client 半边,纯 JavaScript、无构建步骤、无依赖(Host 只用 node: 内置模块)。
inputActions 写入草稿区(不碰编辑器 DOM)。插入(光标处写入,输入框为空即整段写入)/ 替换(覆盖输入框全部内容)。小满, 报告);面板顶部一条标签栏列出所有标签和各自条数,点一下只看这个话题下的条目——同一话题写十几条也不乱。没填标签的归到「未分组」。↑ / ↓ 移动高亮,Enter 直接把该条写进输入框(手不离键盘)。localStorage(键 dsh.prompt-manager.v1),收藏标记一并保存。首次安装预置 4 条。SYSTEM_PROMPT),规则:只改写不回答任务、不编造事实、原样保留代码/路径/命令/报错、缺信息写成「先向我要」而不是向用户索要、长度以够用为限(原文短就不膨胀)。Host 半边负责出网调用与凭据,Client 半边只做 UI —— 浏览器侧因此不需要 CORS,API Key 也不进浏览器:
| 路由(仅本机回环可访问) | 作用 |
|---|---|
GET /api/prompt-manager/config |
读设置;永不返回 Key,只返回是否可用及来源 |
POST /api/prompt-manager/config |
存设置(接口地址 / 模型 / 凭据名 / Key / 自动替换 / 温度) |
POST /api/prompt-manager/optimize |
用配置的服务商改写一段文本 |
$DSH_HOME/prompt-manager.json(默认 ~/.dsh/prompt-manager.json),每次请求重新读取,改配置不用重启。keyRef → ~/.dsh/.credentials.yaml 里同名的凭据。所以复用 DSH 里已经配好的凭据(例如 ZHIPU_API_KEY)不必再复制一份密钥。conversation.input.left(输入框左下工具栏),两个条目:prompt-manager(提示词库)与 prompt-optimizer(优化)。前提:DSH 0.2.0-rc.x(ctx.slots、composer 的 inputActions、ctx.webServer)。
git clone <本仓库> dsh-prompt-manager
然后在 DSH 里用内置插件管理器安装(把 target 换成本机 clone 的绝对路径):
plugin_manager install_bundle target = /abs/path/to/dsh-prompt-manager
plugin_manager remove_bundle target = @local/dsh-prompt-manager
client.js)热更新;Host 半边(index.js)需要重启一次 DSH(宿主模块只在新进程启动时加载)。重启前点「优化」会看到「插件的宿主半边要重启一次 DSH 才会生效」的提示。cordis.patch.yml 里的那一行合并进 profile 的 cordis.patch.yml。任何 OpenAI 兼容的 /chat/completions 端点都能用。面板「设置」里有几个预设:
| 预设 | 接口 | 凭据名 |
|---|---|---|
智谱 glm-4.5-flash |
https://open.bigmodel.cn/api/paas/v4 |
ZHIPU_API_KEY |
智谱 glm-5.3-flash |
同上 | 同上 |
阿里云百炼 qwen-flash |
https://dashscope.aliyuncs.com/compatible-mode/v1 |
DASHSCOPE_API_KEY |
Google gemini-2.5-flash |
https://generativelanguage.googleapis.com/v1beta/openai |
GEMINI_API_KEY |
模型 id 以服务商控制台为准,可直接在设置里改。
实测对照(Windows 桌面版 DSH 0.2.0-rc.2,同一句原文「我那个脚本跑不起来,报错 ModuleNotFoundError,帮我看看怎么回事」):
glm-4.5-flash(免费):约 8 s → 我的脚本运行时出现 ModuleNotFoundError 错误,请帮我分析原因并提供解决方案。glm-5.3-flash:约 10 s → 我的脚本运行失败,报错 ModuleNotFoundError。请帮我定位原因并修复。脚本代码和报错全文我还没有提供,需要的话先向我要 <脚本代码> 和 <报错全文>,再开始排查。需要走代理的服务商(Google / OpenRouter / Groq 等):给 DSH 进程设 HTTPS_PROXY 与 NODE_USE_ENV_PROXY=1 再启动。
node --check client.js && node --check index.js
# 不碰运行中的 DSH,用假 ctx + 真 HTTP 服务器跑通三条路由(含真实模型调用)
node dev/host-harness.mjs '帮我看看这个报错,顺便优化一下'
PM_MODEL=glm-5.3-flash node dev/host-harness.mjs '换模型对比'
# 列某个 OpenAI 兼容中转/服务商能用的模型 id
node dev/list-relay-models.mjs <凭据名> https://your-endpoint/v1
# UI 半边的无浏览器自测:假 hooks 跑一遍面板/页签/星标/表单,不需要 React
node dev/render-check.mjs
dev/host-harness.mjs 会读写 $DSH_HOME/prompt-manager.json;想隔离测试就把 DSH_HOME 指到一个临时目录。
| 文件 | 作用 |
|---|---|
package.json |
bundle 清单:dsh.bundle.patch + dsh.client(platform: web, immediately)、icon、exports["./client"] |
cordis.patch.yml |
唯一一条 Host 行(id: prompt-manager) |
index.js |
Host 半边:三条回环 JSON 路由 + 元提示词(只用 node: 内置模块,因为插件是链接进 profile 的,裸包名解析不到) |
client.js |
Client 半边:两个工具栏条目与各自的面板 |
dev/ |
自测脚本(不随 profile 加载):render-check.mjs 用假 hooks 跑无头渲染断言 |
locale/{zh,en}.json |
插件卡片标题与描述 |
icon.svg |
插件图标 |
@文件 引用芯片,优化后按剪贴板文本(@path)写成纯文本,芯片结构不再保留。@local/... 是按 DSH 本地 bundle 的惯例取的(工作区目录安装)。要发 npm 需要换个 scope 并重新安装。MIT,见 LICENSE。
A DSH (DeepSeek Harness) bundle that adds two controls to the composer tool row:
提示词): a click-to-insert list of saved prompts organised by tags — one chip per topic, several prompts under each, an "Ungrouped" bucket for the rest. Create/edit/delete, "save as copy", search across names, text and tags, and ↑↓/Enter keyboard selection — persisted in the page's localStorage.优化): rewrites whatever is in the composer through any OpenAI-compatible /chat/completions endpoint and, after your confirmation (or automatically), replaces the draft. Host-side routes keep the API key out of the browser; the key is read from the plugin config, an environment variable, or ~/.dsh/.credentials.yaml.Install with the built-in plugin manager (install_bundle pointing at the cloned directory). The client half hot-reloads; the host half loads on the next DSH start. MIT licensed.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: prompt-library、prompt-manager、prompt-optimization、prompt-tags。