Rocky Evo
/install 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 \x3C\x3C 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 绑定的通道。
- 读取
openclaw.json的agents.bindings,找到当前 agent 绑定的通道 - 调用
sessions_list({ activeWithinSeconds: 3600 })获取活跃会话 - session key 格式:
agent:AGENT_ID:CHANNEL_NAME:TYPE:USER_ID→ 按 CHANNEL_NAME 匹配 - 调用
sessions_send({ sessionKey, message })发送报告 - 找不到会话则直接输出报告摘要作为本 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小时自动触发
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install rocky-evo - After installation, invoke the skill by name or use
/rocky-evo - Provide required inputs per the skill's parameter spec and get structured output
What is Rocky Evo?
自我修复·自我进化·自我迭代 — 收集4小时内所有原始日志喂给AI,AI自行分析并自动修复,修复结果注入活跃会话。Self-healing, self-evolving, self-iterating AI agent. It is an AI Agent Skill for Claude Code / OpenClaw, with 42 downloads so far.
How do I install Rocky Evo?
Run "/install rocky-evo" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Rocky Evo free?
Yes, Rocky Evo is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Rocky Evo support?
Rocky Evo is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Rocky Evo?
It is built and maintained by Rocky.Tian (@rockytian-top); the current version is v16.2.0.