subagent-dispatch
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSubagent Dispatch Protocol
子代理调度协议
This skill governs how to correctly dispatch custom agents in this project. Its primary
purpose is to ensure each agent runs with its intended model — declared in the agent's
own YAML frontmatter — rather than a platform default.
本技能规定了本项目中如何正确调度自定义Agent。其核心目的是确保每个Agent使用其预期的模型运行——该模型在Agent自身的YAML frontmatter中声明——而非平台默认模型。
Why This Matters
为何重要
Each agent in declares a in its YAML frontmatter. That choice
is deliberate: different agents are optimized for different models based on their role
(e.g., the UI Composer on Gemini for creative work, the Compliance Reviewer on GPT-5.4
for analytical rigor). Calling the tool without passing ignores that
intent entirely.
.github/agents/modeltaskmodel.github/agents/modeltaskmodelModel Resolution Protocol
模型解析协议
Follow these steps before every custom agent dispatch:
每次调度自定义Agent之前都请遵循以下步骤:
Step 1 — Identify the agent file
步骤1——确定Agent文件
Custom agents live at .
The value maps directly to the filename (e.g., → ).
.github/agents/<agent-name>.agent.mdagent_typeui-composerui-composer.agent.md自定义Agent存放在 路径下。 值与文件名直接对应(例如 → )。
.github/agents/<agent-name>.agent.mdagent_typeui-composerui-composer.agent.mdStep 2 — Look up the model
步骤2——查询模型
Use the Agent Registry below for the four known agents. If the agent isn't listed
(a new one was added), read its file and extract the field from the
YAML frontmatter at the top.
.agent.mdmodel使用下方的Agent注册表查询4个已知Agent的模型。如果Agent未在列表中(即新增的Agent),请读取其文件,从顶部的YAML frontmatter中提取字段。
.agent.mdmodelStep 3 — Map to the task tool's model ID
步骤3——映射为任务工具的模型ID
Agent frontmatter | | Model Fallback |
|---|---|---|
| | Claude Opus 4.6 |
| | Claude Opus 4.6 |
| | |
| | GPT-5.4 |
| | GPT-5.4 |
| | |
| | |
| | Claude Haiku 4.5 |
| |
Pattern: strip, lowercase, replace spaces with hyphens.(copilot)
Fallbacks: If the intended model isn't available, use the fallback. Otherwise, default to the platform's default for that agent type.
Some built-in agent types (,task) have nocode-reviewfile. Skip model resolution for these — use platform defaults or override manually based on task complexity..agent.md
Important: Prefer and for and built-in agents respectively.
GPT-5.4 miniGPT-5.3-Codexexploregeneral-purposeAgent frontmatter | | Model Fallback |
|---|---|---|
| | Claude Opus 4.6 |
| | Claude Opus 4.6 |
| | |
| | GPT-5.4 |
| | GPT-5.4 |
| | |
| | |
| | Claude Haiku 4.5 |
| |
规则:去掉后缀,转为小写,空格替换为连字符。(copilot)
降级方案:如果预期模型不可用,请使用降级方案。否则,使用该Agent类型对应的平台默认值。
部分内置Agent类型(、task)没有对应的code-review文件。这类Agent无需进行模型解析——使用平台默认值,或根据任务复杂度手动覆盖即可。.agent.md
重要提示:和类的内置Agent分别优先使用和。
exploregeneral-purposeGPT-5.4 miniGPT-5.3-CodexStep 4 — Pass model
to the task tool
model步骤4——向任务工具传递model
参数
modelAlways include the resolved model ID as the parameter:
modeltask({
agent_type: "ui-composer",
model: "gemini-3.1-pro-preview", // resolved from frontmatter
description: "Build patient card component",
prompt: "..."
})始终将解析后的模型ID作为参数传入:
modeltask({
agent_type: "ui-composer",
model: "gemini-3.1-pro-preview", // resolved from frontmatter
description: "Build patient card component",
prompt: "..."
})Core Dispatch Principles
核心调度原则
- One agent per problem domain. Dispatch independent agents concurrently — don't serialize work that can run in parallel.
- Subagents are stateless. They have zero memory of the current conversation. The prompt must be entirely self-contained with all the context needed.
- Review before accepting. Evaluate subagent output critically and request revisions when quality or relevance falls short.
- 每个问题域对应一个Agent。可并发调度独立的Agent——不要将可并行运行的工作串行处理。
- 子代理是无状态的。它们没有当前对话的任何记忆。提示词必须完全自包含,包含所需的全部上下文。
- 验收前先审核。批判性评估子代理的输出,当质量或相关性不足时请求修订。
Prompting Checklist
提示词检查清单
A subagent prompt should answer all of these before you send it:
- Context: What is the project? What stack/conventions are relevant? Which files matter?
- Task: What exactly needs to be done? What are the constraints and requirements?
- Direction: Where should the agent look first? What references or docs should it consult?
- Success criteria: What does "done" look like? What's the expected output format?
Thin prompts produce thin results. If a subagent fails or produces something off-target,
the root cause is almost always an underspecified prompt — not the agent's capability.
发送子代理提示词之前,应确保其涵盖以下所有内容:
- 上下文:项目是什么?有哪些相关的技术栈/规范?哪些文件是相关的?
- 任务:具体需要完成什么工作?有哪些约束和要求?
- 方向:Agent应该首先从哪里入手?需要参考哪些资料或文档?
- 成功标准:怎样才算「完成」?期望的输出格式是什么?
简陋的提示词只会得到简陋的结果。如果子代理运行失败或输出偏离目标,根本原因几乎都是提示词不够明确,而非Agent的能力不足。