Auto-Improve
Reads logs, detects patterns, rewrites the playbook. Not passive logging — this ACTS on what it learns.
CODEBLOCK0
Input Sources
| Source | What It Contains |
|---|
| INLINECODE0 | What broke and how it was fixed |
| INLINECODE1 |
Corrections, insights, knowledge gaps, batch outcomes |
|
workspace/OUTSTANDING.md | Ranked ideas and opportunities |
|
memory/permanent/*.md | Current knowledge state |
|
workspace/DELEGATION_PLAN.md | Atom timing data (if delegation was used) |
Step 1: SCAN
Detect:
- - Repeated errors — same mistake 3+ times → needs a prevention rule
- Repeated corrections — user keeps fixing the same thing → behavior change needed
- Emerging patterns — 3+ items connecting → thesis forming
- Stale knowledge — facts in permanent memory contradicted by recent sessions
- Unused wins — high-value items that haven't been acted on
Step 2: PROPOSE
For each detected pattern:
CODEBLOCK1
| Pattern Type | Action | Target File |
|---|
| Repeated error | Add prevention rule | relevant skill's ## Learned section |
| Repeated correction |
Update behavior guideline |
SOUL.md or
AGENTS.md |
| Emerging thesis | Write thesis + next steps |
OUTSTANDING.md |
| Stale knowledge | Update the fact |
memory/permanent/*.md |
| Unused win | Create ticket or reminder |
NEXT_TICKET.md or cron |
Step 3: APPLY
- - Low risk + reversible: Apply immediately. Log the change.
- Medium risk: Apply but notify user on next interaction.
- High risk: Write to
OUTSTANDING.md and wait for approval. - Dry-run mode (
--dry-run): Propose all changes but apply none. Output a report.
Use 3-occurrence threshold before proposing pattern-based changes. Track recurrence with Pattern-Key and Recurrence-Count.
Error→Skill Feedback Loop
After SCAN, for each error in ERRORS.md:
- 1. Extract the
Context column value - Match against skill names (fuzzy: "SiteBlitz CSS" →
webdev-sop) - If match found and skill doesn't already have the fix in
## Learned:
## Learned
- [date] [error summary] → [fix]. Source: .learnings/ERRORS.md#L[N]
- 4. Use
Pattern-Key: hash(error+fix) to prevent duplicates
Skills self-heal: every failure improves the relevant skill.
Delegation Feedback
After delegation plan completes:
- 1. Read atom timing data from DELEGATIONPLAN.md
- Atom actual time > 2× estimated → flag estimation drift
- Atom model upgraded (flash→sonnet) → update routing suggestion in MODELROUTING_PROTOCOL.md
- Append summary to INLINECODE19
技能名称: active-self-improvement
详细描述:
自动改进
读取日志,检测模式,重写操作手册。不是被动记录——而是基于所学内容采取行动。
扫描(读取日志)──► 提议(具体修改)──► 应用(低风险自动执行,高风险标记)
输入来源
| 来源 | 包含内容 |
|---|
| .learnings/ERRORS.md | 出错的环节及修复方式 |
| .learnings/LEARNINGS.md |
修正、洞察、知识缺口、批次结果 |
| workspace/OUTSTANDING.md | 排序后的想法和机会 |
| memory/permanent/*.md | 当前知识状态 |
| workspace/DELEGATION_PLAN.md | 原子任务时间数据(若使用了委派) |
步骤 1:扫描
检测:
- - 重复错误 — 同一错误出现 3 次以上 → 需要预防规则
- 重复修正 — 用户反复修复同一问题 → 需要行为变更
- 新兴模式 — 3 个以上关联项 → 形成论点
- 过时知识 — 永久记忆中的事实与近期会话矛盾
- 未利用的成果 — 尚未执行的高价值项
步骤 2:提议
针对每个检测到的模式:
提议:[简短标题]
证据:[文件#行号引用]
变更:[精确修改 — 旧文本 → 新文本]
风险:[低/中/高]
可逆:[是/否]
模式键:[hash(错误+修复) 用于去重]
| 模式类型 | 操作 | 目标文件 |
|---|
| 重复错误 | 添加预防规则 | 相关技能的 ## Learned 部分 |
| 重复修正 |
更新行为指南 | SOUL.md 或 AGENTS.md |
| 新兴论点 | 撰写论点及后续步骤 | OUTSTANDING.md |
| 过时知识 | 更新事实 | memory/permanent/*.md |
| 未利用的成果 | 创建工单或提醒 | NEXT_TICKET.md 或定时任务 |
步骤 3:应用
- - 低风险 + 可逆:立即应用。记录变更。
- 中风险:应用,但在下次交互时通知用户。
- 高风险:写入 OUTSTANDING.md 并等待批准。
- 试运行模式(--dry-run):提议所有变更但不应用。输出报告。
在提议基于模式的变更前,使用 3 次出现阈值。通过 Pattern-Key 和 Recurrence-Count 跟踪重复情况。
错误→技能反馈循环
扫描后,针对 ERRORS.md 中的每个错误:
- 1. 提取 Context 列的值
- 与技能名称进行模糊匹配(例如:SiteBlitz CSS → webdev-sop)
- 若找到匹配且技能尚未在 ## Learned 中包含该修复:
markdown
## Learned
- [日期] [错误摘要] → [修复]。来源:.learnings/ERRORS.md#L[N]
- 4. 使用 Pattern-Key: hash(错误+修复) 防止重复
技能自我修复:每次失败都会改进相关技能。
委派反馈
委派计划完成后:
- 1. 从 DELEGATIONPLAN.md 读取原子任务时间数据
- 原子任务实际时间 > 2× 预估时间 → 标记估算偏差
- 原子任务模型升级(flash→sonnet)→ 更新 MODELROUTING_PROTOCOL.md 中的路由建议
- 将摘要追加到 .learnings/LEARNINGS.md