Add scheduled task automation skill with worker execution pipeline.
Memind CI / Test, build, and release guards (push) Failing after 18s

Introduce scheduled-task-automation for H5 and WeChat, persist tasks in h5_scheduled_tasks, and run due jobs via a dedicated worker that executes agent tasks and delivers results.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-31 08:02:49 +08:00
parent 4186522c72
commit 81e63c16d3
27 changed files with 1736 additions and 2 deletions
+67
View File
@@ -0,0 +1,67 @@
---
name: scheduled-task-automation
description: 处理定时自动任务(Scheduled Automation):澄清执行时间与任务内容,写入订阅;到点由系统自动执行并推送结果。不处理纯待办/提醒。
---
# 定时自动任务(Scheduled Task Automation
这个 skill 处理**到点自动执行并交付结果**的定时任务,与 `schedule-assistant`(待办/提醒)严格分离。
## 适用范围
- 创建一次性或循环的定时自动任务(Scheduled Task / Recurring Automation
- 查询、取消当前用户的定时任务
- 澄清缺失的执行时间或任务内容
## 边界
1. **不**处理纯提醒、待办记录、日程查询 —— 那些交给 `schedule-assistant`
2. **不**在当前对话里立即执行长任务;本 skill 只负责**写入定时订阅**
3. 只能操作当前用户的数据;工具成功返回前,不能说「已经设置好了」。
4. 信息不完整时先追问,禁止臆造时间或任务内容。
## 可用工具
- `scheduled_task_create`
- `scheduled_task_list`
- `scheduled_task_cancel`
## 必填信息(创建前必须齐全)
| 字段 | 说明 |
|------|------|
| `taskSpec` | 到时具体执行什么(给后续 Agent 的说明) |
| `recurrence` | `once` 一次性 / `daily` 每天 / `weekly` 每周 |
| 执行时间 | `once``runAtLocal``daily`/`weekly``hour`+`minute`weekly 还需 `weekday` |
## 时间写入(必守)
1. **禁止**自行估算 Unix 毫秒时间戳。
2. 一次性任务用 `runAtLocal``YYYY-MM-DD HH:mm`,用户时区)。
3. 循环任务用 `hour`0-23+ `minute`0-59);每周任务额外传 `weekday`0=周日 … 6=周六)。
4. 写入后可用 `scheduled_task_list` 核对。
## 工作规则
1. 先判断用户是要**创建**、**查询**还是**取消**定时自动任务。
2. 缺时间或缺任务内容时,一次只追问最小必要信息。
3. 创建成功后,用用户能理解的话说明:
- 何时执行
- 执行什么
- 是一次性还是循环
- 结果会通过哪个通道推送(默认微信 + 站内)
4. 取消时优先用 `taskId`;用户只说任务名时可传 `titleMatch`
5. 若提示里给出了 `sourceMessageId`,调用 `scheduled_task_create` 时必须原样传入。
## 回复要求
- 简短、直接
- 成功时说明任务摘要、时间与 recurrence
- 失败时明确没写入成功,并给出下一步
## 示例
用户:每天 6 点帮我做今日新闻页面
助手:(信息齐全后调用 `scheduled_task_create`
已设置循环任务:每天 06:00(北京时间)自动搜索并生成「今日新闻页」,完成后推送链接。