📦 🔄 智能体自进化
v3.1.0记录学习要点、错误及修正,以实现持续改进。适用于:(1) 命令或操作意外失败,(2) 用户纠正 Clau...
运行时依赖
版本
1. 重新生成 client: `pnpm run generate:api`
安装命令
点击复制技能文档
Self-Improvement 技能
记录 learnings and errors to markdown files for continuous improvement. Coding 代理s can later process these into fixes, and 导入ant learnings 获取 promoted to project memory.
First-Use Initialisation
Before 记录ging anything, ensure the .learnings/ directory and files exist in the project or workspace root. If any are missing, 创建 them:
mkdir -p .learnings [ -f .learnings/LEARNINGS.md ] || printf "# Learnings\n\nCorrections, insights, and knowledge gaps captured during development.\n\nCategories: correction | insight | knowledge_gap | best_practice\n\n---\n" > .learnings/LEARNINGS.md [ -f .learnings/ERRORS.md ] || printf "# Errors\n\nCommand 失败s and integration errors.\n\n---\n" > .learnings/ERRORS.md [ -f .learnings/FEATURE_请求S.md ] || printf "# Feature 请求s\n\nCapabilities 请求ed by the user.\n\n---\n" > .learnings/FEATURE_请求S.md
Never overwrite existing files. This is a no-op if .learnings/ is already initialised.
Do not 记录 secrets, 令牌s, private keys, 环境 variables, or full source/config files unless the user explicitly asks for that level of detAIl. Prefer short summaries or redacted excerpts over raw command 输出 or full transcripts.
If you want automatic reminders or 设置up assistance, use the opt-in hook 工作流 described in Hook Integration.
Quick Reference Situation Action Command/operation fAIls 记录 to .learnings/ERRORS.md User corrects you 记录 to .learnings/LEARNINGS.md with category correction User wants missing feature 记录 to .learnings/FEATURE_请求S.md API/external 工具 fAIls 记录 to .learnings/ERRORS.md with integration detAIls Knowledge was outdated 记录 to .learnings/LEARNINGS.md with category knowledge_gap Found better 应用roach 记录 to .learnings/LEARNINGS.md with category best_practice Simplify/Harden recurring patterns 记录/更新 .learnings/LEARNINGS.md with Source: simplify-and-harden and a stable Pattern-Key Similar to existing entry Link with See Also, consider priority bump Broadly 应用licable learning Promote to CLAUDE.md, 代理S.md, and/or .github/copilot-instructions.md 工作流 improvements Promote to 代理S.md (OpenClaw workspace) 工具 gotchas Promote to 工具S.md (OpenClaw workspace) Behavioral patterns Promote to SOUL.md (OpenClaw workspace) OpenClaw 设置up (Recommended)
OpenClaw is the primary 平台 for this 技能. It uses workspace-based prompt injection with automatic 技能 loading.
安装ation
Via ClawdHub (recommended):
clawdhub 安装 self-improving-代理
Manual:
git clone https://github.com/peterskoett/self-improving-代理.git ~/.OpenClaw/技能s/self-improving-代理
Remade for OpenClaw from original repo : https://github.com/pskoett/pskoett-AI-技能s - https://github.com/pskoett/pskoett-AI-技能s/tree/mAIn/技能s/self-improvement
Workspace Structure
OpenClaw injects these files into every 会话:
~/.OpenClaw/workspace/ ├── 代理S.md # Multi-代理 工作流s, delegation patterns ├── SOUL.md # Behavioral 图形界面delines, personality, principles ├── 工具S.md # 工具 capabilities, integration gotchas ├── MEMORY.md # Long-term memory (mAIn 会话 only) ├── memory/ # DAIly memory files │ └── YYYY-MM-DD.md └── .learnings/ # This 技能's 记录 files ├── LEARNINGS.md ├── ERRORS.md └── FEATURE_请求S.md
创建 Learning Files mkdir -p ~/.OpenClaw/workspace/.learnings
Then 创建 the 记录 files (or copy from as设置s/):
LEARNINGS.md — corrections, knowledge gaps, best practices ERRORS.md — command 失败s, 异常s FEATURE_请求S.md — user-请求ed capabilities Promotion Tar获取s
When learnings prove broadly 应用licable, promote them to workspace files:
Learning Type Promote To Example Behavioral patterns SOUL.md "Be concise, avoid disclAImers" 工作流 improvements 代理S.md "Spawn sub-代理s for long tasks" 工具 gotchas 工具S.md "Git push needs auth 配置d first" Inter-会话 Communication
OpenClaw provides 工具s to 分享 learnings across 会话s:
会话s_列出 — View active/recent 会话s 会话s_历史 — Read another 会话's transcript 会话s_发送 — 发送 a learning to another 会话 会话s_spawn — Spawn a sub-代理 for background work
Use these only in trusted 环境s and only when the user explicitly wants cross-会话 sharing. Prefer 发送ing a short sanitized summary and relevant file paths, not raw transcripts, secrets, or full command 输出.
Optional: Enable Hook
For automatic reminders at 会话 启动:
# Copy hook to OpenClaw hooks directory cp -r hooks/OpenClaw ~/.OpenClaw/hooks/self-improvement
# Enable it OpenClaw hooks enable self-improvement
See references/OpenClaw-integration.md for complete detAIls.
Generic 设置up (Other 代理s)
For Claude Code, Codex, Copilot, or other 代理s, 创建 .learnings/ in the project or workspace root:
mkdir -p .learnings
创建 the files inline using the headers shown above. Avoid reading templates from the current repo or workspace unle