dsh-plugin-doctor:對已安裝 DSH Profile 做靜態體檢

前言

在 DSH 裏維護一個 profile,常見做法是改 package.json、掛 bundle patch、在 Cordis 裏寫若干 cordis.patch.yml。依賴是否真裝進 node_modules、patch 指向的文件是否存在、多個 patch 是否撞 id 或名字,這些問題往往在啓動或聯調時才暴露。下面介紹一個只做本地靜態檢查的插件,用來在改配置之後快速掃一遍 profile 的健康度。

這是什麼

dsh-plugin-doctor(倉庫 lengrufeng2008/dsh-plugin-doctor)由維護者 lengrufeng2008 發佈,社區目錄分類爲 admin-security。它是對已安裝 DSH profile 的靜態檢查工具:對照聲明依賴與 node_modules、覈對 bundle patch 目標、發現重複的 patch id/name。README 明確說明 Local-only,不涉及安裝、啓動、運行時或網絡。

與「邊跑邊猜哪裏配錯了」相比,它的價值在於把幾類配置類問題收斂成一次可重複的掃描;README 也寫明 Not a repair tool,只報告問題,不自動修復。

核心功能

依據 README 的 Checks 一節,當前版本(package.json 爲 0.1.0)會檢查:

  1. profile 的 package.json 裏聲明的 dependencies
  2. 已安裝目錄 node_modules/<name>/package.json 是否存在、是否與聲明一致(缺失依賴類問題)
  3. 每個 dsh.bundle.patch 所指向的目標是否存在
  4. cordis.patch.yml 中重複的 patch id / name

Limits 中需要一併瞭解的能力邊界:

  • 不做 install / boot / runtime / network 相關檢查
  • 不處理 pnpm workspace 的邊界情況
  • bundle patch 缺失時可能是 warning(例如僅 client 或僅 host 的插件場景可能合理)
  • 不是修復工具

許可證:MIT;運行環境:Node >= 20(見 package.json engines)。

安裝與啓用

已抓取資料中未給出 dsh plugin add … 一類的一行安裝命令。你可以從社區目錄頁 skillhub.cn/plugins/lengrufeng2008/dsh-plugin-doctor 或 GitHub 倉庫按 DSH 插件的常規方式接入;接入後插件通過 Cordis patch(plugin/cordis.patch.yml)掛入 profile。

在 DSH 會話內,README 給出的用法爲:

Use plugin_doctor with profile=web.

將 web 換成你要檢查的 profile 名稱即可。

典型用法

命令行(獨立運行)

在插件倉庫或已安裝路徑下,可直接用 Node 執行 bin:

node bin/dsh-plugin-doctor.mjs --home ~/.dsh --profile web
node bin/dsh-plugin-doctor.mjs --json

第一行指定 DSH 主目錄(示例爲 ~/.dsh)和 profile 名;第二行以 JSON 形式輸出結果,便於腳本或 CI 解析。

在 DSH 裏調用

Use plugin_doctor with profile=web.

經過上面的步驟,你會得到依賴、bundle patch、重複 patch 標識等方面的靜態結論,再據此改 package.json 或 patch 文件。

維護者提供的自測方式:

npm test

適用場景與注意

適合誰:經常改 profile 依賴、增刪 bundle patch、合併多個插件 patch 的 DSH / 智能體開發者;希望在本地、離線環境下做一次「配置與磁盤狀態」對齊時使用。

注意:

  • 插件以當前 dsh 進程權限運行,安裝或啓用前請自行查看倉庫源碼與 MIT 許可證(README Provenance)。
  • 社區目錄 SkillHub 是獨立插件索引,與 DeepSeek / 幻方無官方從屬關係;DSH 生態強調「一切皆插件」,本工具是其中的小型 profile inspector,不是官方應用商店內置能力。
  • 星標與版本以你訪問 GitHub 時頁面爲準;本文依據 README 與 package.json 中的 0.1.0 描述能力,不替代線上最新文檔。

結尾

dsh-plugin-doctor 把「缺依賴、patch 文件缺失、patch id/name 重複」等靜態問題從聯調階段前移到一次掃描裏,適合作爲 admin-security 類維護手段。目錄頁:https://www.skillhub.cn/plugins/lengrufeng2008/dsh-plugin-doctor;源碼與說明:https://github.com/lengrufeng2008/dsh-plugin-doctor。

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜