フックを介してセッションを観察し、信頼度スコアリング付きのアトミックなインスティンクトを作成し、スキル/コマンド/エージェントに進化させるインスティンクトベースの学習システム。
npx skills add https://github.com/loulanyue/awesome-claude-notes --skill continuous-learning-v2
Claude Codeセッションを信頼度スコアリング付きの小さな学習済み行動である「インスティンクト」を通じて再利用可能な知識に変える高度な学習システム。
| 機能 | v1 | v2 |
|---------|----|----|
| 観察 | Stopフック(セッション終了) | PreToolUse/PostToolUse(100%信頼性) |
| 分析 | メインコンテキスト | バックグラウンドエージェント(Haiku) |
| 粒度 | 完全なスキル | アトミック「インスティンクト」 |
| 信頼度 | なし | 0.3-0.9重み付け |
| 進化 | 直接スキルへ | インスティンクト → クラスター → スキル/コマンド/エージェント |
| 共有 | なし | インスティンクトのエクスポート/インポート |
インスティンクトは小さな学習済み行動です:
---
id: prefer-functional-style
trigger: "when writing new functions"
confidence: 0.7
domain: "code-style"
source: "session-observation"
---
# 関数型スタイルを優先
## Action
適切な場合はクラスよりも関数型パターンを使用します。
## Evidence
- 関数型パターンの優先が5回観察されました
- ユーザーが2025-01-15にクラスベースのアプローチを関数型に修正しました
プロパティ:
Session Activity
│
│ フックがプロンプト + ツール使用をキャプチャ(100%信頼性)
▼
┌─────────────────────────────────────────┐
│ observations.jsonl │
│ (prompts, tool calls, outcomes) │
└─────────────────────────────────────────┘
│
│ Observerエージェントが読み取り(バックグラウンド、Haiku)
▼
┌─────────────────────────────────────────┐
│ パターン検出 │
│ • ユーザー修正 → インスティンクト │
│ • エラー解決 → インスティンクト │
│ • 繰り返しワークフロー → インスティンクト │
└─────────────────────────────────────────┘
│
│ 作成/更新
▼
┌─────────────────────────────────────────┐
│ instincts/personal/ │
│ • prefer-functional.md (0.7) │
│ • always-test-first.md (0.9) │
│ • use-zod-validation.md (0.6) │
└─────────────────────────────────────────┘
│
│ /evolveクラスター
▼
┌─────────────────────────────────────────┐
│ evolved/ │
│ • commands/new-feature.md │
│ • skills/testing-workflow.md │
│ • agents/refactor-specialist.md │
└─────────────────────────────────────────┘
~/.claude/settings.jsonに追加します。
プラグインとしてインストールした場合(推奨):
{
"hooks": {
"PreToolUse": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/hooks/observe.sh pre"
}]
}],
"PostToolUse": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/hooks/observe.sh post"
}]
}]
}
}
~/.claude/skillsに手動でインストールした場合:
{
"hooks": {
"PreToolUse": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/continuous-learning-v2/hooks/observe.sh pre"
}]
}],
"PostToolUse": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/continuous-learning-v2/hooks/observe.sh post"
}]
}]
}
}
Python CLIが自動的に作成しますが、手動で作成することもできます:
mkdir -p ~/.claude/homunculus/{instincts/{personal,inherited},evolved/{agents,skills,commands}}
touch ~/.claude/homunculus/observations.jsonl
/instinct-status # 信頼度スコア付きの学習済みインスティンクトを表示
/evolve # 関連するインスティンクトをスキル/コマンドにクラスター化
/instinct-export # 共有のためにインスティンクトをエクスポート
/instinct-import # 他の人からインスティンクトをインポート
| コマンド | 説明 |
|---------|-------------|
| /instinct-status | すべての学習済みインスティンクトを信頼度と共に表示 |
| /evolve | 関連するインスティンクトをスキル/コマンドにクラスター化 |
| /instinct-export | 共有のためにインスティンクトをエクスポート |
| /instinct-import <file> | 他の人からインスティンクトをインポート |
config.jsonを編集:
{
"version": "2.0",
"observation": {
"enabled": true,
"store_path": "~/.claude/homunculus/observations.jsonl",
"max_file_size_mb": 10,
"archive_after_days": 7
},
"instincts": {
"personal_path": "~/.claude/homunculus/instincts/personal/",
"inherited_path": "~/.claude/homunculus/instincts/inherited/",
"min_confidence": 0.3,
"auto_approve_threshold": 0.7,
"confidence_decay_rate": 0.05
},
"observer": {
"enabled": true,
"model": "haiku",
"run_interval_minutes": 5,
"patterns_to_detect": [
"user_corrections",
"error_resolutions",
"repeated_workflows",
"tool_preferences"
]
},
"evolution": {
"cluster_threshold": 3,
"evolved_path": "~/.claude/homunculus/evolved/"
}
}
~/.claude/homunculus/
├── identity.json # プロフィール、技術レベル
├── observations.jsonl # 現在のセッション観察
├── observations.archive/ # 処理済み観察
├── instincts/
│ ├── personal/ # 自動学習されたインスティンクト
│ └── inherited/ # 他の人からインポート
└── evolved/
├── agents/ # 生成された専門エージェント
├── skills/ # 生成されたスキル
└── commands/ # 生成されたコマンド
Skill Creator GitHub Appを使用すると、両方が生成されます:
リポジトリ分析からのインスティンクトにはsource: "repo-analysis"があり、ソースリポジトリURLが含まれます。
信頼度は時間とともに進化します:
| スコア | 意味 | 動作 |
|-------|---------|----------|
| 0.3 | 暫定的 | 提案されるが強制されない |
| 0.5 | 中程度 | 関連する場合に適用 |
| 0.7 | 強い | 適用が自動承認される |
| 0.9 | ほぼ確実 | コア動作 |
信頼度が上がる場合:
信頼度が下がる場合:
> 「v1はスキルに依存して観察していました。スキルは確率的で、Claudeの判断に基づいて約50-80%の確率で発火します。」
フックは100%の確率で決定論的に発火します。これは次のことを意味します:
v2はv1と完全に互換性があります:
~/.claude/skills/learned/スキルは引き続き機能*インスティンクトベースの学習:一度に1つの観察で、Claudeにあなたのパターンを教える。*
Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.
Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances
Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.
Build and distribute Expo development clients locally or via TestFlight
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
Take loulanyue/continuous-learning-v2 from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.