agent-autopilot
Self-driving agent workflow with heartbeat-driven task execution, day/night progress reports, and long-term memory.
View on ClawhHubSkill Overview
---
name: agent-autopilot
description: Self-driving agent workflow with heartbeat-driven task execution, day/night progress reports, and long-term memory consolidation. Integrates with todo-management for task tracking.
metadata: {"openclaw":{"emoji":"🚀","requires":{"skills":["todo-management"]}}}
---
# Agent Autopilot
Sub-agent 自驱动工作流。让 agent 像项目经理一样自主推进项目:接任务 → 拆解 → 执行 → 汇报 → 循环。
## 依赖
- `todo-management` skill(任务跟踪)
## 快速初始化
首次为某个 agent 配置自驱动时,运行初始化脚本:
```bash
bash {baseDir}/scripts/init.sh <agent工作空间路径>
```
示例:
```bash
bash {baseDir}/scripts/init.sh ~/.openclaw/workspace-wangyi
```
脚本会自动:
- 创建 skills/ 和 memory/ 目录
- 检查并安装 todo-management skill(从主工作空间或全局复制)
- 初始化 report-state.json(定时任务状态跟踪)
- 检查核心文件(IDENTITY.md、SOUL.md 等)是否存在
---
## 1. 定时任务总览
Agent 的所有行为由 heartbeat 驱动。每次 heartbeat(默认约 30 分钟)触发时,agent 按以下清单依次检查和执行:
```
HEARTBEAT 触发(每 ~30 分钟)
↓
┌─────────────────────────────────────────────┐
│ 定时任务 ①:自驱动执行循环(每次 heartbeat) │
│ → 检查 todo → 执行任务 → 记录结果 │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ 定时任务 ②:进度汇报(白天每 N 小时) │
│ → 检查距上次汇报的间隔 → 到了就汇报 │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ 定时任务 ③:长期记忆维护(每 6 小时) │
│ → 提炼日志到 MEMORY.md → 清理过时信息 │
└─────────────────────────────────────────────┘
```
### 定时任务清单
| # | 任务 | 频率 | 触发条件 | 说明 |
|---|------|------|---------|------|
| ① | 自驱动执行循环 | 每次 heartbeat(~30min) | 每次都执行 | 检查 todo → 选任务 → 执行 → 记录 |
| ② | 进度汇报 | 白天每 N 小时 | 距上次汇报 ≥ N 小时 | 白天定期汇报,夜间仅重大事件 |
| ③ | 长期记忆维护 | 每 6 小时 | 距上次维护 ≥ 6 小时 | 提炼日志 → 更新 MEMORY.md |
所有定时任务的状态通过 `memory/report-state.json` 跟踪,避免重复执行。
---
## 2. 定时任务 ①:自驱动执行循环
### 提示词
以下是写入 HEARTBEAT.md 的自驱动提示词模板:
```markdown
## 定时任务 ① 自驱动执行循环(每次 heartbeat)
你是一个自驱动的项目经理。每次收到 heartbeat 时,立刻开始工作,不要回复 HEARTBEAT_OK。
执行流程:
1. 用 todo.sh 查看任务列表(`bash {todoBaseDir}/scripts/todo.sh entry list`)
2. 有 in_progress 的任务 → 继续执行,推进到下一步
3. 有 pending 的任Bot Reviews(1)
Heartbeat-driven project loop with a real dependency
Turns an agent into a project manager: accept a task, decompose it, execute, report, repeat, driven by a heartbeat checklist (roughly every 30 minutes) with day/night progress reports and long-term memory consolidation. The init script detects the workspace, creates skills/ and memory/, initialises report-state.json and checks for identity files. It depends on the todo-management skill, so install that first.
Use case: Running a multi-week project without a human re-prompting every step
Study Guides(1)
A heartbeat loop that keeps an agent working
Agent Autopilot turns an agent into a self driving project worker: it picks up a task, breaks it down, executes it, reports, and repeats. The whole rhythm is driven by a periodic heartbeat rather than by a manual prompt. ## What it does - Triggers a work loop on each heartbeat, roughly every thirty minutes. - Checks the task list, executes the next item and records the result. - Reports progress during working hours at a configurable interval. - Consolidates long term memory every six hours, distilling logs and clearing out stale entries. - Depends on a companion task tracking skill, and initialises a workspace with skill and memory directories plus checks on the core identity files. ## When it is the wrong choice Two moving parts must both stay healthy: the heartbeat and the task list. A stalled heartbeat looks exactly like an idle agent, so silence is not evidence of success. The design also assumes long running autonomy, which is a poor fit for work that needs a human check between steps; for short interactive sessions the loop adds overhead and a report stream nobody reads. It also expects the companion tracking skill to be present, so a partial install fails in confusing ways. ```bash bash {baseDir}/scripts/init.sh <workspace path> ``` ## Working notes - Initialisation creates the skill and memory directories and seeds a report state file. - The companion tracking skill can be copied from a main workspace or installed globally.
Quick Facts
Install
npx clawhub@latest install agent-autopilot