360 Secure SkillHub
360 安全技能中心

Self Reflection

核心功能包括定时触发反思(默认60分钟),支持检查反思时机、记录错误与改进方案、读取历史反思、查看反思统计数据及重置计时器等命令。可集成OpenClaw心跳机制自动触发反思,适合开发者等需自我提升的用户日常复盘失误与改进点,输入为命令行指令,输出为文本形式的状态、记录及统计数据,依赖jq和date工具。

hopyky
hopyky
热度 99.82
最近更新 2026-05-11 15:51:18
分类:知识依赖:读写文件 / MCP 服务应用场景:笔记整理 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add self-reflection
Metadata
name
self-reflection
description
Continuous self-improvement through structured reflection and memory
version
1.1.1
metadata
{"openclaw":{"emoji":"🪞","requires":{"bins":["jq","date"]}}}

🪞 Self-Reflection

A skill for continuous self-improvement. The agent tracks mistakes, lessons learned, and improvements over time through regular heartbeat-triggered reflections.

Quick Start

# Check if reflection is needed
self-reflection check

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

# Read recent lessons
self-reflection read

# View statistics
self-reflection stats

How It Works

Heartbeat (60m) → Agent reads HEARTBEAT.md → Runs self-reflection check
                                                      │
                                            ┌─────────┴─────────┐
                                            ▼                   ▼
                                           OK              ALERT
                                            │                   │
                                       Continue            Reflect
                                                               │
                                                     ┌─────────┴─────────┐
                                                     ▼                   ▼
                                                   read               log
                                              (past lessons)     (new insights)

Commands

Command Description
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

OpenClaw Integration

Enable heartbeat in ~/.openclaw/openclaw.json:

{
  "agents": {
    "defaults": {
      "heartbeat": {
        "every": "60m",
        "activeHours": { "start": "08:00", "end": "22:00" }
      }
    }
  }
}

Add to your workspace HEARTBEAT.md:

## Self-Reflection Check (required)
Run `self-reflection check` at each heartbeat.
If ALERT: read past lessons, reflect, then log insights.

Configuration

Create ~/.openclaw/self-reflection.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

License

MIT