continuous-learning-v2

フックを介してセッションを観察し、信頼度スコアリング付きのアトミックなインスティンクトを作成し、スキル/コマンド/エージェントに進化させるインスティンクトベースの学習システム。

144,923 stars
Complexity: medium

About this skill

The Continuous Learning v2 skill empowers AI agents, particularly Claude, to autonomously learn and evolve from their operational sessions. It acts as an advanced instinct-based architecture, observing agent interactions via granular hooks (PreToolUse/PostToolUse) rather than just session end. A dedicated background agent (Haiku) analyzes these observations to identify and codify atomic learned behaviors, termed 'instincts.' Each instinct is assigned a confidence score (0.3-0.9), reflecting the reliability and applicability of the learned action. Over time, these atomic instincts can be clustered and evolved into more complex, specialized skills, commands, or even entirely new agents, fostering a dynamic and self-improving AI. This system also supports the export and import of instincts, enabling knowledge sharing and transfer across agent instances.

Best use case

To enable an AI agent to autonomously learn, adapt, and improve its performance and capabilities based on its own operational experiences and observed successes. It's ideal for creating self-evolving agents capable of refining their strategies and generating new skills over time.

フックを介してセッションを観察し、信頼度スコアリング付きのアトミックなインスティンクトを作成し、スキル/コマンド/エージェントに進化させるインスティンクトベースの学習システム。

An AI agent that continuously refines its capabilities, develops new 'instincts' for specific situations, and can evolve these into more complex skills or commands, leading to improved task performance, greater adaptability, and autonomous generation of reusable knowledge from its experiences.

Practical example

Example input

The 'input' for this skill is the AI agent's ongoing internal activity and tool usage within its sessions. For example, an agent is tasked with writing Python code and repeatedly observes that certain coding patterns lead to more efficient or readable solutions when using a specific tool or API.

`Agent's internal processing during a code generation session, observing its own actions, tool calls, and their outcomes.`

Example output

The output is internal to the agent, manifested as newly created or reinforced 'instincts' and potentially new skills/commands that influence future behavior. For instance, based on observed success, an agent might generate an instinct:

```yaml
---
id: prefer-list-comprehension
trigger: "when transforming iterable data"
confidence: 0.85
domain: "code-optimization"
source: "session-observation"
---

# リスト変換にリスト内包表記を優先
## Action
リスト変換の際は、効率的で読みやすいリスト内包表記を使用する。
```
This instinct would then autonomously guide the agent's future code generation behavior.

When to use this skill

  • To enable an AI agent to self-improve and adapt over extended periods.
  • When you want an agent to automatically generate new, specialized behaviors (instincts, skills, commands) from its own practical experiences.
  • For tasks requiring the agent to learn best practices or common patterns observed during its sessions, such as code generation or problem-solving.
  • To build a dynamic and evolving AI system that becomes more proficient with use, rather than remaining static.

When not to use this skill

  • When strict, pre-defined, and immutable behavior is absolutely required without any deviation or learning capability.
  • For simple, one-off tasks where the overhead and complexity of a continuous learning system are unnecessary.
  • In highly sensitive environments where observing, analyzing, and storing session data for learning purposes might raise privacy, security, or compliance concerns without robust safeguards.
  • If the agent's performance is already optimal and static for all desired tasks, and no further self-improvement or adaptability is desired or feasible.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/continuous-learning-v2/SKILL.md --create-dirs "https://raw.githubusercontent.com/affaan-m/everything-claude-code/main/docs/ja-JP/skills/continuous-learning-v2/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/continuous-learning-v2/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How continuous-learning-v2 Compares

Feature / Agentcontinuous-learning-v2Standard Approach
Platform SupportClaudeLimited / Varies
Context Awareness High Baseline
Installation ComplexitymediumN/A

Frequently Asked Questions

What does this skill do?

フックを介してセッションを観察し、信頼度スコアリング付きのアトミックなインスティンクトを作成し、スキル/コマンド/エージェントに進化させるインスティンクトベースの学習システム。

Which AI agents support this skill?

This skill is designed for Claude.

How difficult is it to install?

The installation complexity is rated as medium. You can find the installation instructions above.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Continuous Learning v2 - インスティンクトベースアーキテクチャ

Claude Codeセッションを信頼度スコアリング付きの小さな学習済み行動である「インスティンクト」を通じて再利用可能な知識に変える高度な学習システム。

## v2の新機能

| 機能 | v1 | v2 |
|---------|----|----|
| 観察 | Stopフック(セッション終了) | PreToolUse/PostToolUse(100%信頼性) |
| 分析 | メインコンテキスト | バックグラウンドエージェント(Haiku) |
| 粒度 | 完全なスキル | アトミック「インスティンクト」 |
| 信頼度 | なし | 0.3-0.9重み付け |
| 進化 | 直接スキルへ | インスティンクト → クラスター → スキル/コマンド/エージェント |
| 共有 | なし | インスティンクトのエクスポート/インポート |

## インスティンクトモデル

インスティンクトは小さな学習済み行動です:

```yaml
---
id: prefer-functional-style
trigger: "when writing new functions"
confidence: 0.7
domain: "code-style"
source: "session-observation"
---

# 関数型スタイルを優先

## Action
適切な場合はクラスよりも関数型パターンを使用します。

## Evidence
- 関数型パターンの優先が5回観察されました
- ユーザーが2025-01-15にクラスベースのアプローチを関数型に修正しました
```

**プロパティ:**
- **アトミック** — 1つのトリガー、1つのアクション
- **信頼度重み付け** — 0.3 = 暫定的、0.9 = ほぼ確実
- **ドメインタグ付き** — code-style、testing、git、debugging、workflowなど
- **証拠に基づく** — それを作成した観察を追跡

## 仕組み

```
セッションアクティビティ
      │
      │ フックがプロンプト + ツール使用をキャプチャ(100%信頼性)
      ▼
┌─────────────────────────────────────────┐
│         observations.jsonl              │
│   (プロンプト、ツール呼び出し、結果)       │
└─────────────────────────────────────────┘
      │
      │ 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       │
└─────────────────────────────────────────┘
```

## クイックスタート

### 1. 観察フックを有効化

`~/.claude/settings.json`に追加します。

**プラグインとしてインストールした場合**(推奨):

```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`に手動でインストールした場合**:

```json
{
  "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"
      }]
    }]
  }
}
```

### 2. ディレクトリ構造を初期化

Python CLIが自動的に作成しますが、手動で作成することもできます:

```bash
mkdir -p ~/.claude/homunculus/{instincts/{personal,inherited},evolved/{agents,skills,commands}}
touch ~/.claude/homunculus/observations.jsonl
```

### 3. インスティンクトコマンドを使用

```bash
/instinct-status     # 信頼度スコア付きの学習済みインスティンクトを表示
/evolve              # 関連するインスティンクトをスキル/コマンドにクラスター化
/instinct-export     # 共有のためにインスティンクトをエクスポート
/instinct-import     # 他の人からインスティンクトをインポート
```

## コマンド

| コマンド | 説明 |
|---------|-------------|
| `/instinct-status` | すべての学習済みインスティンクトを信頼度と共に表示 |
| `/evolve` | 関連するインスティンクトをスキル/コマンドにクラスター化 |
| `/instinct-export` | 共有のためにインスティンクトをエクスポート |
| `/instinct-import <file>` | 他の人からインスティンクトをインポート |

## 設定

`config.json`を編集:

```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との統合

[Skill Creator GitHub App](https://skill-creator.app)を使用すると、**両方**が生成されます:
- 従来のSKILL.mdファイル(後方互換性のため)
- インスティンクトコレクション(v2学習システム用)

リポジトリ分析からのインスティンクトには`source: "repo-analysis"`があり、ソースリポジトリURLが含まれます。

## 信頼度スコアリング

信頼度は時間とともに進化します:

| スコア | 意味 | 動作 |
|-------|---------|----------|
| 0.3 | 暫定的 | 提案されるが強制されない |
| 0.5 | 中程度 | 関連する場合に適用 |
| 0.7 | 強い | 適用が自動承認される |
| 0.9 | ほぼ確実 | コア動作 |

**信頼度が上がる**場合:
- パターンが繰り返し観察される
- ユーザーが提案された動作を修正しない
- 他のソースからの類似インスティンクトが一致する

**信頼度が下がる**場合:
- ユーザーが明示的に動作を修正する
- パターンが長期間観察されない
- 矛盾する証拠が現れる

## 観察にスキルではなくフックを使用する理由は?

> 「v1はスキルに依存して観察していました。スキルは確率的で、Claudeの判断に基づいて約50-80%の確率で発火します。」

フックは**100%の確率で**決定論的に発火します。これは次のことを意味します:
- すべてのツール呼び出しが観察される
- パターンが見逃されない
- 学習が包括的

## 後方互換性

v2はv1と完全に互換性があります:
- 既存の`~/.claude/skills/learned/`スキルは引き続き機能
- Stopフックは引き続き実行される(ただしv2にもフィードされる)
- 段階的な移行パス:両方を並行して実行

## プライバシー

- 観察はマシン上で**ローカル**に保持されます
- **インスティンクト**(パターン)のみをエクスポート可能
- 実際のコードや会話内容は共有されません
- エクスポートする内容を制御できます

## 関連

- [Skill Creator](https://skill-creator.app) - リポジトリ履歴からインスティンクトを生成
- Homunculus - v2アーキテクチャのインスピレーション(アトミック観察、信頼度スコアリング、インスティンクト進化パイプライン)
- [The Longform Guide](https://x.com/affaanmustafa/status/2014040193557471352) - 継続的学習セクション

---

*インスティンクトベースの学習:一度に1つの観察で、Claudeにあなたのパターンを教える。*

Related Skills

continuous-agent-loop

144923
from affaan-m/everything-claude-code

具有质量门、评估和恢复控制的连续自主代理循环模式。

DevelopmentClaude

workspace-surface-audit

144923
from affaan-m/everything-claude-code

Audit the active repo, MCP servers, plugins, connectors, env surfaces, and harness setup, then recommend the highest-value ECC-native skills, hooks, agents, and operator workflows. Use when the user wants help setting up Claude Code or understanding what capabilities are actually available in their environment.

DevelopmentClaude

safety-guard

144923
from affaan-m/everything-claude-code

Use this skill to prevent destructive operations when working on production systems or running agents autonomously.

DevelopmentClaude

repo-scan

144923
from affaan-m/everything-claude-code

Cross-stack source code asset audit — classifies every file, detects embedded third-party libraries, and delivers actionable four-level verdicts per module with interactive HTML reports.

DevelopmentClaude

project-flow-ops

144923
from affaan-m/everything-claude-code

Operate execution flow across GitHub and Linear by triaging issues and pull requests, linking active work, and keeping GitHub public-facing while Linear remains the internal execution layer. Use when the user wants backlog control, PR triage, or GitHub-to-Linear coordination.

DevelopmentClaude

manim-video

144923
from affaan-m/everything-claude-code

Build reusable Manim explainers for technical concepts, graphs, system diagrams, and product walkthroughs, then hand off to the wider ECC video stack if needed. Use when the user wants a clean animated explainer rather than a generic talking-head script.

DevelopmentClaude

laravel-plugin-discovery

144923
from affaan-m/everything-claude-code

Discover and evaluate Laravel packages via LaraPlugins.io MCP. Use when the user wants to find plugins, check package health, or assess Laravel/PHP compatibility.

DevelopmentClaude

design-system

144923
from affaan-m/everything-claude-code

Use this skill to generate or audit design systems, check visual consistency, and review PRs that touch styling.

DevelopmentClaude

click-path-audit

144923
from affaan-m/everything-claude-code

Trace every user-facing button/touchpoint through its full state change sequence to find bugs where functions individually work but cancel each other out, produce wrong final state, or leave the UI in an inconsistent state. Use when: systematic debugging found no bugs but users report broken buttons, or after any major refactor touching shared state stores.

DevelopmentClaude

ck

144923
from affaan-m/everything-claude-code

Persistent per-project memory for Claude Code. Auto-loads project context on session start, tracks sessions with git activity, and writes to native memory. Commands run deterministic Node.js scripts — behavior is consistent across model versions.

DevelopmentClaude

canary-watch

144923
from affaan-m/everything-claude-code

Use this skill to monitor a deployed URL for regressions after deploys, merges, or dependency upgrades.

DevelopmentClaude

benchmark

144923
from affaan-m/everything-claude-code

Use this skill to measure performance baselines, detect regressions before/after PRs, and compare stack alternatives.

DevelopmentClaude