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 注册表。如果两者都不可用,下面的命令会失败并显示“command not found”错误。
何时使用
当用户提出以下问题时使用此技能:
- “为什么我的 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 <插件目录>
(在 npm 下,npx agent-plugins-doctor ... 的工作方式完全相同。)
检查内容
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