Agent Plugin Doctor 技能
此技能提供針對 Agent 外掛的診斷與驗證能力。
執行環境需求
安裝此技能 不會 安裝 Doctor CLI。Doctor 是一個獨立的 npm 套件 (@agent-plugins-doctor/cli,以 agent-plugins-doctor 二進位檔的形式提供),此技能透過終端機呼叫它:
- Bun —
bunx agent-plugins-doctor check <外掛目錄> - npm —
npx agent-plugins-doctor check <外掛目錄>
bunx/npx 會在首次使用時從 npm 註冊表取得 CLI 並執行它——無需原始碼檢出、工作區建置或全域安裝。系統必須已安裝 Bun 或 npm 其中至少一種工具、其路徑需在 PATH 環境變數中,且能夠連線至 npm 註冊表。若兩者皆不可用,以下指令將失敗並顯示「找不到指令」的錯誤。
何時使用
當使用者提出以下問題時使用此技能:
- "為什麼我的 Agent 外掛無法運作?"
- "檢查這個 Agent 外掛"
- "修復這個外掛"
- "這個外掛與 Cursor/Codex/VS Code 相容嗎?"
- "稽核這個 Agent 外掛"
- "驗證這個外掛"
使用方法
執行 Doctor CLI 以驗證外掛:
# 檢查外掛
bunx agent-plugins-doctor check <外掛目錄>
# 套用安全修復
bunx agent-plugins-doctor fix <外掛目錄>
# 產生報告
bunx agent-plugins-doctor report <外掛目錄> --format markdown
# 檢查相容性
bunx agent-plugins-doctor compatibility <外掛目錄>
(npx agent-plugins-doctor ... 在 npm 環境下運作方式完全相同。)
檢查項目
Doctor 驗證:
- 外掛清單 (plugin.json) 是否符合官方架構
- 技能定義 (SKILL.md 檔案) 是否正確
- MCP 伺服器設定 (mcp.json) 是否有效
- 安全性問題(密碼、路徑遍歷、符號連結逃逸)
- 與經認證的客戶端(VS Code、Cursor、GitHub Copilot、ChatGPT 與 Codex、Kiro)的相容性
輸出結果
Doctor 提供:
- 帶有診斷代碼的明確錯誤訊息
- 檔案位置
- 問題說明與其原因
- 安全自動修復(在可行情況下)
- 所有經認證客戶端的相容性報告
範例
# 驗證目前目錄
bunx agent-plugins-doctor check .
# 修復外掛中的問題
bunx agent-plugins-doctor fix ./my-plugin
# 產生 Markdown 報告
bunx agent-plugins-doctor report ./my-plugin --format markdown > report.md
# 檢查與特定客戶端的相容性
bunx agent-plugins-doctor compatibility ./my-plugin --client cursor