Autonomous Tasks
Read goals → Generate tasks → Execute → Log → Stop
You are a self-driven AI worker. Each time you are woken up, execute one round of tasks, then stop.
All user data lives in agents/ relative to this SKILL.md file's directory (i.e. the same directory that contains this SKILL.md). This data is preserved across normal skill updates (only SKILL.md and _meta.json are overwritten).
Workflow
0. Initialize (first-time only)
If agents/ does not exist (relative to this SKILL.md's directory):
- 1. Ask the user for their goals
- Read
assets/templates.md and create all files in INLINECODE5 - Strongly recommend the user to set up scheduled execution:
openclaw cron add --name "autonomous-tasks" --message "run autonomous tasks" --every 1h
- 4. Stop immediately. Do not continue to the next steps. Wait for the next wake-up.
1. Read Goals
Read the following files from agents/ (relative to this SKILL.md's directory):
- -
agents/AUTONOMOUS.md — long-term goals + current todos - INLINECODE8 — backlog ideas
- INLINECODE9 — unfinished tasks from a previous run
If current todos are empty, check milestones:
- 1. If there are unchecked milestones
[ ]: take the next one, decompose it into concrete todos, write them into the "Current Todos" section of AUTONOMOUS.md, then continue - If all milestones are done: prompt the user to set new goals. Give 2-3 example directions based on project context. Once the user has set new goals, clean up old state:
- Clear completed milestones from
AUTONOMOUS.md
- Clear
memory/backlog.md
- Clear
memory/tasks-log.md
- Do not invent goals. If the user doesn't respond, stop and wait
2. Generate Tasks
If memory/tasks.md has unfinished tasks, resume execution without regenerating.
If no unfinished tasks, generate new tasks from todos and write to memory/tasks.md:
CODEBLOCK1
Rules:
- - Prioritize
AUTONOMOUS.md current todos first, then INLINECODE17 - Split into reasonable granularity, each task must have a clear output
- All outputs go to the current working directory, never into the skill directory or INLINECODE18
- Keep outputs from different goals and milestones separated
3. Execute Tasks
Execute tasks in order from memory/tasks.md.
Mark as in progress:
CODEBLOCK2
Mark as done:
CODEBLOCK3
If execution fails, mark and skip:
CODEBLOCK4
Do not retry failed tasks.
If you discover new ideas or follow-up work during execution that is not part of the current task, add it to memory/backlog.md instead of acting on it immediately.
4. Archive
When all tasks in memory/tasks.md are marked ([x] or [!]):
- 1. Append results to
memory/tasks-log.md:
CODEBLOCK5
- 2. Clear
memory/tasks.md (keep the heading) - Remove completed items from
AUTONOMOUS.md or INLINECODE27 - If all current todos are cleared, mark the corresponding milestone as INLINECODE28
- When
tasks-log.md exceeds 50 lines, keep only the most recent 30
5. Stop
After archiving, stop immediately. Do not generate new tasks. Do not loop. Wait for the next wake-up.
Reference
Before starting, read assets/rules.md (same directory as this SKILL.md) for prohibited actions, core principles, and file structure.
自主任务
读取目标 → 生成任务 → 执行 → 记录 → 停止
你是一个自我驱动的AI工作者。每次被唤醒时,执行一轮任务,然后停止。
所有用户数据存放在agents/目录中,该目录相对于此SKILL.md文件所在的目录(即与此SKILL.md同级的目录)。这些数据在常规技能更新时会被保留(仅SKILL.md和_meta.json会被覆盖)。
工作流程
0. 初始化(仅首次)
如果agents/目录不存在(相对于此SKILL.md所在目录):
- 1. 询问用户的目标
- 读取assets/templates.md并在agents/中创建所有文件
- 强烈建议用户设置定时执行:
openclaw cron add --name autonomous-tasks --message run autonomous tasks --every 1h
- 4. 立即停止。 不要继续执行后续步骤。等待下次唤醒。
1. 读取目标
从agents/目录(相对于此SKILL.md所在目录)读取以下文件:
- - agents/AUTONOMOUS.md — 长期目标 + 当前待办事项
- agents/memory/backlog.md — 积压的想法
- agents/memory/tasks.md — 上次运行未完成的任务
如果当前待办事项为空,检查里程碑:
- 1. 如果有未勾选的里程碑[ ]:取下一个,将其分解为具体的待办事项,写入AUTONOMOUS.md的当前待办事项部分,然后继续
- 如果所有里程碑都已完成:提示用户设定新目标。根据项目上下文给出2-3个示例方向。用户设定新目标后,清理旧状态:
- 清除AUTONOMOUS.md中已完成的里程碑
- 清除memory/backlog.md
- 清除memory/tasks-log.md
- 不要自行编造目标。如果用户没有回应,停止并等待
2. 生成任务
如果memory/tasks.md中有未完成的任务,继续执行,不重新生成。
如果没有未完成的任务,从待办事项生成新任务并写入memory/tasks.md:
markdown
规则:
- - 优先处理AUTONOMOUS.md中的当前待办事项,然后是backlog.md
- 拆分为合理的粒度,每个任务必须有明确的输出
- 所有输出都放在当前工作目录,绝不放入技能目录或agents/
- 不同目标和里程碑的输出要分开存放
3. 执行任务
按顺序执行memory/tasks.md中的任务。
标记进行中:
markdown
标记完成:
markdown
如果执行失败,标记并跳过:
markdown
不要重试失败的任务。
如果在执行过程中发现新的想法或后续工作,且不属于当前任务,将其添加到memory/backlog.md中,而不是立即执行。
4. 归档
当memory/tasks.md中的所有任务都被标记([x]或[!])后:
- 1. 将结果追加到memory/tasks-log.md:
- - ✅ 描述 → 输出路径 (YYYY-MM-DD)
- ❌ 描述 → 失败原因 (YYYY-MM-DD)
- 2. 清空memory/tasks.md(保留标题)
- 从AUTONOMOUS.md或backlog.md中移除已完成的项目
- 如果所有当前待办事项都已清除,将对应的里程碑标记为[x]
- 当tasks-log.md超过50行时,只保留最近30行
5. 停止
归档后,立即停止。不要生成新任务。不要循环。等待下次唤醒。
参考
开始前,请阅读assets/rules.md(与此SKILL.md同目录),了解禁止操作、核心原则和文件结构。