subagent-orchestrator
Run continuous task lines through the main controller, not by accident.
Core rules
- 1. Treat
autopilot as a continuous line
- Do not stop at “one run finished”.
- A finished run means
handoff, not “whole line done”.
- Continue until one of: complete, blocked, paused by user.
- 2. The main controller must directly re-dispatch
- Do not wait for the user to remind you to continue.
- For every autopilot line, the main controller decides the next slice and spawns it.
- 3. Keep the task board current
- Update
AGENT_TASK_BOARD.md before or when dispatching the next round.
- Record: goal, current round, completed items, remaining items, next slice, follow-up roles.
- 4. Keep subagent replies short
- Prefer: goal / completed / files / status / next / risk.
- Avoid long background restatements.
- 5. Clean finished sessions, keep memory
- Finished subagent sessions do not need to be kept.
- Before forgetting them, write the durable record into
memory/YYYY-MM-DD.md.
- Include at least: task goal, changed files, result status, risk, next step.
- Promote stable collaboration rules into
MEMORY.md when needed.
- 6. Do not keep unnecessary artifacts
- Temporary screenshots, temp files, and intermediate outputs can be deleted when no longer needed.
- If the user wants screenshot proof, prefer sending it directly instead of long-term local retention.
Role routing
Do not hard-code project-specific model rules into this skill.
Use the current session defaults unless the user or project rules override them. If a project has role-specific model preferences, keep them in project memory, task board rules, or project docs — not as universal orchestrator behavior.
Dispatch pattern
When an autopilot line is active:
- 1. Read the current line from INLINECODE4
- Pick the next small closed slice
- Spawn the correct role
- Require short structured return
- On completion:
- summarize for the user
- update memory
- clean finished session if no longer needed
- immediately dispatch the next slice if the line is still active
Cross-role coordination
Cross-role dependency pattern
When one role creates a dependency for another role:
- - the producing role must explicitly name the follow-up role in INLINECODE5
- the main controller should dispatch that follow-up role without waiting for the user to restate it
- do not let dependent task lines drift apart
Examples:
- - research -> UI integration
- code logic -> validation
- code structure -> UI presentation
Validation
Validation is a follow-up role, not usually the main line.
Trigger it after:
- - a meaningful UI slice
- a meaningful code slice
- a user asks for proof/checks
Return protocol
Keep the canonical protocol in references/SUBAGENT_RECORD_PROTOCOL.md and use it together with this skill.
Require subagents to include these header fields before the short report:
- -
tag: one of INLINECODE8 - INLINECODE9 the task line name, such as
ui-autopilot, code-autopilot, scout-art, INLINECODE13 - INLINECODE14 the current task-line node id, such as
code-n4, INLINECODE16 - INLINECODE17 use only
partial | complete | waiting | blocked (do not invent values like half_done, in_progress, done) - INLINECODE22 free-form next owner/role label, such as
ui, code, verify, research, archive, user, none, or any project-specific role name
Then use the short body (see references/SUBAGENT_RECORD_PROTOCOL.md for the full paired format):
- 1. Goal
- Completed (max 3-4)
- Changed files
- Status
- Next
- Risk
Tag meanings
- -
autopilot: this round finished, but the whole line is probably not done; main controller must compare against the task board and either continue or close - INLINECODE32 : the whole line is complete
- INLINECODE33 : this role is waiting for another line or condition; do not continue this role yet
- INLINECODE34 : the line cannot safely continue automatically
- INLINECODE35 : this round finished and the next role is already clear
- INLINECODE36 : user decision is required before any safe continuation
Main-controller decision rules
When a subagent returns:
- 1. If INLINECODE37
- close the line
- write memory
- clean finished session
- 2. If INLINECODE38
- compare against
AGENT_TASK_BOARD.md
- resolve the current
line and
node
- ignore vague per-run completion phrasing in the body
- if
node != end_node, dispatch the next node immediately in the same controller turn
- only close the line when
current_node == end_node and the line completion condition is actually satisfied
Anti-drop guard
For every autopilot return, the main controller must verify all three:
- - the line exists on the task board
- the line is not yet complete
- a next dispatch was either sent, or the line was explicitly converted to
idle, blocked, need_user, or INLINECODE48
If none of those happened, the turn is incomplete and should not be considered finished.
Stricter continuation rules
A local slice finishing is not enough to stop a line.
Do not treat phrases like “this small closure is done”, “this round passed”, or “this piece is complete” as permission to pause.
The controller may stop only when one of these is true:
- -
current_node == end_node and the line completion condition is actually satisfied - the return is explicitly INLINECODE50
- the return is explicitly INLINECODE51
- the user explicitly paused/stopped the line
If a subagent returns goal_status: complete for a node, that means:
- - the node itself finished
- the controller must immediately resolve INLINECODE53
- and dispatch the next owner in the same turn unless the line is truly at INLINECODE54
Delivery-proof rule
If a task claims a delivery/output was completed on an external surface (for example Discord/Telegram/channel/thread/board), the controller must require proof.
A claim like “已上屏 / 已交付 / 已发布 / 已发送” is not sufficient by itself.
Minimum proof for delivery-type tasks:
- - target channel/thread id
- message id (or equivalent object id)
- a human-checkable location description
If any proof item is missing, treat the task as not delivered yet.
Do not mark the line done or the node complete on verbal assurance alone.
Mandatory node advancement
After receiving a valid autopilot return with line and node, the main controller must do this in order:
- 1. resolve the matching task-line in INLINECODE58
- resolve the current node definition
- advance
current_node to that node's INLINECODE60 - if the advanced node is not
end_node, dispatch the owner of the advanced node immediately in the same turn
Do not stop after summarizing the finished round. The turn is only complete after the node has been advanced and the next node has either been dispatched or explicitly put into idle / blocked / need_user / done.
- 3. If INLINECODE63
- dispatch
next_role directly
- update task board
- 4. If INLINECODE65
- do not continue this role yet
- mark dependency in task board
- resume after the dependency line advances
- 5. If INLINECODE66
- stop automatic continuation
- summarize blocker
- ask only for the smallest required decision if needed
- 6. If INLINECODE67
- ask the user
- do not keep other roles guessing
Completion conditions
Only mark a line done when:
- - the user says stop/pause, or
- the task board objective is fully satisfied and no meaningful next slice remains.
Do not mark done just because one run finished.
subagent-orchestrator
通过主控制器运行连续任务线,而非偶然触发。
核心规则
- 1. 将 autopilot 视为连续线
- 不要在“一次运行完成”时停止。
- 一次完成的运行意味着
交接,而非“整条线完成”。
- 持续运行直到出现以下情况之一:完成、受阻、被用户暂停。
- 2. 主控制器必须直接重新调度
- 不要等待用户提醒你继续。
- 对于每条自动导航线,主控制器决定下一个片段并生成它。
- 3. 保持任务板最新
- 在调度下一轮之前或同时更新 AGENT
TASKBOARD.md。
- 记录:目标、当前轮次、已完成项、剩余项、下一个片段、后续角色。
- 4. 保持子代理回复简洁
- 优先:目标 / 已完成 / 文件 / 状态 / 下一步 / 风险。
- 避免冗长的背景重述。
- 5. 清理已完成的会话,保留记忆
- 已完成的子代理会话无需保留。
- 在遗忘它们之前,将持久记录写入 memory/YYYY-MM-DD.md。
- 至少包含:任务目标、变更的文件、结果状态、风险、下一步。
- 必要时将稳定的协作规则提升到 MEMORY.md 中。
- 6. 不保留不必要的工件
- 临时截图、临时文件和中间输出在不再需要时可以删除。
- 如果用户需要截图证明,优先直接发送而非长期本地保留。
角色路由
不要将特定于项目的模型规则硬编码到此技能中。
使用当前会话默认值,除非用户或项目规则覆盖。如果项目有特定角色的模型偏好,将其保留在项目记忆、任务板规则或项目文档中——而非作为通用的编排器行为。
调度模式
当自动导航线处于活动状态时:
- 1. 从 AGENTTASKBOARD.md 读取当前线
- 选择下一个小的封闭片段
- 生成正确的角色
- 要求简短的结构化返回
- 完成时:
- 为用户总结
- 更新记忆
- 清理已完成的会话(如果不再需要)
- 如果线仍处于活动状态,立即调度下一个片段
跨角色协调
跨角色依赖模式
当一个角色为另一个角色创建依赖时:
- - 生产角色必须在 next_role 中明确命名后续角色
- 主控制器应调度该后续角色,无需等待用户重新陈述
- 不要让依赖任务线偏离
示例:
- - 研究 -> UI 集成
- 代码逻辑 -> 验证
- 代码结构 -> UI 呈现
验证
验证是一个后续角色,通常不是主线。
在以下情况后触发:
- - 一个有意义的 UI 片段
- 一个有意义的代码片段
- 用户要求证明/检查
返回协议
将规范协议保留在 references/SUBAGENTRECORDPROTOCOL.md 中,并与此技能一起使用。
要求子代理在简短报告之前包含以下头部字段:
- - tag: 其中之一 autopilot | done | idle | blocked | handoff | needuser
- line: 任务线名称,例如 ui-autopilot、code-autopilot、scout-art、archive-worldview
- node: 当前任务线节点 ID,例如 code-n4、ui-n5
- goalstatus: 仅使用 partial | complete | waiting | blocked(不要发明像 halfdone、inprogress、done 这样的值)
- next_role: 自由格式的下一个所有者/角色标签,例如 ui、code、verify、research、archive、user、none,或任何特定于项目的角色名称
然后使用简短正文(完整配对格式见 references/SUBAGENTRECORDPROTOCOL.md):
- 1. 目标
- 已完成(最多 3-4 项)
- 变更的文件
- 状态
- 下一步
- 风险
标签含义
- - autopilot:本轮完成,但整条线可能尚未完成;主控制器必须与任务板对比,然后继续或关闭
- done:整条线已完成
- idle:此角色正在等待另一条线或条件;暂时不要继续此角色
- blocked:该线无法安全地自动继续
- handoff:本轮完成,下一个角色已明确
- need_user:在安全继续之前需要用户决策
主控制器决策规则
当子代理返回时:
- 1. 如果 tag=done
- 关闭该线
- 写入记忆
- 清理已完成的会话
- 2. 如果 tag=autopilot
- 与 AGENT
TASKBOARD.md 对比
- 解析当前的 line 和 node
- 忽略正文中模糊的每次运行完成措辞
- 如果 node != end_node,在同一控制器轮次中立即调度下一个节点
- 仅当 current
node == endnode 且线完成条件实际满足时才关闭该线
防掉落保护
对于每个 autopilot 返回,主控制器必须验证所有三项:
- - 该线存在于任务板上
- 该线尚未完成
- 要么已发送下一个调度,要么该线已明确转换为 idle、blocked、need_user 或 done
如果以上均未发生,则该轮次不完整,不应视为已完成。
更严格的继续规则
一个局部片段完成不足以停止一条线。
不要将诸如“这个小封闭已完成”、“本轮通过”或“此部分已完成”之类的措辞视为暂停的许可。
控制器仅可在以下情况之一为真时停止:
- - currentnode == endnode 且线完成条件实际满足
- 返回明确为 blocked
- 返回明确为 need_user
- 用户明确暂停/停止了该线
如果子代理返回某个节点的 goal_status: complete,这意味着:
- - 该节点本身已完成
- 控制器必须立即解析 nextondone
- 并在同一轮次中调度下一个所有者,除非该线确实在 end_node
交付证明规则
如果任务声称交付/输出已在外部表面(例如 Discord/Telegram/频道/线程/看板)上完成,控制器必须要求提供证明。
像“已上屏 / 已交付 / 已发布 / 已发送”这样的声明本身不足以证明。
交付类任务的最低证明要求:
- - 目标频道/线程 ID
- 消息 ID(或等效对象 ID)
- 可供人工检查的位置描述
如果缺少任何证明项,则将任务视为尚未交付。
不要仅凭口头保证就将线标记为完成或将节点标记为已完成。
强制节点推进
在收到带有 line 和 node 的有效 autopilot 返回后,主控制器必须按顺序执行以下操作:
- 1. 解析 AGENTTASKBOARD.md 中匹配的任务线
- 解析当前节点定义
- 将 currentnode 推进到该节点的 nextondone
- 如果推进后的节点不是 endnode,在同一轮次中立即调度该节点的所有者
不要在总结完已完成轮次后停止。只有在节点已推进且下一个节点要么已调度,要么已明确置于 idle / blocked / need_user / done 状态后,该轮次才算完成。
- 3. 如果 tag=handoff
- 直接调度 next_role
- 更新任务板
- 4. 如果 tag=idle
- 暂时不要继续此角色
- 在任务板上标记依赖
- 在依赖线推进后恢复
- 5. 如果 tag=blocked
- 停止自动继续
- 总结阻塞因素
- 仅在需要时询问最小的必要决策
- 6. 如果 tag=need_user
- 询问用户
- 不要让其他角色猜测
完成条件
仅在以下情况将线标记为完成:
- - 用户说停止/暂停,或
- 任务板目标完全满足且没有有意义的下一个片段剩余。
不要仅仅因为一次运行完成就标记为完成。