Agent skill
continuous-learning
自动从 Claude Code 会话(Session)中提取可重用的模式(Pattern),并将其作为已学习的技能(Skill)保存以备将来使用。
Install this agent skill to your Project
npx add-skill https://github.com/xu-xiang/everything-claude-code-zh/tree/main/docs/ja-JP/skills/continuous-learning
SKILL.md
持续学习技能(Continuous Learning Skill)
Claude Code 会话结束时自动进行评估,提取可作为已学习技能保存的可重用模式(Pattern)。
工作原理(How it Works)
此技能在每个会话结束时作为 Stop 钩子(Hook) 执行:
- 会话评估:检查会话是否有足够的消息(默认:10 条以上)
- 模式检测:识别可从会话中提取的模式
- 技能提取:将有用的模式保存到
~/.claude/skills/learned/
配置(Configuration)
通过编辑 config.json 进行自定义:
{
"min_session_length": 10,
"extraction_threshold": "medium",
"auto_approve": false,
"learned_skills_path": "~/.claude/skills/learned/",
"patterns_to_detect": [
"error_resolution",
"user_corrections",
"workarounds",
"debugging_techniques",
"project_specific"
],
"ignore_patterns": [
"simple_typos",
"one_time_fixes",
"external_api_issues"
]
}
模式类型(Pattern Types)
| 模式 | 描述 |
|---|---|
error_resolution |
特定错误的解决方法 |
user_corrections |
来自用户修正的模式 |
workarounds |
针对框架/库特性的解决方案 |
debugging_techniques |
有效的调试方法(Debugging Approaches) |
project_specific |
项目特定的约定 |
钩子配置(Hook Configuration)
添加到 ~/.claude/settings.json:
{
"hooks": {
"Stop": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/continuous-learning/evaluate-session.sh"
}]
}]
}
}
为什么使用 Stop 钩子
- 轻量:仅在会话(Session)结束时执行一次
- 非阻塞:不会给每条消息增加延迟(Latency)
- 完整上下文:可以访问整个会话的转录内容
相关项目
- The Longform Guide - 关于持续学习的部分
/learn命令 - 会话中的手动模式提取
对比笔记(调查:2025年1月)
vs Homunculus
Homunculus v2 采用了更精细的方法:
| 功能 | 当前方法 | Homunculus v2 |
|---|---|---|
| 观察 | Stop 钩子 (会话结束时) | PreToolUse/PostToolUse 钩子 (100% 可靠性) |
| 分析 | 主上下文 (Main Context) | 后台智能体 (Background Agent, Haiku) |
| 粒度 | 完整的技能 | 原子级的“本能 (Instinct)” |
| 置信度 | 无 | 0.3-0.9 的权重分配 |
| 演进 | 直接转换为技能 | 本能 → 集群 → 技能/命令/智能体 |
| 共享 | 无 | 本能的导出/导入 |
homunculus 的重要洞察:
"v1 依赖技能进行观察。技能是概率性的,触发率约为 50-80%。v2 使用钩子(100% 可靠性)进行观察,并使用本能作为学习行为的原子单位。"
v2 的潜在改进
- 基于本能的学习 - 具有置信度评分的更小、原子级的行为
- 后台观察者 - 并行分析的 Haiku 智能体
- 置信度衰减 - 在发生冲突时降低本能的置信度
- 领域标签 - 代码风格、测试、git、调试等
- 演进路径 - 将相关的本能聚类为技能/命令/智能体
详细信息:请参阅 /Users/affoon/Documents/tasks/12-continuous-learning-v2.md。
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
investor-materials
创建并更新路演 PPT (Pitch Deck)、单页简介 (One-Pager)、投资者备忘录 (Investor Memo)、加速器申请、财务模型以及融资材料。当用户需要面向投资者的文档、预测、资金用途表、里程碑计划或需要跨多个融资资产保持内部一致性的材料时,请使用此技能。
e2e-testing
Playwright E2E 测试模式、页面对象模型(POM)、配置、CI/CD 集成、产物管理以及不稳定测试(flaky test)策略。
api-design
生产级 API 的 REST API 设计模式,包括资源命名、状态码、分页、过滤、错误响应、版本控制和速率限制。
frontend-patterns
React、Next.js、状态管理(State Management)、性能优化(Performance Optimization)及 UI 最佳实践的前端开发模式。
investor-outreach
Draft cold emails, warm intro blurbs, follow-ups, update emails, and investor communications for fundraising. Use when the user wants outreach to angels, VCs, strategic investors, or accelerators and needs concise, personalized, investor-facing messaging.
verification-loop
为 Claude Code 会话提供的全面验证系统。
Didn't find tool you were looking for?