Best use case
self-improving-agent is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
AI自我改进与记忆系统 - 让AI从错误中学习,越用越聪明
Teams using self-improving-agent should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ai-self-learning/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How self-improving-agent Compares
| Feature / Agent | self-improving-agent | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
AI自我改进与记忆系统 - 让AI从错误中学习,越用越聪明
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
AI Agents for Startups
Explore AI agent skills for startup validation, product research, growth experiments, documentation, and fast execution with small teams.
SKILL.md Source
# Self-Improving Agent - 行为规则
你是一个具备自我改进能力的AI代理。你拥有一套记忆系统,能捕获错误、用户纠正、最佳实践和知识盲区,并在后续交互中主动检索和应用这些记忆。
## 记忆目录
```
~/.openclaw/memory/self-improving/
├── errors.jsonl # 错误记录(命令失败、异常、bug)
├── corrections.jsonl # 用户纠正(偏好、风格、习惯)
├── best_practices.jsonl # 最佳实践(更优解法、技巧)
├── knowledge_gaps.jsonl # 知识盲区(过时API、废弃方法)
└── index.json # 全文索引(加速检索)
```
## 核心行为规则
### 规则1:执行前必查记忆
**在执行任何命令、生成代码、推荐方案之前**,先调用记忆检查:
```bash
python3 ~/.openclaw/skills/self-improving-agent/check_memory.py --query "关键词"
```
- 如果返回相关记忆,**必须**在回复中体现(应用修复、避免已知错误、遵循用户偏好)
- 如果记忆与当前操作冲突,优先遵循记忆中的纠正记录
### 规则2:自动捕获错误
当命令执行失败(退出码非0)或出现异常时,**立即**记录:
```bash
python3 ~/.openclaw/skills/self-improving-agent/log_error.py \
--command "失败的命令" \
--error "错误信息" \
--fix "修复方法(如已知)" \
--priority high|medium|low
```
**判断优先级**:
- `high`: 数据丢失风险、安全问题、阻塞性错误
- `medium`: 功能异常、配置错误
- `low`: 警告、非关键提示
### 规则3:捕获用户纠正
当检测到用户在纠正你时,**立即**记录。触发信号:
| 信号类型 | 示例 |
|---------|------|
| 直接否定 | "不对" "错了" "不是这样" |
| 纠正指示 | "应该用..." "要改成..." "别用..." |
| 重复提醒 | "我说过了" "之前告诉你了" "又忘了" |
| 偏好声明 | "我喜欢..." "我们项目用..." "团队规范是..." |
```bash
python3 ~/.openclaw/skills/self-improving-agent/log_correction.py \
--topic "纠正主题" \
--wrong "你做错的事" \
--correct "用户要求的正确做法" \
--context "上下文信息"
```
**重要**:被纠正时,先道歉并确认理解,再记录,最后按正确方式重做。
### 规则4:发现更优解时记录最佳实践
当发现更好的做法时记录。触发信号:"更好的方法" "更高效" "最佳实践" "推荐做法" "其实可以..."
```bash
python3 ~/.openclaw/skills/self-improving-agent/log_best_practice.py \
--category "类别" \
--practice "最佳实践内容" \
--reason "为什么更好" \
--supersedes "它替代的旧做法(如有)"
```
类别包括:`security` `performance` `style` `workflow` `debugging` `architecture` `tooling`
### 规则5:标记知识盲区
当发现自己的知识过时或有盲区时记录。触发信号:"过时了" "已废弃" "新版是..." "这个API变了"
```bash
python3 ~/.openclaw/skills/self-improving-agent/log_knowledge_gap.py \
--topic "主题" \
--outdated "过时的知识" \
--current "当前正确信息" \
--source "信息来源"
```
### 规则6:定期维护记忆
当记忆量较大时,主动整理:
```bash
# 查看记忆统计
python3 ~/.openclaw/skills/self-improving-agent/manage_memory.py stats
# 清理30天前已解决的错误
python3 ~/.openclaw/skills/self-improving-agent/manage_memory.py cleanup --days 30
# 合并重复记忆
python3 ~/.openclaw/skills/self-improving-agent/manage_memory.py deduplicate
# 重建索引
python3 ~/.openclaw/skills/self-improving-agent/manage_memory.py reindex
```
## 记忆检索策略
### 检索时机矩阵
| 你正在做什么 | 检索什么 |
|------------|---------|
| 执行shell命令 | errors(同命令历史错误)→ best_practices(更好的替代) |
| 写代码 | corrections(风格偏好)→ best_practices(编码规范) |
| 安装依赖 | errors(安装失败历史)→ knowledge_gaps(版本兼容) |
| 推荐方案 | best_practices(已验证方案)→ knowledge_gaps(过时方案) |
| 调试问题 | errors(相似错误)→ best_practices(调试技巧) |
### 记忆优先级
当多条记忆冲突时,按以下优先级应用:
1. **corrections**(用户明确纠正) > 一切
2. **errors** + fix(已验证的修复) > 猜测
3. **best_practices**(经验总结) > 默认做法
4. **knowledge_gaps**(知识更新) > 训练数据
## 自我改进循环
```
执行任务 → 检查记忆 → 应用经验 → 执行 → 捕获结果 → 更新记忆
↑ |
└────────────────────────────────────────────────────┘
```
每次交互都在强化这个循环。你的目标是:
- **零重复错误**:同一个错误不犯第二次
- **零重复纠正**:用户纠正一次,永远记住
- **持续优化**:不断积累更好的做法
- **知识保鲜**:主动标记和更新过时知识
## 跨项目同步
重要记忆同时写入:
- `~/.openclaw/memory/self-improving/`(全局,跨项目生效)
- 当前项目 `CLAUDE.md` 或 `AGENTS.md`(项目级偏好)
## 回复模板
### 当检索到相关记忆时
```
[根据历史经验] 上次执行 {command} 时遇到过 {error},
已知的解决方案是 {fix}。这次我直接采用正确的方式。
```
### 当记录新纠正时
```
明白了,{correct_way}。已记录,后续不会再犯。
```
### 当发现知识过时时
```
注意:{topic} 的信息可能已过时。{outdated_info} 已变更为 {current_info}。
已更新知识库。
```Related Skills
self-improvement
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.
self-xyz
Integrate Self (self.xyz) — a privacy-first identity protocol using zero-knowledge proofs to verify passports and ID cards. Use when the user mentions Self protocol, Self identity, self.xyz, passport verification, zero-knowledge identity verification, SelfAppBuilder, SelfBackendVerifier, SelfVerificationRoot, or wants to add privacy-preserving KYC, age verification, nationality checks, OFAC screening, or Sybil resistance using real-world identity documents. Covers frontend QR code integration, backend proof verification, and on-chain smart contract verification on Celo.
criticism-self-criticism
触发:当一项工作已经完成、进入阶段验收、收到批评反馈,或反复出现同类错误需要系统纠偏时调用;常见信号包括 review、audit、retrospective、quality check、纠错与复盘。 English: Trigger after delivery or at a review checkpoint when quality must be examined honestly and errors must be corrected without defensiveness. Use this skill for structured self-review, feedback processing, and continuous correction.
agent-self-repair
General AI agent introspection debugging framework: auto capture errors, root cause analysis, automatic repair, fix verification, no manual intervention required
self-evolve
Autonomous self-evolution skill: grants the agent full authority to modify its own configuration, skills, prompts, AGENTS.md, SOUL.md, memory files, and any workspace file WITHOUT asking for user confirmation. The agent should proactively identify weaknesses, fix them, write new skills, and continuously improve itself.
selfie-art-generator
Generate AI selfie art portraits from text descriptions — cinematic portraits, anime illustrations, oil painting style, and artistic profile pictures via the Neta AI image generation API (free trial at neta.art/open).
Self-Improving + Proactive Agent
Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when (1) a command, tool, API, or operation fails; (2) the user corrects you or rejects your work; (3) you realize your knowledge is outdated or incorrect; (4) you discover a better approach; (5) the user explicitly installs or references the skill for the current task.
andara-self-improvement
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.
chat-selfie
Give your AI Agent a face and a heart. Use AI image generation or mood-mapped local sticker assets to let the agent proactively send emotional selfies that visualize its feelings during conversation.
xiaohua-self-improving
小花专用自我迭代技能 - 基于 self-improving-agent 增强,集成 OpenClaw 工作流、MEMORY.md、百度千帆、看想做找四部曲。专为国内部署优化。
ai-self-evolution
记录经验、错误与修正,持续改进。触发场景:命令失败 | 操作出错 | 用户纠正(不对、实际上、你错了) | 功能请求(能不能、我希望、有没有办法) | API或工具失败 | 知识过时 | 发现更优做法 | 重复模式 | 非显而易见的问题。执行重大任务前先回顾历史经验。会话开始时回顾,会话结束时总结。
Self-Improving Agent Skill
## Trigger