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 在同一目录),了解禁止操作、核心原则和文件结构。