前言¶
DSH(DeepSeek Harness)的設計理念是“一切皆插件”。現有的 Claude 插件生態中,許多開發者維護了包含 skills/、commands/ 和 hooks/ 的插件結構。dsh-claude-plugin-loader 是一個兼容層插件,由 patrick1099 維護,旨在讓 DSH 直接發現並加載 Claude 式插件,從而複用現有的 Claude 插件能力。
核心能力¶
該插件實現了 Claude 插件與 DSH 之間的核心橋接功能:
-
插件掃描與去重
默認掃描~/.claude/plugins/cache目錄。如果該目錄下存在多個同名插件,插件會按版本去重,優先加載最新的活源,保留緩存中的最高版本。 -
Skills 通道
插件目錄中的skills/文件夾會被註冊爲 DSH 的 skill provider。模型可以使用 DSH 原生的skill或skill_search命令按名稱發現並加載插件內的 SKILL.md 文件。 -
Commands 通道
插件中的commands/*.md文件會被註冊爲 DSH 的斜槓命令。支持命令的註冊、程序化執行以及熱更新。插件目錄變更後,命令會自動更新或註銷。 -
狀態工具
提供只讀工具claude_plugin_status,用於列出當前已發現的插件及其支持的通道類型(skills/hooks/mcp/commands/agents)。 -
SessionStart Hook 橋
這是一個最小化的橋接實現,默認關閉。它解析hooks.json中的SessionStart命令 hook,在agent/session-start階段執行並將 stdout 注入會話上下文。開啓此功能需要在配置中顯式設置sessionStartHooks: true。 -
配置管理
通過enabledPlugins配置項,可以控制只暴露本機[plugins.dsh].enabled中列出的插件,並要求插件 manifest 聲明其爲dsh插件 skill。
安裝與啓用¶
安裝該插件需要使用 DSH 的插件管理命令。
# 裝進 web 界面 profile
dsh plugin --profile web add dsh-claude-plugin-loader
# 裝進 CLI/TUI profile
dsh plugin --profile cc-tui add dsh-claude-plugin-loader
# 裝進一次性 headless profile
dsh plugin --profile headless add dsh-claude-plugin-loader
安裝完成後,重啓對應的 DSH 進程即可生效。
配置與驗證¶
安裝後,可以在 profile 的 cordis.patch.yml 中進行配置,以指定掃描目錄、啓用特定插件或調整熱更新間隔。
- id: claude-plugin-loader
name: dsh-claude-plugin-loader
config:
pluginRoots:
- "C:/path/to/shared/plugins"
- "C:/Users/<you>/.claude/plugins/cache"
enabledPlugins:
- "cjt"
- "note-workflow"
sessionStartHooks: true
reloadIntervalMs: 1500
配置驗證:
# 查看配置是否注入
dsh --profile headless --dump-config
# 查看已加載插件狀態
dsh --profile headless "Call claude_plugin_status and repeat its output."
# 測試加載技能
dsh --profile headless "Load the cjt skill."
注意事項¶
- SessionStart 默認關閉:出於安全考慮,SessionStart hook 橋默認是關閉的,必須顯式在配置中開啓
sessionStartHooks: true。 - TUI 自動化限制:交互式 TUI 斜槓命令的自動化 PTY 輸入目前尚未穩定復現,建議在
dsh --profile cc-tui中人工敲擊/hello Alice進行最終確認。 - 未實現功能:目前尚未實現 MCP 配置生成、agents 通道、PreToolUse 拒絕/重寫等其它 hook 意圖,以及外部腳本協議橋的完整形態。
生態與源碼¶
該插件遵循 MIT 許可證。更多詳細文檔、使用指南及源碼,可參考 GitHub 倉庫。