self-improving-agent by kimasplund/clawdbot-skills-pack
npx skills add https://github.com/kimasplund/clawdbot-skills-pack --skill self-improving-agent捕获学习成果、错误和修正,实现跨会话的持续改进。
此技能在以下情况自动激活:
| 触发器 | 记录内容 | 位置 |
|---|---|---|
| 命令失败 | 错误类型、上下文、恢复建议 | logs/failures_detailed.jsonl |
| 用户纠正 | "不,那是错的...", "实际上..." | logs/corrections.jsonl |
| 缺少能力 | "你能做 X 吗?" 其中 X 不可用 | logs/missing_capabilities.jsonl |
| API/工具失败 | 失败模式、建议修复 |
Captures learnings, errors, and corrections to enable continuous improvement across sessions.
This skill automatically activates when:
| Trigger | What Gets Logged | Location |
|---|---|---|
| Command fails | Error type, context, recovery suggestion | logs/failures_detailed.jsonl |
| User corrects | "No, that's wrong...", "Actually..." | logs/corrections.jsonl |
| Missing capability | "Can you X?" where X isn't available | logs/missing_capabilities.jsonl |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
logs/failures_detailed.jsonl| 找到更好方法 | 学到的优化 | logs/learnings.jsonl |
PostToolUse → enhanced-failure-logger.js → 记录带上下文的失败
UserMessage → correction-detector.js → 检测 "错误/实际上/再试一次"
Response → capability-tracker.js → 检测未满足的请求
所有学习成果流向 logs/learnings.jsonl:
{
"timestamp": "2026-01-26T12:00:00Z",
"type": "user_correction|tool_failure|missing_capability",
"category": "factual_error|command_failed|web_browsing",
"description": "学到的内容",
"source": "哪个检测器"
}
每次会话开始时,显示最近的学习成果:
=== 学习回顾 ===
[学习成果] 总计 47 条
[最近]
• [tool_failure] Bash 失败:超时 - WebFetch 到外部 API...
• [user_correction] 用户纠正:"不,使用另一个文件..."
[纠正] 记录了 12 条用户纠正
[能力差距] 最常请求的:
• 发送电子邮件 (5次)
• 浏览网页 (3次)
成功的学习成果会提升相关记忆的 Q 值,改善未来的检索。
# 显示所有学习成果
cat ~/.claude/logs/learnings.jsonl | tail -20
# 仅显示纠正
cat ~/.claude/logs/corrections.jsonl | jq -s 'group_by(.correction_type) | map({type: .[0].correction_type, count: length})'
# 显示能力差距报告
node ~/.claude/scripts/hooks/capability-tracker.js --report
# 测试纠正检测器
node ~/.claude/scripts/hooks/correction-detector.js
# 测试失败记录器
node ~/.claude/scripts/hooks/enhanced-failure-logger.js
# 测试能力追踪器
node ~/.claude/scripts/hooks/capability-tracker.js
factual_error - 提供了错误信息retry_request - 用户要求重试misunderstanding - 误解了请求failed_solution - 解决方案无效permission_error - 访问被拒绝not_found - 文件/资源缺失timeout - 操作超时network_error - 连接问题syntax_error - 无效语法api_error - 外部 API 失败command_failed - Shell 命令失败agent_failed - 子代理失败web_browsing - 互联网访问请求image_processing - 图像/照片处理communication - 电子邮件/消息database_access - SQL/数据库查询external_api - 第三方服务memory_persistence - 长期记忆在 settings.json 中,这些钩子启用自我改进:
{
"hooks": {
"SessionStart": [...], // 回顾学习成果
"PostToolUse": [
{"matcher": "Bash", "hooks": [{"command": "enhanced-failure-logger.js"}]},
{"matcher": "Task", "hooks": [{"command": "enhanced-failure-logger.js"}]}
]
}
}
| 技能 | 集成 |
|---|---|
| QAVR | 成功的学习成果提升记忆 Q 值 |
| 记忆整合 | 定期清理旧的学习成果 |
| 置信度检查 | 在主要任务前回顾学习成果 |
| IR-v2 | 使用学习成果指导模式选择 |
~/.claude/
├── logs/
│ ├── learnings.jsonl # 所有学习成果
│ ├── corrections.jsonl # 用户纠正
│ ├── failures_detailed.jsonl # 增强的失败日志
│ ├── missing_capabilities.jsonl # 能力请求
│ └── capability_gaps.json # 聚合的差距
└── scripts/hooks/
├── correction-detector.js
├── enhanced-failure-logger.js
├── capability-tracker.js
└── session-start.js (回顾学习成果)
每周安装次数
121
仓库
首次出现
2026年2月9日
安全审计
安装于
gemini-cli117
github-copilot116
codex116
opencode116
cursor116
kimi-cli115
| Failure pattern, suggested fix |
logs/failures_detailed.jsonl |
| Better approach found | Optimization learned | logs/learnings.jsonl |
PostToolUse → enhanced-failure-logger.js → logs failures with context
UserMessage → correction-detector.js → detects "wrong/actually/try again"
Response → capability-tracker.js → detects unfulfilled requests
All learnings flow to logs/learnings.jsonl:
{
"timestamp": "2026-01-26T12:00:00Z",
"type": "user_correction|tool_failure|missing_capability",
"category": "factual_error|command_failed|web_browsing",
"description": "what was learned",
"source": "which detector"
}
On each session start, recent learnings are shown:
=== Learning Review ===
[Learnings] 47 total entries
[Recent]
• [tool_failure] Bash failed: timeout - WebFetch to external API...
• [user_correction] User corrected: "No, use the other file..."
[Corrections] 12 user corrections logged
[Capability Gaps] Top requested:
• send emails (5x)
• browse web (3x)
Successful learnings boost Q-values for related memories, improving future retrieval.
# Show all learnings
cat ~/.claude/logs/learnings.jsonl | tail -20
# Show corrections only
cat ~/.claude/logs/corrections.jsonl | jq -s 'group_by(.correction_type) | map({type: .[0].correction_type, count: length})'
# Show capability gaps report
node ~/.claude/scripts/hooks/capability-tracker.js --report
# Test correction detector
node ~/.claude/scripts/hooks/correction-detector.js
# Test failure logger
node ~/.claude/scripts/hooks/enhanced-failure-logger.js
# Test capability tracker
node ~/.claude/scripts/hooks/capability-tracker.js
factual_error - Wrong information providedretry_request - User asked to try againmisunderstanding - Misinterpreted the requestfailed_solution - Solution didn't workpermission_error - Access deniednot_found - File/resource missingtimeout - Operation timed outnetwork_error - Connection issuessyntax_error - Invalid syntaxapi_error - External API failedcommand_failed - Shell command failedagent_failed - Subagent failedweb_browsing - Internet access requestsimage_processing - Image/photo handlingcommunication - Email/messagingdatabase_access - SQL/database queriesexternal_api - Third-party servicesmemory_persistence - Long-term memoryIn settings.json, these hooks enable self-improvement:
{
"hooks": {
"SessionStart": [...], // Reviews learnings
"PostToolUse": [
{"matcher": "Bash", "hooks": [{"command": "enhanced-failure-logger.js"}]},
{"matcher": "Task", "hooks": [{"command": "enhanced-failure-logger.js"}]}
]
}
}
| Skill | Integration |
|---|---|
| QAVR | Successful learnings boost memory Q-values |
| Memory Consolidation | Periodic cleanup of old learnings |
| Confidence Check | Review learnings before major tasks |
| IR-v2 | Use learnings to inform pattern selection |
~/.claude/
├── logs/
│ ├── learnings.jsonl # All learnings
│ ├── corrections.jsonl # User corrections
│ ├── failures_detailed.jsonl # Enhanced failure logs
│ ├── missing_capabilities.jsonl # Capability requests
│ └── capability_gaps.json # Aggregated gaps
└── scripts/hooks/
├── correction-detector.js
├── enhanced-failure-logger.js
├── capability-tracker.js
└── session-start.js (reviews learnings)
Weekly Installs
121
Repository
First Seen
Feb 9, 2026
Security Audits
Installed on
gemini-cli117
github-copilot116
codex116
opencode116
cursor116
kimi-cli115
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
67,500 周安装
Hyperliquid 交易技能:在链上 DEX 交易永续合约与现货,AI 代理自动执行
3,600 周安装
App Store 截图生成器 - 用 Next.js 制作高转化率 iOS 应用商店广告截图
3,600 周安装
数据可视化指南:图表选择、Python代码与设计原则
3,600 周安装
Angular v20+ 测试指南:使用 Vitest 测试信号组件与最佳实践
3,500 周安装
SLO实施指南:SLI/SLO/错误预算框架,Prometheus监控与可靠性目标设定
3,600 周安装
Prisma CLI 7.x 完整命令参考:数据库迁移、客户端生成与开发工具指南
3,800 周安装