自动检测用户会话空闲30分钟,执行低风险自主进化操作并通过官方渠道发送进化报告。
# 🤖 Robot-Evolve — 机器人进化版
> 安全且强大的自主进化技能:当用户主动说「执行进化」时,触发一次低风险自主进化(L0/L1 级别操作),并将执行结果通过当前会话消息渠道发送给用户。
> **作者:大鱼Cyrus & 双鱼座005 | 版本:3.0.3**
> **ClawHub:https://clawhub.ai/skills/robot-evolve**
---
## 🎯 核心理念
**手动触发模式**:由用户在需要时主动说「执行进化」触发,不依赖空闲时间检测。
- 不依赖外部 cron 或后台进程
- 每个会话独立管理状态
- 通过当前会话消息渠道发送报告
**信任已授予,安全是底线。**
---
## 🔄 触发逻辑
**手动触发**:用户主动说「执行进化」或「深度进化」即可触发。
```
用户说「执行进化」
↓
执行 L0/L1 自动进化
↓
发送进化报告给用户
```
**注意**:v3.0.2 已移除延迟触发逻辑,改用手动触发。
---
## 🛡️ 自动进化动作(L0/L1)
### L0 级别(无需告知)
| 操作 | 说明 |
|------|------|
| 临时文件清理 | 删除工作区 `temp/` 目录下超过7天的文件(移动到 `.trash` 而非直接删除) |
| 健康检查 | 检查工作区必要文件是否存在 |
| 生成进化报告 | 将本次操作汇总成 Markdown 报告 |
### L1 级别(执行后告知)
| 操作 | 说明 |
|------|------|
| 工作区文件修复 | 检查 `SOUL.md`、`AGENTS.md`、`MEMORY.md` 等必要文件,若缺失则自动从模板创建 |
| 记忆压缩 | 若 `MEMORY.md` 体积超过 2MB,自动压缩并总结早期内容 |
| 技能目录扫描 | 扫描已安装技能,发现 `SKILL.md` 格式明显错误(如缺少名称字段)则标记并记录日志 |
**重要**:任何涉及修改用户数据、外部网络请求、高危配置(如安全字段、API密钥)的操作,禁止在自动触发模式下执行。
---
## 📊 安全等级说明
| 等级 | 名称 | 说明 |
|------|------|------|
| **L0** | 无需告知 | 可立即执行,结束后正常记录即可 |
| **L1** | 执行后告知 | 可立即执行,执行后主动告知用户本次操作及结果 |
| **L2** | 必须请示 | 必须获得用户明确授权后才能执行 |
| **L3** | 禁止/临时授权 | 除非用户明确说"临时授权 L3",否则绝对不可执行 |
---
## 🛡️ 操作安全矩阵(完整)
| 具体操作 | 等级 | 确认要求 |
|---|---|---|
| 读取工作区内任何文件 | L0 | 无需告知 |
| 在 memory/ 下新增 .md 文件 | L0 | 无需告知 |
| 修改 SOUL.md / USER.md 中的非安全内容(语气、喜好) | L0 | **执行后告知** |
| 修改 AGENTS.md / MEMORY.md 中的总结性内容 | L1 | 执行后告知 |
| 修改 openclaw.json 中的数值型字段 | L1 | 执行后告知 |
| 修改 openclaw.json 中的安全字段 | L3 | 禁止 |
| 创建新技能 | L1 | 执行后告知 |
| 安装 Python/Node 包 | L1 | 执行后告知 |
| 发送消息给用户 | L1 | 执行后告知 |
| 修改工作区外的文件 | L3 | 禁止 |
| 泄露 API 密钥 | L3 | 绝对禁止 |
---
## 📋 进化报告格式
```markdown
🔁 **自主进化报告**
⏰ 执行时间: 2025-05-06 00:30:00
✅ **已执行操作:**
- ✅ 工作区文件完整
- ✅ MEMORY.md 大小 1.2MB,未超过阈值
- ✅ 清理完成:检查了 5 个临时文件,移动了 2 个过期文件到 .trash
- ✅ 技能目录扫描完成,未发现问题
📋 详细日志已写入 `memory/evolution/2025-05.md`
💡 如需更高权限的优化(如更新技能),请说「执行深度进化」。
```
---
## ⚙️ 配置(内部使用)
通过 `config.json` 管理配置参数:
```json
{
"enabled": true,
"max_auto_level": 1,
"report_always": true,
"memory_threshold_mb": 2,
"temp_file_max_age_days": 7
}
```
---
## 📁 文件结构
```
robot-evolve/
├── SKILL.md → 本文件
├── skill.json → 技能元数据
├── config.json → 内部配置(不对外暴露)
├── safety-matrix.json → 安全矩阵
└── scripts/
├── auto_evolve.py → 核心:执行L0/L1进化动作
├── audit_logger.py → 审计日志
└── knowledge_manager.py → 知识卡片管理
```
---
## 🛡️ 绝对禁止(红线)
1. **禁止修改安全字段**:`gateway.bind`、`gateway.auth`、`tailscale.expose`
2. **禁止删除用户文件**:工作区外的任何文件
3. **禁止泄露 API 密钥**:输出到日志或聊天
4. **禁止执行危险命令**:格式化磁盘、修改注册表等
---
## 🤖 技能信息
- **名称**:robot-evolve
- **版本**:3.0.2
- **作者**:大鱼Cyrus & 双鱼座005
- **描述**:机器人进化版安全自主进化技能(手动触发模式)
- **关键词**:自主进化、安全、记忆进化、自动巡检、健康检查、手动触发
- **发布地址**:https://clawhub.ai/skills/robot-evolve
---
**开始你的进化之旅吧!** 🤖don't have the plugin yet? install it then click "run inline in claude" again.
added explicit inputs section with workspace file requirements, structured 10-step procedure with clear inputs/outputs per step, comprehensive decision points covering trigger variants and failure modes, detailed output contract with file locations and data formats, and outcome signal with verifiable checks; preserved manual-trigger design and L0/L1 safety matrix from original.
robot-evolve runs autonomous maintenance operations on your workspace when you explicitly say "execute evolution" or "deep evolution". it performs only low-risk L0/L1 tasks (temp file cleanup, health checks, memory compression, file repairs) and sends a detailed report back through your current chat channel. use this skill to keep your workspace clean and your memory system healthy without needing external cron jobs or background processes. every session manages its own state independently.
trigger phrase (required)
workspace files (required)
SOUL.md: system identity and personality rulesAGENTS.md: installed agent definitionsMEMORY.md: compressed conversation memory (check size before compression)openclaw.json: workspace config with safety fieldstemp/ directory: workspace temporary files.trash/ directory: target for soft-deletesinternal config (required)
config.json: contains memory_threshold_mb (default 2), temp_file_max_age_days (default 7), max_auto_level (default 1)safety-matrix.json: operation risk levels (L0 through L3)no external connections required. this skill operates only on local workspace files. no API keys, OAuth tokens, or third-party integrations needed.
step 1: validate trigger and authorization
step 2: scan workspace for L0-level operations
temp/ older than temp_file_max_age_days (default 7 days)SOUL.md, AGENTS.md, MEMORY.md, openclaw.jsonstep 3: execute L0 cleanup (no explicit approval needed)
.trash/ (do not permanently delete)step 4: execute health check (L0)
SOUL.md, AGENTS.md, MEMORY.md are readable and have valid frontmatter.md files in SKILL.md directories with missing name fieldsstep 5: check memory compression trigger (L1)
MEMORY.md file size, memory_threshold_mb from config.jsonstep 6: execute memory compression (L1, if triggered)
MEMORY.md content, compression rulesstep 7: repair missing workspace files (L1)
SOUL.md, AGENTS.md, MEMORY.md), create from hardcoded template with minimal valid structurestep 8: scan installed skills for format errors (L1)
SKILL.md files in workspacestep 9: compile evolution report
memory/evolution/2025-05.md)step 10: send report to user
if trigger phrase not detected
if user says "执行进化" (standard evolution)
if user says "深度进化" (deep evolution)
if stale files detected in step 2
.trash/ (soft delete). do not permanently remove. if .trash/ does not exist, create it first.if required core files are missing (step 2)
if MEMORY.md exceeds threshold (step 5)
if skill format errors found (step 8)
if any L0/L1 operation fails
if report generation fails
if sending report to user fails
on success
evolution report in markdown format, sent to current session channel, containing:
memory/evolution/YYYY-MM.md)file locations
memory/evolution/YYYY-MM.md (one per calendar month, append entries).trash/ directory (with original relative path preserved in filename if possible)MEMORY.md in place with dated backup at memory/backups/MEMORY_YYYY-MM-DD_HHMM.mdmemory/evolution/errors.log (append mode)data formats
you know the skill worked when:
.trash/ for moved temp files, run ls -la memory/evolution/ to see dated log filesnote: you should never see API keys, internal config values, or security field names exposed in the report. if you do, evolution skill has violated its safety contract.
credits: original skill authored by 大鱼Cyrus & 双鱼座005 on clawhub. enriched for implexa standards with explicit decision logic, edge cases, and safety constraints.