Skill Experience Layer - 技能经验分层机制
What it does
Give your agent permanent, per-skill experience memory that:
- 1. Pre-call checking: Before you call any skill, automatically read the common mistakes and best practices so you avoid repeating the same pitfalls
- Error-driven learning: When you make a mistake, immediately record it to the corresponding skill's experience file
- Automatic evolution: Integrates with
capability-evolver to automatically improve experience when mistakes repeat - Fits existing memory architecture: Works with your existing (instant → hot → short-term → long-term) memory hierarchy
Why this is different
| Approach | Traditional | skill-experience-layer |
|---|
| When lessons are applied | After mistake (retrospective) | Before next call (preventive) |
| Experience storage |
Global reflection | Per-skill JSON files, easy to evolve |
| Integration | Self-contained, requires manual integration | Designed to fit your existing memory hierarchy |
| Automatic evolution | No built-in support | First-class integration with capability-evolver |
Workflow
1. For every skill you use
When you install a new skill:
- - Create INLINECODE1
- Define
commonMistakes[] and INLINECODE3 - Before every invocation, read it and remind yourself what to avoid
2. When you make a mistake
- 1. Stop immediately, don't keep retrying
- Record the mistake in INLINECODE4
- Update the skill's experience JSON:
- Add new entry to
experiences[] with context, lesson, prevention
- Update
commonMistakes[] if it's a new pattern
- Increment
failureCount
- 4. If the same mistake repeats 2+ times, trigger
capability-evolver to automatically improve the experience and best practices - Retry after updating
3. Regular maintenance
- - Daily: End-of-day review mistakes, update experiences
- Weekly: Promote key lessons to long-term memory in MEMORY.md
- Automatic: capability-evolver can continuously improve stale experiences
Example experience file
CODEBLOCK0
Integration with existing systems
Works great with:
- - self-improving: Uses the correction/reflection workflow
- capability-evolver: Automatic experience improvement when mistakes repeat
- Your existing memory hierarchy: Experiences live in
memory/experiences/, fits alongside your daily/weekly memory
Safety Boundaries
- - ✅ Only modifies experience files in
memory/experiences/ and skill-owned files - ✅ Never touches core root files (
MEMORY.md, SOUL.md, IDENTITY.md, USER.md, .env) — reads but does not write - ✅ Never accesses sensitive directories (
~/.ssh, ~/.aws, /etc) - ✅ All automatic changes are backed up before applying, can roll back
- ✅ High-risk changes require human approval
Author
Created from practical experience integrating self-improvement into a working agent. This is the missing glue between general self-improving frameworks and your actual daily usage.
Get smarter with every mistake, don't repeat the same pit twice.
Skill Experience Layer - 技能经验分层机制
功能说明
为你的智能体提供永久性的、按技能分类的经验记忆,实现以下功能:
- 1. 调用前检查:在调用任何技能前,自动读取常见错误和最佳实践,避免重复踩坑
- 错误驱动学习:当出现错误时,立即将其记录到对应技能的经验文件中
- 自动进化:与capability-evolver集成,当错误重复出现时自动优化经验
- 适配现有记忆架构:与你现有的(即时→热→短期→长期)记忆层级体系协同工作
独特优势
| 对比项 | 传统方案 | skill-experience-layer |
|---|
| 经验应用时机 | 错误之后(回顾式) | 下次调用前(预防式) |
| 经验存储方式 |
全局反思 | 按技能分类的JSON文件,易于进化 |
| 集成方式 | 独立模块,需手动集成 | 设计适配现有记忆层级体系 |
| 自动进化 | 无内置支持 | 与capability-evolver深度集成 |
工作流程
1. 针对每个使用的技能
安装新技能时:
- - 创建 memory/experiences/{技能名称}.json
- 定义 commonMistakes[] 和 bestPractices[]
- 每次调用前,读取该文件并提醒自己需要避免的问题
2. 出现错误时
- 1. 立即停止,不要持续重试
- 在 self-improving/corrections.md 中记录错误
- 更新技能的经验JSON文件:
- 在 experiences[] 中添加新条目,包含上下文、教训和预防措施
- 如果是新错误模式,更新 commonMistakes[]
- 增加 failureCount
- 4. 如果同一错误重复出现2次以上,触发 capability-evolver 自动优化经验和最佳实践
- 更新后重新尝试
3. 定期维护
- - 每日:下班前回顾错误,更新经验
- 每周:将关键经验提升至MEMORY.md中的长期记忆
- 自动:capability-evolver可持续优化过时的经验
经验文件示例
json
{
type: skill,
name: my-skill,
lastUpdated: 2026-03-17T19:00:00+08:00,
totalExecutions: 10,
successCount: 8,
failureCount: 2,
experiences: [
{
id: exp-my-skill-001,
timestamp: 2026-03-10T20:00:00+08:00,
context: 错误发生时的操作场景,
lesson: 学到的经验教训,
severity: medium,
timesRepeated: 1,
prevention: 下次应采取的改进措施
}
],
patterns: {
commonMistakes: [
需要避免的第一个常见错误,
需要避免的第二个常见错误
],
bestPractices: [
第一个最佳实践,
第二个最佳实践
]
}
}
与现有系统的集成
完美适配以下系统:
- - self-improving:使用修正/反思工作流
- capability-evolver:错误重复时自动优化经验
- 现有记忆层级体系:经验存储在 memory/experiences/ 中,与每日/每周记忆并存
安全边界
- - ✅ 仅修改 memory/experiences/ 和技能自有文件中的经验文件
- ✅ 绝不触碰核心根文件(MEMORY.md、SOUL.md、IDENTITY.md、USER.md、.env)——只读不写
- ✅ 绝不访问敏感目录(~/.ssh、~/.aws、/etc)
- ✅ 所有自动更改在应用前都会备份,可回滚
- ✅ 高风险更改需人工审批
作者说明
基于将自我改进集成到实际智能体中的实践经验创建。这是连接通用自我改进框架与日常实际使用之间的关键纽带。
从每个错误中变得更聪明,不要两次掉进同一个坑。