Metaskill
3 Core Components
- 1. Deep Self-Correction (
deep-correct.sh) — 3-level breakdown on errors:
-
Surface: What specifically failed
-
Principle: The underlying rule/constraint violated
-
Habit: Concrete behavioral change to prevent recurrence
- 2. Transfer Learning (
transfer-check.sh) — Before a task, search past learnings for analogous patterns. Maps domains (e.g., "auth" → "security") to prevent siloed learning.
- 3. Proactive Pattern Recognition (
success-capture.sh) — Log what worked and why, building a repository of successful patterns.
Usage
CODEBLOCK0
Configuration (LLM Provider)
Metaskill uses two provider tiers — fast (extraction) and deep (transfer/eval). Edit config.yaml to match your setup:
CODEBLOCK1
| Provider | Env Var | Notes |
|---|
| INLINECODE4 | INLINECODE5 | Default |
| INLINECODE6 |
OPENAI_API_KEY | |
|
ollama |
(none needed) | Local, free |
|
gemini |
GOOGLE_API_KEY | |
Ollama example (fully local, no API key):
CODEBLOCK2
If no provider is available, metaskill falls back to manual/heuristic mode (still works, but less precise extraction).
Integration with Self-Improving-Agent
Writes to skills/self-improving-agent/.learnings/ if present, otherwise falls back to its own .learnings/ directory. No extra setup needed.
AGENTS.md Wiring (Mandatory)
Add to pre-task checklist:
- 1. Run
transfer-check.sh before any major task - Run
deep-correct.sh immediately after any error (not just LEARNINGS.md append) - Run
success-capture.sh after complex task completes successfully
元技能
3个核心组件
- 1. 深度自我修正(deep-correct.sh) — 对错误进行三级分解:
-
表面层:具体失败点
-
原则层:违反的底层规则/约束
-
习惯层:防止重复发生的具体行为改变
- 2. 迁移学习(transfer-check.sh) — 执行任务前,搜索过往经验中的类比模式。跨领域映射(例如认证→安全),防止学习孤立化。
- 3. 主动模式识别(success-capture.sh) — 记录成功经验及原因,构建成功模式知识库。
使用方法
bash
发生错误时
bash skills/metaskill/scripts/deep-correct.sh 错误描述
开始复杂任务前
bash skills/metaskill/scripts/transfer-check.sh 新任务描述
成功执行后
bash skills/metaskill/scripts/success-capture.sh 有效做法 成功原因
月度健康评估
bash skills/metaskill/scripts/eval.sh --save
配置(LLM提供商)
元技能使用两层提供商——快速层(提取)和深度层(迁移/评估)。编辑config.yaml匹配你的设置:
yaml
config.yaml
providers:
fast: anthropic # 可改为:openai | ollama | gemini
deep: anthropic
| 提供商 | 环境变量 | 备注 |
|---|
| anthropic | ANTHROPICAPIKEY | 默认 |
| openai |
OPENAI
APIKEY | |
| ollama |
(无需) | 本地,免费 |
| gemini | GOOGLE
APIKEY | |
Ollama示例(完全本地,无需API密钥):
yaml
providers:
fast: ollama
deep: ollama
models:
ollama:
fast: llama3.2
deep: llama3.1:70b
若无可用提供商,元技能将回退至手动/启发式模式(仍可工作,但提取精度较低)。
与自我改进代理的集成
若存在skills/self-improving-agent/.learnings/目录则写入该目录,否则回退至自身的.learnings/目录。无需额外设置。
AGENTS.md 接线(必选)
添加到任务前检查清单:
- 1. 任何重大任务前运行transfer-check.sh
- 任何错误发生后立即运行deep-correct.sh(不仅仅是追加到LEARNINGS.md)
- 复杂任务成功完成后运行success-capture.sh