Continuous Learning V2 logo

Continuous Learning V2

CommunityPopular
xu-xiang
continuous-learning-v2

一种基于本能(Instinct)的训练系统,通过钩子(Hooks)观察会话,创建带有置信度评分的原子化本能,并将其进化为技能(Skills)、命令(Commands)或智能体(Agents)。

Overview

Publisherxu-xiang
Repositoryeverything-claude-code-zh
Skill namecontinuous-learning-v2
Stars
1.9K
Forks
318
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by xu-xiang on GitHub. Read the source before you install it.

Installation

Install the Continuous Learning V2 AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/xu-xiang/everything-claude-code-zh.git /tmp/everything-claude-code-zh
mkdir -p .claude/skills
cp -r /tmp/everything-claude-code-zh/docs/ja-JP/skills/continuous-learning-v2 .claude/skills/continuous-learning-v2
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Continuous Learning V2 in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Continuous Learning V2 on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Continuous Learning V2 is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

持续学习(Continuous Learning)v2 - 基于本能(Instinct)的架构

这是一款先进的学习系统,能够通过带有置信度评分的小型已学习行为——“本能(Instinct)”,将 Claude Code 会话转化为可重用的知识。

v2 新特性

特性v1v2
观察(Observation)Stop 钩子(会话结束时)PreToolUse/PostToolUse(100% 可靠性)
分析主上下文(Main Context)后台智能体(Background Agent, Haiku)
粒度完整的技能(Skill)原子化“本能(Instinct)”
置信度0.3-0.9 加权
进化直接转化为技能本能 → 聚类 → 技能/命令/智能体
共享本能导出/导入

本能模型(Instinct Model)

本能(Instinct)是小型且已学习的行为:

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

# 优先使用函数式风格

## Action
在合适的情况下,优先使用函数式模式而非类(Class)。

## Evidence
- 观察到 5 次优先使用函数式模式
- 用户在 2025-01-15 将基于类的方法修正为函数式

属性:

  • 原子化(Atomic) — 一个触发器,一个动作。
  • 置信度加权(Confidence Weighting) — 0.3 = 暂定,0.9 = 几乎确定。
  • 领域标签(Domain Tagged) — 如 code-styletestinggitdebuggingworkflow 等。
  • 基于证据(Evidence-based) — 跟踪创建该本能的观察记录。

工作原理

会话活动(Session Activity)
      │ 钩子捕获提示词 + 工具调用(100% 可靠性)
┌─────────────────────────────────────────┐
│         observations.jsonl              │
│   (prompts, tool calls, outcomes)       │
└─────────────────────────────────────────┘
      │ 观察者智能体(Observer Agent)读取(后台运行,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. 启用观察钩子(Observation Hooks)

添加到 ~/.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     # 从他人处导入本能

命令(Commands)

命令说明
/instinct-status显示所有已学习的本能及其置信度
/evolve将相关的本能聚类为技能/命令
/instinct-export导出本能以便共享
/instinct-import <file>从他人处导入本能

配置(Configuration)

编辑 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同时生成:

  • 传统的 SKILL.md 文件(用于向后兼容)
  • 本能集合(用于 v2 学习系统)

来自仓库分析的本能会带有 source: "repo-analysis" 标记,并包含源仓库 URL。

置信度评分(Confidence Scoring)

置信度会随着时间进化:

分数含义行为
0.3暂定会被建议但不会强制执行
0.5中等在相关情况下应用
0.7应用会被自动批准
0.9几乎确定核心行为

置信度提升的情况:

  • 模式被重复观察到。
  • 用户未对建议的行为进行修正。
  • 来自其他源的类似本能匹配。

置信度下降的情况:

  • 用户显式修正了行为。
  • 长期未观察到该模式。
  • 出现了矛盾的证据。

为什么在观察中使用钩子(Hooks)而不是技能(Skills)?

“v1 依赖于技能进行观察。技能是概率性的,根据 Claude 的判断,其触发概率约为 50-80%。”

钩子(Hooks)是100% 确定性触发的。这意味着:

  • 所有的工具调用都会被观察到。
  • 模式不会被遗漏。
  • 学习是全面的。

向后兼容性

v2 与 v1 完全兼容:

  • 现有的 ~/.claude/skills/learned/ 技能仍然有效。
  • Stop 钩子仍然会运行(但也会为 v2 提供数据)。
  • 平滑迁移路径:支持两者并行运行。

隐私(Privacy)

  • 观察记录保留在机器本地
  • 仅可导出本能(模式)。
  • 实际的代码或对话内容不会被共享。
  • 你可以控制导出的内容。

相关链接

  • Skill Creator - 从仓库历史生成本能。
  • Homunculus - v2 架构的灵感来源(原子化观察、置信度评分、本能进化流水线)。
  • The Longform Guide - 持续学习章节。

基于本能的学习:一次一次地观察,教会 Claude 你的模式。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Continuous Learning V2 AI skill do?

一种基于本能(Instinct)的训练系统,通过钩子(Hooks)观察会话,创建带有置信度评分的原子化本能,并将其进化为技能(Skills)、命令(Commands)或智能体(Agents)。

Why use Continuous Learning V2 on TypingMind?

Because you install it once and use it with any model. Continuous Learning V2 is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Continuous Learning V2 in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/xu-xiang/everything-claude-code-zh/tree/main/docs/ja-JP/skills/continuous-learning-v2. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Continuous Learning V2?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Continuous Learning V2?

As many as you like. As long as a model supports skills, you can use Continuous Learning V2 with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Continuous Learning V2 AI skill free?

Yes. It is published on GitHub by xu-xiang under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇