用途:在本地环境中发现、校验并调用 .agent.md 格式的自定义智能体,用于将子任务委派给合适的子智能体。
主要能力:从 Claude 智能体目录(C:\Users\LOQ.claude\agents)与 VS Code Insiders prompts 目录(C:\Users\LOQ\AppData\Roaming\Code - Insiders\User\prompts)发现 *.agent.md 文件;读取 frontmatter 了解智能体能力;检查 disable-model-invocation 是否为 false 以确认可被作为子智能体调用;确定委托时使用的 agentName。
使用方式:先搜索 *.agent.md 文件,例如:Get-ChildItem 'C:\Users\LOQ.claude\agents', 'C:\Users\LOQ\AppData\Roaming\Code - Insiders\User\prompts' -Filter *.agent.md -File;或运行 node .\scripts\agent-finder.js。然后检查 frontmatter 中 disable-model-invocation: false,取 name 字段值作为 agentName(若未指定 name,则用去掉 .agent.md 扩展名的文件名),再通过 runSubagent({ agentName, description, prompt }) 委派任务。
适用场景:需要在 GitHub Copilot、Claude Code、Codex 等客户端间复用的智能体委派流程;Codex 可同步至 $CODEX_HOME/skills/custom-agent-usage。无需 MCP 服务器,可依赖本地指令与编辑器工具作为回退。
限制:仅 disable-model-invocation: false 的智能体可被调用;.prompt.md 与 .instructions.md 不属于子智能体,应忽略;委派需有明确成功条件,结果需经证据、diff 或引用核对后再整合;不得声称使用了宿主未暴露的 MCP 操作。