self-reflection

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

🪞 Self-Reflection

🪞 自我复盘

A skill for continuous self-improvement. The agent tracks mistakes, lessons learned, and improvements over time through regular heartbeat-triggered reflections.
一款用于实现持续自我提升的skill。Agent会通过定期的心跳触发复盘,追踪错误、学到的经验以及随时间推移的改进情况。

Quick Start

快速开始

bash
undefined
bash
undefined

Check if reflection is needed

Check if reflection is needed

self-reflection check
self-reflection check

Log a new reflection

Log a new reflection

self-reflection log "error-handling" "Forgot timeout on API call" "Always add timeout=30"
self-reflection log "error-handling" "Forgot timeout on API call" "Always add timeout=30"

Read recent lessons

Read recent lessons

self-reflection read
self-reflection read

View statistics

View statistics

self-reflection stats
undefined
self-reflection stats
undefined

How It Works

工作原理

Heartbeat (60m) → Agent reads HEARTBEAT.md → Runs self-reflection check
                                            ┌─────────┴─────────┐
                                            ▼                   ▼
                                           OK              ALERT
                                            │                   │
                                       Continue            Reflect
                                                     ┌─────────┴─────────┐
                                                     ▼                   ▼
                                                   read               log
                                              (past lessons)     (new insights)
心跳(60m)→ Agent读取HEARTBEAT.md → 运行self-reflection check
                                            ┌─────────┴─────────┐
                                            ▼                   ▼
                                           OK              ALERT
                                            │                   │
                                       继续执行               进行复盘
                                                     ┌─────────┴─────────┐
                                                     ▼                   ▼
                                                   读取                 记录
                                              (过往经验教训)     (新的洞察)

Commands

命令

CommandDescription
check [--quiet]
Check if reflection is due (OK or ALERT)
log <tag> <miss> <fix>
Log a new reflection
read [n]
Read last n reflections (default: 5)
stats
Show reflection statistics
reset
Reset the timer
CommandDescription
check [--quiet]
检查是否到了复盘时间(返回OK或ALERT)
log <tag> <miss> <fix>
记录一条新的复盘内容
read [n]
读取最近n条复盘记录(默认值:5)
stats
展示复盘统计数据
reset
重置计时器

OpenClaw Integration

OpenClaw集成

Enable heartbeat in
~/.openclaw/openclaw.json
:
json
{
  "agents": {
    "defaults": {
      "heartbeat": {
        "every": "60m",
        "activeHours": { "start": "08:00", "end": "22:00" }
      }
    }
  }
}
Add to your workspace
HEARTBEAT.md
:
markdown
undefined
~/.openclaw/openclaw.json
中启用心跳功能:
json
{
  "agents": {
    "defaults": {
      "heartbeat": {
        "every": "60m",
        "activeHours": { "start": "08:00", "end": "22:00" }
      }
    }
  }
}
添加到你的工作区
HEARTBEAT.md
markdown
undefined

Self-Reflection Check (required)

Self-Reflection Check (required)

Run
self-reflection check
at each heartbeat. If ALERT: read past lessons, reflect, then log insights.
undefined
Run
self-reflection check
at each heartbeat. If ALERT: read past lessons, reflect, then log insights.
undefined

Configuration

配置

Create
~/.openclaw/self-reflection.json
:
json
{
  "threshold_minutes": 60,
  "memory_file": "~/workspace/memory/self-review.md",
  "state_file": "~/.openclaw/self-review-state.json",
  "max_entries_context": 5
}
创建
~/.openclaw/self-reflection.json
json
{
  "threshold_minutes": 60,
  "memory_file": "~/workspace/memory/self-review.md",
  "state_file": "~/.openclaw/self-review-state.json",
  "max_entries_context": 5
}

Author

作者

Created by hopyky
hopyky创建

License

许可证

MIT
MIT