前言¶
在 DSH 的插件化擴展方式下,開發者可以把常用提示詞、模型選擇與參數替換封裝成可調用單元。dsh-prompt-profile 解決的是重複出現的一組需求:按名稱調用一段 Markdown 提示詞,把命令參數替換進正文,爲單輪會話選擇 provider、model 和 reasoning effort,並在調用結束後恢復之前的 Agent 選擇。
這是什麼¶
dsh-prompt-profile 是 DeepSeek Harness 的插件,用於提供可複用的 Markdown prompt profiles。倉庫地址如下:
https://github.com/BrambleXu/dsh-prompt-profile
資料中給出的許可證爲 MIT。版本說明稱 0.1 有意省略 prompt chains、loops、skill injection、subagents、worktrees 和 best-of-N orchestration。
核心功能¶
下面介紹已覈實的能力。
1、從用戶目錄和項目目錄發現 profiles;項目 profile 與相同相對名稱的用戶 profile 相比優先級更高。
2、使用 shell 風格佔位符將位置參數替換進 profile 正文。
3、爲單輪會話選擇 provider、model 和 reasoning effort。
4、自動恢復之前的 Agent 選擇;也可以按 profile 關閉恢復。restore 字段默認值爲 true。
5、列出可用 profiles,並支持以斜槓分隔名稱調用嵌套 profiles。
安裝與啓用¶
先確認 Node 版本與 peerDependencies 滿足要求:
Node: ^22.19.0 || >=24.0.0
{
"peerDependencies": {
"@deepseek-ai/cordis": "^4.0.1",
"@deepseek-ai/dsh-agent": ">=0.1.0-rc.5 <1",
"@deepseek-ai/dsh-commands": ">=0.1.0-rc.5 <1",
"@deepseek-ai/dsh-llm": ">=0.1.0-rc.5 <1"
}
}
資料給出的安裝命令是本地路徑示例:
dsh plugin --profile demo add ./dsh-prompt-profile
這條命令用於添加當前路徑下的插件示例。資料未提供 GitHub 倉庫安裝命令,因此不應根據倉庫名直接拼接 dsh plugin add ... 形式的命令。
Profile 位置與配置¶
用戶目錄和項目目錄配置示例如下:
- id: dsh-prompt-profile
name: dsh-prompt-profile
config:
userDirectory: ~/.dsh/prompt-profiles
projectDirectory: .dsh/prompt-profiles
對應路徑:
~/.dsh/prompt-profiles
.dsh/prompt-profiles
項目 profile 與相同相對名稱的用戶 profile 相比具有更高優先級。
Profile 寫法¶
一個 profile 文件可以包含 frontmatter 和正文。資料給出的示例:
---
description: Deep code review
provider: deepseek
model: deepseek-reasoner
reasoningEffort: high
restore: true
---
Review $1 for correctness, regressions, and missing tests. Extra context: ${@:2}
frontmatter 可包含以下字段:
description:用於在/prompt-profile list中展示。provider、model、reasoningEffort:用於爲單輪會話選擇 provider、model 和 reasoning effort。restore:控制本輪結束後是否恢復先前 Agent 選擇,默認值爲true。
如果省略 provider 和 model,資料說明會使用當前 Agent 選擇。
嵌套 profile 用斜槓分隔名稱。例如:
.dsh/prompt-profiles/review/security.md
對應調用名稱:
review/security
典型用法¶
下面兩個示例來自資料:
/prompt-profile list
/prompt-profile review src/index.ts "focus on cancellation"
第一條列出可用 profiles。第二條調用名爲 review 的 profile,並把 src/index.ts 和 focus on cancellation 作爲參數傳入;具體如何替換取決於 profile 正文中的佔位符。
適用場景與注意¶
dsh-prompt-profile 適合需要把一組提示詞和模型參數複用於單輪 DSH 會話的場景,例如代碼審查、固定上下文檢查等。插件以當前 dsh 進程權限運行,安裝前應檢查源碼、依賴和許可證。資料中給出的許可證爲 MIT。
另外,社區目錄是獨立站點,與 DeepSeek / 幻方無官方從屬關係,不應把它理解爲官方應用商店。
結尾¶
dsh-prompt-profile 的價值在於把提示詞正文、位置參數、單輪 provider/model/reasoning effort 選擇和 Agent 狀態恢復放在一個 profile 裏。本文資料中未包含目錄頁 URL,可用倉庫地址如下:
https://github.com/BrambleXu/dsh-prompt-profile