插件目录 / Developer / dsh-prompt-presets
dsh-prompt-presets
已验证 · 实测可装 fff122
功能简介
dsh-prompt-presets — DSH 插件(工具)
可用 — 实测通过,早期项目
dsh-prompt-presets — DSH 插件(工具) 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-prompt-presets
A local prompt preset plugin for DeepSeek Harness. It stores reusable prompt templates, supports {{variable}} placeholders, and renders a finished prompt when the Agent supplies values.
Preset data stays in the current working directory under .dsh/prompt-presets/presets.json. The plugin does not send templates or variables over the network.
Quick install
Requirements
You need Node.js 22 or newer, pnpm, and a DeepSeek Harness installation that supports JavaScript or TypeScript plugins.
Step 1: Download and build
Copy and run:
git clone https://github.com/fff122/dsh-prompt-presets.git
cd dsh-prompt-presets
pnpm install
pnpm build
Step 2: Create the plugin configuration
Run this command from the repository root:
cat > prompt-presets.patch.yml <<EOF
- insert:
- id: dsh-prompt-presets
name: '$PWD/dist/src/index.js'
EOF
The plugin path is absolute because the Harness patch loader requires an absolute path.
Step 3: Start Harness with the plugin
If Harness is installed as a command:
dsh web --patch "$PWD/prompt-presets.patch.yml"
Otherwise, run:
npx @deepseek-ai/dsh web --patch "$PWD/prompt-presets.patch.yml"
Verify the installation
Ask the Agent:
保存一个名为 meeting-summary 的提示词模板:总结 {{topic}},面向 {{audience}},语气保持简洁。标签用 work。
Then ask:
应用 meeting-summary,topic 是产品发布会,audience 是工程团队。
If the plugin is loaded, the Agent can use preset_save and preset_apply to save and render the template.
Available tools
| Tool | Purpose |
|---|---|
preset_save |
Save a new preset or update an existing preset with the same name. |
preset_list |
List saved presets, optionally filtered by tags. |
preset_apply |
Replace {{variable}} placeholders with supplied values. |
preset_delete |
Delete a preset by name. |
Template behavior
Variable names use letters, digits, and underscores, and must start with a letter or underscore. Spaces inside braces are allowed, so {{topic}} and {{ topic }} refer to the same variable. Variables are returned in first-seen order.
If a variable is missing, preset_apply leaves its placeholder in the rendered text and lists the name in missing. This makes it possible to review an incomplete prompt without losing the original placeholder.
Strings are inserted as-is. Numbers and booleans use their text form, while arrays and objects are inserted as compact JSON.
Updating the plugin
From the cloned repository:
git pull
pnpm install
pnpm build
Restart Harness with the same patch command after rebuilding.
Development
Run the complete package quality gate from the repository root:
pnpm run format:check
pnpm run typecheck
pnpm run test
pnpm run build
The implementation is split into small modules:
src/
index.ts # Harness entry point and tool registration
preset-schema.ts # Preset types, validation, and template rendering
preset-store.ts # Local persistence, filtering, updating, and deletion
test/
index.test.ts
mount.test.ts
preset-schema.test.ts
preset-store.test.ts
For the plugin model and patch overlay format, see the official DeepSeek Harness plugin guide.
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-prompt-presets」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:fff122/dsh-prompt-presets Headless(CLI)profile:
dsh plugin --profile headless add github:fff122/dsh-prompt-presets 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。
使用场景
扩展 agent 的编码能力面——给它一个新工具、工作流或集成,让它接手以前做不了的开发任务。
适合谁
想让 dsh 在真实代码库上像队友一样干活的开发者——能改、能跑、能验证,而不只是回答问题。
二次开发建议
工具/命令面就是缝:暴露更多 SDK 能力、加更聪明的上下文接线,或收紧改代码与验证之间的循环。