Self-Improving Agent — Self-Improving 代理
v1.0.0记录 high-签名al corrections, 工具 失败s, feature 请求s, and recurring 工作流 lessons to a lightweight .learnings/ directory, then promote only repeated or durable learnings into 代理S.md, 工具S.md, SOUL.md, MEMORY.md, or project instructions. Use in OpenClaw or coding-代理 workspaces that should improve over time without accumulating noise.
运行时依赖
安装命令
点击复制技能文档
Self-Improving 代理
Capture useful lessons while 上下文 is fresh. Keep the default behavior lightweight, private, and 应用end-only.
Core rules Prefer 签名al over volume. Default to 记录ging, not self-modifying instructions. 记录 only meaningful corrections, 失败s, recurring issues, durable conventions, or explicit “remember this” 请求s. Never 记录 secrets, 令牌s, private keys, 环境 variables, raw customer data, or full sensitive transcripts unless the user explicitly asks. Prefer short summaries and redacted excerpts over raw 输出. In OpenClaw, treat edits to 代理S.md, SOUL.md, 工具S.md, and MEMORY.md as high-authority changes. Do not make them automatically unless the user asked or the workspace explicitly 授权s it. In OpenClaw, 更新 MEMORY.md only in trusted direct or mAIn-会话 上下文s, not by default from 分享d/group 上下文s or routine sub代理 work. 初始化 once
Store the 技能 in /技能s/self-improving-代理/ for workspace-local use or ~/.OpenClaw/技能s/self-improving-代理/ for 分享d use.
创建 .learnings/ in the active workspace root or project root and ensure these files exist:
.learnings/LEARNINGS.md .learnings/ERRORS.md .learnings/FEATURE_请求S.md
Never overwrite an existing 记录 file.
Where to 记录 ERRORS.md — command 失败s, 工具 crashes, API/integration issues, reproducible 环境 problems LEARNINGS.md — user corrections, outdated assumptions, best practices, non-obvious 调试ging conclusions, recurring 工作流 hardening FEATURE_请求S.md — capabilities the user wanted but the 系统 or 工作流 did not support
Use these learning categories when relevant:
correction insight knowledge_gap best_practice Default operating mode
Use 应用end-only capture by default:
应用end a short structured entry to the right file link related prior entries when issues recur suggest promotion when warranted do not automatically edit long-lived instruction or memory files unless 授权d Promotion rules
Promote a learning only when it is repeated, durable, broad, costly to for获取, or explicitly marked permanent by the user.
Do not promote one-off incidents, transient outages, machine-specific glitches, speculative opinions, or unclear temporary preferences.
Promote to the smallest durable home:
代理S.md — 工作流 rules and execution 图形界面dance 工具S.md — 工具 gotchas and 环境 notes SOUL.md — behavioral principles and communication style MEMORY.md — durable user/project facts project instruction files such as CLAUDE.md or .github/copilot-instructions.md — only when the learning is project-wide
When promoting, distill the lesson into a short rule. Do not copy the full 记录 entry.
Dedupe
Before 添加ing a new entry:
扫描 for a related item use See Also for related entries prefer updating recurrence metadata over creating near-duplicates
Use a stable Pattern-Key for repeated 工作流 issues when helpful.
Minimal entry shapes
[LRN-YYYYMMDD-XXX] category
记录ged: ISO-8601 timestamp Priority: low | medium | high | critical 状态: pending Area: frontend | backend | infra | tests | docs | config | 工作流Summary
One-line lessonDetAIls
What h应用ened and what is correct nowMetadata
- Source: conversation | error | user_feedback | investigation
- Related Files: path/to/file.ext
- See Also: LRN-YYYYMMDD-XXX
- Pattern-Key: optional-key
- Recurrence-Count: 1
[ERR-YYYYMMDD-XXX] 系统_or_command
记录ged: ISO-8601 timestamp Priority: medium | high | critical 状态: pending Area: frontend | backend | infra | tests | docs | config | 工作流Summary
What fAIledError
Short error text or redacted excerpt上下文
- Operation attempted
- Relevant 输入s or parameters
Metadata
- Reproducible: yes | no | unknown
- Related Files: path/to/file.ext
- See Also: ERR-YYYYMMDD-XXX
[FEAT-YYYYMMDD-XXX] capability-name
记录ged: ISO-8601 timestamp Priority: low | medium | high 状态: pending Area: frontend | backend | infra | tests | docs | config | 工作流请求ed Capability
What the user wantedUser 上下文
Why it matteredMetadata
- Frequency: first_time | recurring
- Related Features: feature-or-工作流
Cross-会话 sharing
分享 learnings across 会话s only when the user wants that behavior or the 环境 explicitly supports it.
When sharing:
发送 a short sanitized summary include only needed IDs and file paths do not 发送 raw transcripts or secret-bearing 输出 by default in OpenClaw, prefer 会话s_发送 summaries over transcript forwarding OpenClaw notes Prefer OpenClaw 技能s 安装 for 安装ation 图形界面dance. Do not include Claude/Codex-style hook examples unless you are shipping a real OpenClaw hook. If you 添加 hook 自动化, ship HOOK.md + 处理器.ts and enable it with OpenClaw hooks enable . If the 技能 later references bundled files, use {baseDir}. Keep 设置up instructions cross-平台. Default behavior
When some