Task Supervisor
Manage long-running tasks with checkpoints, progress files, and periodic WhatsApp reports.
Is This a Large Task?
Before doing anything else, mentally check:
| Signal | Large? |
|---|
| Steps ≥ 5 OR time > 20 min | ✅ Yes |
| User says "take your time / overnight / keep me posted" |
✅ Yes |
| Needs sub-agent + cron + multiple domains | ✅ Yes |
| Single tool call, quick search, short edit, Q&A | ❌ No — skip this skill entirely |
| "Help me write X" (one doc, one sitting) | ❌ No |
| "Search for Y and summarize" (few minutes) | ❌ No |
If not large → respond normally, skip task files and crons entirely.
On Task Start
When you receive a large task, immediately:
- 1. Create a task file at
.tasks/<TASK-SLUG>.md (use kebab-case slug) - Decompose the task into numbered steps
- Spawn a reporter cron to send progress updates
- Begin execution, updating the file after each step
Task File Format
CODEBLOCK0
During Execution
After every step (success or failure):
- - Update the checkbox in Steps (
[x] done, [!] failed) - Append a Log entry with timestamp and key findings
- Update
Last Updated timestamp
On failure:
- - Mark step
[!] with error summary - Try an alternative approach if obvious
- If truly stuck, set Status to
paused and note what's needed
Progress Reporting (Cron)
At task start, spawn a cron reporter using exec:
CODEBLOCK1
Adjust interval based on task scope:
- - Quick task (<30 min): every 10 min
- Medium task (30 min–2 hr): every 15 min
- Long task (>2 hr): every 30 min
On Task Completion
- 1. Fill in
## Result section with a clear summary - Set INLINECODE8
- Send a final Feishu message: task name, what was accomplished, any caveats
- Remove the progress cron
On Task Failure / Getting Stuck
- 1. Set INLINECODE9
- Document exactly what was tried and what's blocked
- Send Feishu message alert immediately (don't wait for cron)
- Do NOT silently stop — always notify
Resuming a Paused Task
When asked to continue a task:
- 1. Read INLINECODE10
- Find the last completed step
- Continue from there
- Re-spawn reporter cron if needed
Multi-Task Awareness
If multiple tasks are running, maintain separate files per task. On heartbeat, check .tasks/ for any in_progress tasks and include a brief status in heartbeat responses.
Quick Reference
| Situation | Action |
|---|
| Task assigned | Create file, decompose, spawn cron, start |
| Step done |
Update
[x], append log |
| Step failed | Mark
[!], try alternative, log error |
| Truly stuck | Set
paused, WhatsApp alert immediately |
| Task complete | Fill Result, set
done, final message, remove cron |
| Asked for update | Read task file, summarize current state |
任务主管
管理带有检查点、进度文件和定期WhatsApp报告的长时间运行任务。
这是一个大型任务吗?
在执行任何操作之前,请先进行心理检查:
| 信号 | 大型任务? |
|---|
| 步骤 ≥ 5 或 时间 > 20 分钟 | ✅ 是 |
| 用户说慢慢来/过夜/随时告知我 |
✅ 是 |
| 需要子代理 + 定时任务 + 多个领域 | ✅ 是 |
| 单次工具调用、快速搜索、简短编辑、问答 | ❌ 否 — 完全跳过此技能 |
| 帮我写X(一份文档,一次性完成) | ❌ 否 |
| 搜索Y并总结(几分钟内) | ❌ 否 |
如果不是大型任务 → 正常响应,完全跳过任务文件和定时任务。
任务开始时
当你收到一个大型任务时,立即:
- 1. 创建任务文件 在 .tasks/<任务-缩写>.md(使用短横线命名法)
- 分解 任务为编号步骤
- 生成一个报告定时任务 用于发送进度更新
- 开始执行,每完成一步后更新文件
任务文件格式
markdown
任务:<标题>
开始时间:
状态:进行中 | 已暂停 | 已完成 | 已失败
预计步骤数:N
最后更新:
步骤
- - [ ] 1. 第一步
- [ ] 2. 第二步
- [x] 3. 已完成步骤 ✓ (2026-03-02T22:05:00+08:00)
- [!] 4. 失败步骤 — <错误摘要>
日志
步骤 3 — 2026-03-02T22:05:00+08:00
此处填写结果或备注。
错误 — 2026-03-02T22:07:00+08:00
失败内容及处理方式。
结果
(完成后填写 — 给用户的最终摘要)
执行期间
每完成一步(成功或失败)后:
- - 更新步骤中的复选框([x] 已完成,[!] 已失败)
- 添加带有时间戳和关键发现的日志条目
- 更新 最后更新 时间戳
失败时:
- - 用错误摘要标记步骤 [!]
- 如果明显有替代方案,尝试其他方法
- 如果确实卡住,将状态设置为 已暂停 并注明需要什么
进度报告(定时任务)
任务开始时,使用 exec 生成一个报告定时任务:
bash
openclaw cron add task-report-<缩写> \
--schedule /15 * \
--message 读取 .tasks/<缩写>.md 并向用户发送飞书消息更新进度。包括:已完成步骤、当前步骤、阻塞项(如有)。控制在5句话以内。当状态=已完成或状态=已失败时,移除该定时任务。 \
--once-complete
根据任务范围调整间隔:
- - 快速任务(<30分钟):每10分钟
- 中等任务(30分钟–2小时):每15分钟
- 长时间任务(>2小时):每30分钟
任务完成时
- 1. 在 ## 结果 部分填写清晰的摘要
- 设置 状态:已完成
- 发送最终飞书消息:任务名称、完成内容、任何注意事项
- 移除进度定时任务
任务失败/卡住时
- 1. 设置 状态:已暂停
- 记录尝试过的内容和阻塞点
- 立即发送飞书消息提醒(不要等待定时任务)
- 不要默默停止 — 务必通知
恢复已暂停任务
当被要求继续任务时:
- 1. 读取 .tasks/<缩写>.md
- 找到最后完成的步骤
- 从那里继续
- 如果需要,重新生成报告定时任务
多任务感知
如果多个任务正在运行,为每个任务维护单独的文件。在心跳检测时,检查 .tasks/ 中是否有任何 进行中 的任务,并在心跳响应中包含简要状态。
快速参考
| 情况 | 操作 |
|---|
| 任务已分配 | 创建文件、分解、生成定时任务、开始 |
| 步骤完成 |
更新 [x]、追加日志 |
| 步骤失败 | 标记 [!]、尝试替代方案、记录错误 |
| 确实卡住 | 设置为 已暂停、立即WhatsApp提醒 |
| 任务完成 | 填写结果、设置为 已完成、发送最终消息、移除定时任务 |
| 被要求更新 | 读取任务文件、总结当前状态 |