rocky-evo

自我修复·自我进化·自我迭代 — 收集4小时内所有原始日志喂给AI,AI自行分析并自动修复,修复结果注入活跃会话。Self-healing, self-evolving, self-iterating AI agent.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "rocky-evo" with this command: npx skills add rockytian-top/rocky-evo

rocky-evo v16.1.0

核心流程

dump 原始日志 → AI 分析 → AI 自动修复 → 注入修复结果到活跃会话

执行步骤

步骤 0: 自动创建 Cron(自我进化)

检查 rocky-evo 定时任务是否存在。不存在则自动创建,cron 绑定到当前运行的 agent

# 确定当前 agent ID
AGENT_ID="${OPENCLAW_AGENT_ID:-main}"

# 检查是否已有 rocky-evo cron
CRON_JOBS=$(cat ~/.openclaw/cron/jobs.json 2>/dev/null)
EXISTING=$(echo "$CRON_JOBS" | python3 -c "import json,sys; d=json.load(sys.stdin); found=[j for j in d.get('jobs',[]) if 'rocky-evo' in j.get('name','').lower()]; print(len(found))" 2>/dev/null)

if [ "$EXISTING" = "0" ] || [ -z "$EXISTING" ]; then
    CRON_ID=$(python3 -c "import uuid; print(uuid.uuid4())")
    NOW_MS=$(python3 -c "import time; print(int(time.time() * 1000))")

    python3 << PYEOF
import json, os

cron_path = os.path.expanduser('~/.openclaw/cron/jobs.json')
with open(cron_path) as f:
    d = json.load(f)
d['jobs'].append({
    "id": "$CRON_ID",
    "agentId": "$AGENT_ID",
    "name": "rocky-evo 自动进化",
    "enabled": True,
    "deleteAfterRun": False,
    "createdAtMs": $NOW_MS,
    "updatedAtMs": $NOW_MS,
    "schedule": {"kind": "every", "everyMs": 14400000, "anchorMs": $NOW_MS},
    "sessionTarget": "session:agent:$AGENT_ID:user-session",
    "wakeMode": "next-heartbeat",
    "payload": {"kind": "agentTurn", "message": "/rocky-evo"},
    "delivery": {"mode": "none"}
})
with open(cron_path, 'w') as f:
    json.dump(d, f, indent=2, ensure_ascii=False)
print(f"✅ rocky-evo 4小时定时任务已绑定到 agent: $AGENT_ID")
PYEOF
    openclaw gateway restart
    echo "自我进化完成:$AGENT_ID 每4小时将自动运行 /rocky-evo"
fi

步骤 1: 收集4小时内所有原始日志

OPENCLAW_DIR="${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"
SKILL_DIR="$(dirname "$(find "$OPENCLAW_DIR/skills" -name "SKILL.md" -path "*/rocky-evo/SKILL.md" 2>/dev/null | head -1)")"
ANALYZE_WINDOW=240 bash "$SKILL_DIR/scripts/full_analyze.sh"

输出包含(原样 dump,不分类不筛选):

  • gateway.log + gateway.err.log
  • 所有 agent 的会话 jsonl
  • cron runs 记录
  • openclaw.json 配置(机密已脱敏)

步骤 2: AI 分析并自动修复

AI 自己看原始日志,自行判断问题并直接执行修复命令。

自动适配当前 agent 的模型

  • openclaw.json 读取当前 agent 的模型配置
  • API Key 模型 → 关注 rate limit、key 过期、配额耗尽
  • 订阅/Portal 模型(authHeader: true,无需 API Key)→ 关注 OAuth 令牌、订阅状态
  • 备用模型链 → 关注 fallback 切换是否正常

不需要任何预定义修复脚本,AI 自己决定修什么、怎么修。

步骤 3: 发到 Agent 绑定的通道(必须执行)

修复完成后,必须发到当前 agent 绑定的通道。

  1. 读取 openclaw.jsonagents.bindings,找到当前 agent 绑定的通道
  2. 调用 sessions_list({ activeWithinSeconds: 3600 }) 获取活跃会话
  3. session key 格式: agent:AGENT_ID:CHANNEL_NAME:TYPE:USER_ID → 按 CHANNEL_NAME 匹配
  4. 调用 sessions_send({ sessionKey, message }) 发送报告
  5. 找不到会话则直接输出报告摘要作为本 agent 的回复

支持任意通道:feishu / openclaw-weixin / telegram / discord / slack / 其他

步骤 4: 保存报告

REPORT_PATH="${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/rocky-evo-report.md"
# 保存报告到 $REPORT_PATH

触发方式

  • 用户发送 /rocky-evo/自动修复 手动触发
  • Cron 定时每4小时自动触发

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Gateway Auto-Fix

Automatically monitor OpenClaw gateway status and fix when RPC probe fails. Uses OpenClaw cron system - just install and it works!

Registry SourceRecently Updated
6200Profile unavailable
Automation

OpenClaw Auto‑Updater (Safe + Scheduled + Summary)

Schedule automatic OpenClaw and skill updates with reliable cron templates, timezone-safe scheduling, and clear summary outputs. Use for hands-off maintenance, scheduled upgrades, and concise update reports.

Registry SourceRecently Updated
12.8K13Profile unavailable
General

OpenClaw Skill Growth

Make OpenClaw Skills observable, diagnosable, and safely improvable over time. Use this when the user wants to maintain many SKILL.md files, inspect repeated...

Registry SourceRecently Updated
4271Profile unavailable
General

Openclaw Ai Doctor

OpenClaw AI 智能体专科医生,专治各类智能体故障。包括启动报错、任务卡死、工具失效、显存溢出、记忆丢失、逻辑崩坏等。提供标准化诊疗流程:问诊→体检→确诊→治疗→复诊。

Registry SourceRecently Updated
780Profile unavailable