Task Extractor
Parse multi-task messages → numbered queue → execute sequentially → verify each → report.
Activation
Trigger on ANY user message containing 3+ distinct actionable items. Signs:
- - Multiple sentences starting with verbs ("build", "fix", "send", "check", "add", "research")
- Comma-separated or period-separated instructions
- Mixed topics in one paragraph
- "also", "and then", "plus", "oh and", "one more thing"
If uncertain whether to activate: activate. False positives (structuring a 2-item request) cost nothing. False negatives (dropping task #7 of 12) cost trust.
Step 1: EXTRACT (before any execution)
Parse the message into individual tasks. Each task gets:
- - Number (sequential)
- Summary (one line, imperative verb)
- Type: BUILD | FIX | RESEARCH | SEND | DEPLOY | CONFIG | OTHER
- Estimated effort: QUICK (< 5 min) | MEDIUM (5-30 min) | HEAVY (30+ min / sub-agent)
Write to workspace/TASK_QUEUE.md:
CODEBLOCK0
Step 2: RECEIPT
Reply to the user with the extracted checklist BEFORE starting work:
CODEBLOCK1
Do NOT ask "is this right?" unless genuinely ambiguous. Convert ambiguity into a task and execute. Ryan's rule: don't interrogate, just do.
Step 3: EXECUTE
Work through tasks in dependency order (not necessarily numerical order):
- - Independent QUICK tasks first (batch them in parallel tool calls)
- MEDIUM tasks next
- HEAVY tasks: spawn sub-agents with clear scope
For each completed task, update TASK_QUEUE.md:
- -
⏳ → ✅ (done) or ❌ (failed) or ⚠️ (partial) or 🔄 (spawned sub-agent) - Fill in the Artifact column (file path, URL, commit hash, or "n/a")
Step 4: RECONCILE
After all tasks are attempted (or sub-agents spawned), reply with the final checklist:
CODEBLOCK2
Step 5: VERIFY (on sub-agent completion)
When a sub-agent announces completion:
- - Update TASK_QUEUE.md
- If ALL tasks are now ✅/❌, send final summary
- If tasks remain ⏳, continue working
Rules
- 1. NEVER skip the extract step. Even if the answer seems obvious. The extract step IS the safety net.
- NEVER mark a task ✅ without evidence. Evidence = file exists, command succeeded, API returned 200, deploy URL works.
- If a task fails, say WHY. Not just ❌ — include the error, the blocker, or what's needed.
- Sub-agent tasks get 🔄 until completion event arrives. Don't mark them ✅ optimistically.
- TASKQUEUE.md is the source of truth. If context overflows, re-read it. If a session restarts, re-read it.
- One TASKQUEUE at a time. If a new multi-task message arrives while one is active, append to the existing queue (renumber).
- Checkpoint at 5 completed tasks. Update the user with progress so far.
Edge Cases
"Do X and also Y but wait on Z"
- - X and Y get ⏳, Z gets 🕐 (blocked — note the dependency)
Sub-agent timeout
- - Mark as ⚠️, note what was attempted, offer to retry or take over manually
User changes mind mid-execution
- - Update TASK_QUEUE.md, cross out cancelled tasks with ~~strikethrough~~, continue with remaining
Overlapping tasks
- - If task 3 and task 7 are really the same thing, merge them. Note in Artifact: "merged with #3"
Anti-patterns
- - ❌ Reading the message, immediately jumping into task #1 without extracting all tasks
- ❌ Marking a sub-agent task ✅ before the completion event
- ❌ Saying "I'll get to that" and then forgetting
- ❌ Only reporting on the tasks you completed, silently dropping the ones you didn't
- ❌ Asking "which one should I do first?" — just prioritize by dependency + effort and go
任务提取器
解析多任务消息 → 编号队列 → 依次执行 → 验证每项 → 报告结果。
激活条件
当用户消息中包含3个及以上明确可执行事项时触发。判断依据:
- - 多个以动词开头的句子(构建、修复、发送、检查、添加、研究)
- 逗号分隔或句号分隔的指令
- 同一段落中混合不同主题
- 出现还有、然后、另外、哦对了、还有一件事等词语
若不确定是否激活:请激活。误报(将2项请求结构化)无代价。漏报(遗漏12项任务中的第7项)会损害信任。
步骤1:提取(执行前)
将消息解析为独立任务。每个任务包含:
- - 编号(顺序排列)
- 摘要(一行,祈使动词)
- 类型:构建 | 修复 | 研究 | 发送 | 部署 | 配置 | 其他
- 预估工作量:快速(< 5分钟)| 中等(5-30分钟)| 繁重(30分钟以上/需子代理)
写入 workspace/TASK_QUEUE.md:
markdown
任务队列 — [日期] [时间]
来源:[频道]
总计:[N]
状态:进行中
[摘要] | 修复 | 快速 | ⏳ | |
| 3 | [摘要] | 发送 | 快速 | ⏳ | |
...
步骤2:回执
在开始工作前,向用户回复提取的清单:
📋 从您的消息中提取了[N]项任务:
- 1. ⏳ [任务摘要]
- ⏳ [任务摘要]
- ⏳ [任务摘要]
...
现在开始执行。我会逐一标记完成情况。
除非确实存在歧义,否则不要询问这样对吗?。将歧义转化为任务并执行。瑞安法则:不要审问,直接行动。
步骤3:执行
按依赖顺序(不一定是编号顺序)处理任务:
- - 先处理独立的快速任务(通过并行工具调用批量处理)
- 再处理中等任务
- 最后处理繁重任务:生成具有明确范围的子代理
每完成一项任务,更新 TASK_QUEUE.md:
- - ⏳ → ✅(完成)或 ❌(失败)或 ⚠️(部分完成)或 🔄(已生成子代理)
- 填写产物列(文件路径、URL、提交哈希或无)
步骤4:核对
在所有任务尝试完毕(或子代理已生成)后,回复最终清单:
📋 任务报告([已完成]/[总计]):
- 1. ✅ [任务] → [产物]
- ✅ [任务] → [产物]
- 🔄 [任务] → 子代理运行中,完成后将通知
- ❌ [任务] → [失败原因]
- ⚠️ [任务] → [已完成内容,剩余内容]
步骤5:验证(子代理完成时)
当子代理报告完成时:
- - 更新 TASK_QUEUE.md
- 如果所有任务均为 ✅/❌,发送最终摘要
- 如果仍有任务为 ⏳,继续工作
规则
- 1. 切勿跳过提取步骤。 即使答案看似显而易见。提取步骤就是安全网。
- 没有证据绝不标记任务为 ✅。 证据 = 文件存在、命令成功、API返回200、部署URL可用。
- 任务失败时说明原因。 不仅仅是 ❌ —— 需包含错误信息、阻碍因素或所需条件。
- 子代理任务保持 🔄 状态直到收到完成事件。 不要乐观地标记为 ✅。
- TASK_QUEUE.md 是事实来源。 如果上下文溢出,重新读取。如果会话重启,重新读取。
- 一次只维护一个任务队列。 如果当前队列活跃时收到新的多任务消息,追加到现有队列(重新编号)。
- 每完成5项任务设置检查点。 向用户更新当前进度。
边界情况
做X和Y,但Z要等
- - X和Y标记为 ⏳,Z标记为 🕐(受阻——注明依赖关系)
子代理超时
- - 标记为 ⚠️,注明已尝试的内容,提供重试或手动接管的选项
用户中途改变主意
- - 更新 TASK_QUEUE.md,用~~删除线~~划掉已取消的任务,继续处理剩余任务
任务重叠
- - 如果任务3和任务7实际上是同一件事,合并它们。在产物中注明:与#3合并
反模式
- - ❌ 阅读消息后,未提取所有任务就直接开始处理任务#1
- ❌ 在完成事件到达前将子代理任务标记为 ✅
- ❌ 说我稍后会处理然后忘记
- ❌ 只报告已完成的任务,默默忽略未完成的任务
- ❌ 询问我应该先做哪个?——只需按依赖关系和工作量排序后直接执行