Self-Improvement Agent Skill
当 Agent 需要从任务执行中学习并自我优化时,激活此技能。
by brandon114 · published 2026-03-22
$ claw add gh:brandon114/brandon114-self-improving-agent-python# Self-Improvement Agent Skill
当 Agent 需要从任务执行中学习并自我优化时,激活此技能。
---
激活条件
用户提到以下关键词时激活:
---
核心概念
Agent 不应该只是执行任务,还应该从执行中学习,不断优化自己的表现。
三层自我改进机制:
1. **Layer 1: 实时反馈循环** - 每次任务执行后立即评估
2. **Layer 2: 周期性深度反思** - 定期深度分析
3. **Layer 3: 跨 Agent 经验共享** - 共享学习成果
---
任务评估标准
评分公式
总分 = 完成度(30%) + 效率(20%) + 质量(30%) + 满意度(20%)
评分等级
| 分数 | 等级 | 行动 |
|------|------|------|
| ≥90 | 优秀 | 记录最佳实践 |
| 80-89 | 良好 | 继续保持 |
| 70-79 | 及格 | 识别改进点 |
| <70 | 不及格 | 触发深度反思 |
---
使用方法
Python 版本(推荐)
# 评估任务
python scripts/evaluate_task.py \
--agent-id "my-agent" \
--task-id "task-001" \
--task-type "内容创作" \
--completion 90 \
--efficiency 85 \
--quality 80 \
--satisfaction 85
# 记录经验
python scripts/learn_lesson.py \
--agent-id "my-agent" \
--lesson "验证链接有效性" \
--impact high \
--category quality
# 优化分析
python scripts/optimize_agent.py --agent-id "my-agent"
# 跨 Agent 同步
python scripts/sync_learning.py参数说明
**evaluate_task.py**
| 参数 | 说明 | 必填 |
|------|------|------|
| --agent-id | Agent 标识 | 是 |
| --task-id | 任务标识 | 是 |
| --task-type | 任务类型 | 是 |
| --completion | 完成度 (0-100) | 是 |
| --efficiency | 效率 (0-100) | 是 |
| --quality | 质量 (0-100) | 是 |
| --satisfaction | 满意度 (0-100) | 是 |
**learn_lesson.py**
| 参数 | 说明 | 必填 | 可选值 |
|------|------|------|--------|
| --agent-id | Agent 标识 | 是 | |
| --lesson | 经验描述 | 是 | |
| --impact | 影响程度 | 是 | high/medium/low |
| --category | 类别 | 是 | quality/efficiency/tools/knowledge |
---
数据存储位置
{workspace}/
├── self-improvement/
│ ├── evaluations.json # 评估记录
│ ├── lessons-learned.json # 经验库
│ └── optimization-plan.json # 优化计划
└── shared-context/
└── self-improvement/
└── collective-wisdom.json # 共享知识库---
最佳实践
何时评估
如何记录经验
如何应用学习
---
故障排查
| 问题 | 解决 |
|------|------|
| 找不到工作区 | 检查 config.py 中的路径配置 |
| 经验未同步 | 手动运行 sync_learning.py |
| 优化计划生成失败 | 确保有足够的历史评估数据 |
---
*让每个 Agent 都成为终身学习者!*
*Version: 1.1.0 (Python Edition)*
*Tags: agent, self-improvement, learning, optimization*
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...