Agent skill

Continuous Learning V2

by affaan-m in affaan-m/ECC

基于本能的学习系统,通过钩子观察会话,创建带置信度评分的原子本能,并将其进化为技能/命令/代理。v2.1版本增加了项目范围的本能,以防止跨项目污染。

MITAuto-check passedDevelopment

Install Continuous Learning V2

skills CLI
$ npx skills add affaan-m/ECC --skill continuous-learning-v2 -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install affaan-m/ECC continuous-learning-v2 --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .claude/skills && cp -r skills-src/docs/zh-CN/skills/continuous-learning-v2 .claude/skills/continuous-learning-v2 && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
continuous-learning-v2
GitHub stars
276k
Used in
2 other repos
Token cost
~2.1k tokens
SKILL.md length
363 words
Files
2
Skills in repo
683
Repo updated
First seen
Licence
MIT

At a glance

基于本能的学习系统,通过钩子观察会话,创建带置信度评分的原子本能,并将其进化为技能/命令/代理。v2.1版本增加了项目范围的本能,以防止跨项目污染。

  • Works in 3 steps: 启用观察钩子 → 初始化目录结构 → 使用本能命令
  • Development work in your project
  • SKILL.md covers 何时激活, v2.1 的新特性, v2 的新特性(对比 v1) and 本能模型, plus 13 more sections
  • Calls python3 and git

What it does

Continuous Learning V2 is an agent skill from affaan-m/ECC. 基于本能的学习系统,通过钩子观察会话,创建带置信度评分的原子本能,并将其进化为技能/命令/代理。v2.1版本增加了项目范围的本能,以防止跨项目污染。

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/observer.md`).

It sits in Development. It works with Git. The repository describes itself as: The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond. The licence is MIT.

When your agent uses it

  • Development work in your project

Example prompts

  • “/continuous-learning-v2”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. 启用观察钩子
  2. 初始化目录结构
  3. 使用本能命令

What it can do on your machine

Read from SKILL.md and the folder at commit 4eb71d9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • skill-creator.app
    • x.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Continuous Learning V2 loads about 2.1k tokens when it runs. Until then it costs about 24 tokens; SKILL.md has 363 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~24
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from affaan-m/ECC at commit 4eb71d9, republished under its MIT licence (© affaan-m). 363 words, ~2,095 tokens.

Download SKILL.mdSave it as .claude/skills/continuous-learning-v2/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
continuous-learning-v2
description
基于本能的学习系统,通过钩子观察会话,创建带置信度评分的原子本能,并将其进化为技能/命令/代理。v2.1版本增加了项目范围的本能,以防止跨项目污染。
origin
ECC
version
2.1.0

持续学习 v2.1 - 基于本能

的架构

一个高级学习系统,通过原子化的“本能”——带有置信度评分的小型习得行为——将你的 Claude Code 会话转化为可重用的知识。

v2.1 新增了项目作用域的本能 — React 模式保留在你的 React 项目中,Python 约定保留在你的 Python 项目中,而通用模式(如“始终验证输入”)则全局共享。

何时激活

  • 设置从 Claude Code 会话自动学习
  • 通过钩子配置基于本能的行为提取
  • 调整已学习行为的置信度阈值
  • 查看、导出或导入本能库
  • 将本能进化为完整的技能、命令或代理
  • 管理项目作用域与全局本能
  • 将本能从项目作用域提升到全局作用域

v2.1 的新特性

特性v2.0v2.1
存储全局 (~/.claude/homunculus/)项目作用域 (projects/<hash>/)
作用域所有本能随处适用项目作用域 + 全局
检测无git remote URL / 仓库路径
提升不适用在 2+ 个项目中出现时,项目 → 全局
命令4个 (status/evolve/export/import)6个 (+promote/projects)
跨项目存在污染风险默认隔离

v2 的新特性(对比 v1)

特性v1v2
观察停止钩子(会话结束)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"
scope: project
project_id: "a1b2c3d4e5f6"
project_name: "my-react-app"
---

# Prefer Functional Style

## Action
Use functional patterns over classes when appropriate.

## Evidence
- Observed 5 instances of functional pattern preference
- User corrected class-based approach to functional on 2025-01-15

属性:

  • 原子化 -- 一个触发条件,一个动作
  • 置信度加权 -- 0.3 = 试探性,0.9 = 几乎确定
  • 领域标记 -- 代码风格、测试、git、调试、工作流等
  • 有证据支持 -- 追踪是哪些观察创建了它
  • 作用域感知 -- project (默认) 或 global

工作原理

会话活动(在 git 仓库中)
      |
      | 钩子捕获提示 + 工具使用(100% 可靠)
      | + 检测项目上下文(git remote / 仓库路径)
      v
+---------------------------------------------+
|  projects/<project-hash>/observations.jsonl  |
|   (提示、工具调用、结果、项目)               |
+---------------------------------------------+
      |
      | 观察者代理读取(后台,Haiku)
      v
+---------------------------------------------+
|          模式检测                            |
|   * 用户修正 -> 直觉                          |
|   * 错误解决 -> 直觉                          |
|   * 重复工作流 -> 直觉                        |
|   * 范围决策:项目级或全局?                   |
+---------------------------------------------+
      |
      | 创建/更新
      v
+---------------------------------------------+
|  projects/<project-hash>/instincts/personal/ |
|   * prefer-functional.yaml (0.7) [项目]      |
|   * use-react-hooks.yaml (0.9) [项目]        |
+---------------------------------------------+
|  instincts/personal/  (全局)                |
|   * always-validate-input.yaml (0.85) [全局] |
|   * grep-before-edit.yaml (0.6) [全局]       |
+---------------------------------------------+
      |
      | /evolve 聚类 + /promote
      v
+---------------------------------------------+
|  projects/<hash>/evolved/ (项目范围)        |
|  evolved/ (全局)                            |
|   * commands/new-feature.md                  |
|   * skills/testing-workflow.md               |
|   * agents/refactor-specialist.md            |
+---------------------------------------------+

项目检测

系统会自动检测您当前的项目:

  1. CLAUDE_PROJECT_DIR 环境变量 (最高优先级)
  2. git remote get-url origin -- 哈希化以创建可移植的项目 ID (同一仓库在不同机器上获得相同的 ID)
  3. git rev-parse --show-toplevel -- 使用仓库路径作为后备方案 (机器特定)
  4. 全局后备方案 -- 如果未检测到项目,本能将进入全局作用域

每个项目都会获得一个 12 字符的哈希 ID (例如 a1b2c3d4e5f6)。~/.claude/homunculus/projects.json 处的注册表文件将 ID 映射到人类可读的名称。

快速开始

1. 启用观察钩子

添加到你的 ~/.claude/settings.json 中。

如果作为插件安装(推荐):

不需要在 ~/.claude/settings.json 中额外添加 hooks。Claude Code v2.1+ 会自动加载插件的 hooks/hooks.json,其中已经注册了 observe.sh。

如果您之前把 observe.sh 复制到了 ~/.claude/settings.json,请删除重复的 PreToolUse / PostToolUse 配置。重复注册会导致重复执行,并触发 ${CLAUDE_PLUGIN_ROOT} 解析错误,因为该变量只会在插件自己的 hooks/hooks.json 中展开。

如果手动安装到 ~/.claude/skills,请将以下内容添加到 ~/.claude/settings.json:

json
{
  "hooks": {
    "PreToolUse": [{
      "matcher": "*",
      "hooks": [{
        "type": "command",
        "command": "~/.claude/skills/continuous-learning-v2/hooks/observe.sh"
      }]
    }],
    "PostToolUse": [{
      "matcher": "*",
      "hooks": [{
        "type": "command",
        "command": "~/.claude/skills/continuous-learning-v2/hooks/observe.sh"
      }]
    }]
  }
}
2. 初始化目录结构

系统会在首次使用时自动创建目录,但您也可以手动创建:

bash
# Global directories
mkdir -p ~/.claude/homunculus/{instincts/{personal,inherited},evolved/{agents,skills,commands},projects}

# Project directories are auto-created when the hook first runs in a git repo
3. 使用本能命令
bash
/instinct-status     # Show learned instincts (project + global)
/evolve              # Cluster related instincts into skills/commands
/instinct-export     # Export instincts to file
/instinct-import     # Import instincts from others
/promote             # Promote project instincts to global scope
/projects            # List all known projects and their instinct counts

命令

命令描述
/instinct-status显示所有本能 (项目作用域 + 全局) 及其置信度
/evolve将相关本能聚类成技能/命令,建议提升
/instinct-export导出本能 (可按作用域/领域过滤)
/instinct-import <file>导入本能 (带作用域控制)
/promote [id]将项目本能提升到全局作用域
/projects列出所有已知项目及其本能数量

配置

编辑 config.json 以控制后台观察器:

json
{
  "version": "2.1",
  "observer": {
    "enabled": false,
    "run_interval_minutes": 5,
    "min_observations_to_analyze": 20
  }
}
键默认值描述
observer.enabledfalse启用后台观察器代理
observer.run_interval_minutes5观察器分析观察结果的频率
observer.min_observations_to_analyze20运行分析所需的最小观察次数

其他行为 (观察捕获、本能阈值、项目作用域、提升标准) 通过 instinct-cli.py 和 observe.sh 中的代码默认值进行配置。

Show full SKILL.md (139 more words)Show less

文件结构

~/.claude/homunculus/
+-- identity.json           # 你的个人资料,技术水平
+-- projects.json           # 注册表:项目哈希 -> 名称/路径/远程地址
+-- observations.jsonl      # 全局观察记录(备用)
+-- instincts/
|   +-- personal/           # 全局自动学习的本能
|   +-- inherited/          # 全局导入的本能
+-- evolved/
|   +-- agents/             # 全局生成的代理
|   +-- skills/             # 全局生成的技能
|   +-- commands/           # 全局生成的命令
+-- projects/
    +-- a1b2c3d4e5f6/       # 项目哈希(来自 git 远程 URL)
    |   +-- project.json    # 项目级元数据镜像(ID/名称/根目录/远程地址)
    |   +-- observations.jsonl
    |   +-- observations.archive/
    |   +-- instincts/
    |   |   +-- personal/   # 项目特定自动学习的
    |   |   +-- inherited/  # 项目特定导入的
    |   +-- evolved/
    |       +-- skills/
    |       +-- commands/
    |       +-- agents/
    +-- f6e5d4c3b2a1/       # 另一个项目
        +-- ...

作用域决策指南

模式类型作用域示例
语言/框架约定项目"使用 React hooks", "遵循 Django REST 模式"
文件结构偏好项目"测试放在 __tests__/", "组件放在 src/components/"
代码风格项目"使用函数式风格", "首选数据类"
错误处理策略项目"对错误使用 Result 类型"
安全实践全局"验证用户输入", "清理 SQL"
通用最佳实践全局"先写测试", "始终处理错误"
工具工作流偏好全局"编辑前先 Grep", "写入前先读取"
Git 实践全局"约定式提交", "小而专注的提交"

本能提升 (项目 -> 全局)

当同一个本能在多个项目中以高置信度出现时,它就有资格被提升到全局作用域。

自动提升标准:

  • 相同的本能 ID 出现在 2+ 个项目中
  • 平均置信度 >= 0.8

如何提升:

bash
# Promote a specific instinct
python3 instinct-cli.py promote prefer-explicit-errors

# Auto-promote all qualifying instincts
python3 instinct-cli.py promote

# Preview without changes
python3 instinct-cli.py promote --dry-run

/evolve 命令也会建议可提升的候选本能。

置信度评分

置信度随时间演变:

分数含义行为
0.3尝试性的建议但不强制执行
0.5中等的相关时应用
0.7强烈的自动批准应用
0.9近乎确定的核心行为

置信度增加当:

  • 模式被反复观察到
  • 用户未纠正建议的行为
  • 来自其他来源的相似本能一致

置信度降低当:

  • 用户明确纠正该行为
  • 长时间未观察到该模式
  • 出现矛盾证据

为什么用钩子而非技能进行观察?

"v1 依赖技能来观察。技能是概率性的 -- 根据 Claude 的判断,它们触发的概率约为 50-80%。"

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

  • 每次工具调用都被观察到
  • 不会错过任何模式
  • 学习是全面的

向后兼容性

v2.1 与 v2.0 和 v1 完全兼容:

  • ~/.claude/homunculus/instincts/ 中现有的全局本能仍然作为全局本能工作
  • 来自 v1 的现有 ~/.claude/skills/learned/ 技能仍然有效
  • 停止钩子仍然运行 (但现在也会输入到 v2)
  • 逐步迁移:并行运行两者

隐私

  • 观察结果本地保留在您的机器上
  • 项目作用域的本能按项目隔离
  • 只有本能 (模式) 可以被导出 — 而不是原始观察数据
  • 不会共享实际的代码或对话内容
  • 您控制导出和提升的内容

相关链接

  • 技能创建器 - 从仓库历史生成本能
  • Homunculus - 启发了 v2 基于本能的架构的社区项目(原子观察、置信度评分、本能进化管道)
  • 长篇指南 - 持续学习部分

基于本能的学习:一次一个项目,教会 Claude 您的模式。

© affaan-m, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in docs/zh-CN/skills/continuous-learning-v2 of affaan-m/ECC.

  • SKILL.md
  • agents/observer.md

Open the folder on GitHubat commit 4eb71d9

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in affaan-m/ECC, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Continuous Learning V2 next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Continuous Learning V2 compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Continuous Learning V2 this skillaffaan-m/ECC276k2 repos~2.1kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k4 repos~1.1kAutomated safety check: PassMIT
Code Design Rationale Investigatorcursor/plugins11k9 repos~2.6kAutomated safety check: PassNone
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Finishing A Development Branchfarm-fe/farm5.6k34 repos~1.8kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 4 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Official

    Digs into why code is shaped the way it is by checking git history, pull requests and connected tools in parallel, then reporting a cited read on the tradeoffs.

    11k GitHub starsUsed in 9 repos~2.6k tokens
    DevelopmentAuto-check passed
  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 34 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    56k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed

More from affaan-m/ECC

All 683 skills in this repo
  • Skill Stocktake

    affaan-m/ECC

    Audits your installed Claude skills and commands for quality, with a quick mode for recently changed skills and a full mode that evaluates all of them through subagents.

    276k GitHub starsUsed in 5 repos~3.1k tokens
    Auto-check passed
  • Ingests, indexes, searches, edits and monitors video, audio and live streams through the VideoDB Python SDK, returning stream links, clips and timestamps.

    276k GitHub starsUsed in 3 repos~3.5k tokens
    Auto-check: notes
  • Docs Governance

    affaan-m/ECC

    Route broad documentation-governance requests to existing ECC skills and run an opt-in, read-only audit of mapped documentation roles, links, ADR indexes, and evidence references.

    276k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Rules Distillation

    affaan-m/ECC

    Scans installed skills for principles that recur across them and proposes rule-file changes: append, revise, add a section, create a file or leave as covered.

    276k GitHub starsUsed in 2 repos~2.3k tokens
    Auto-check passed
  • Builds DRAFT counterparty agreements from one markdown template and a small JSON spec per party, with clauses picked by the party's role.

    276k GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Measures whether agents actually follow a skill, rule or agent definition by generating scenarios at three strictness levels and scoring tool-call traces.

    276k GitHub starsUsed in 1 repo~623 tokens
    Auto-check passed

Works with

Categories

Questions about Continuous Learning V2

What does Continuous Learning V2 do?

基于本能的学习系统,通过钩子观察会话,创建带置信度评分的原子本能,并将其进化为技能/命令/代理。v2.1版本增加了项目范围的本能,以防止跨项目污染。. Continuous Learning V2 is an agent skill from affaan-m/ECC.

When should I use Continuous Learning V2?

Continuous Learning V2 fits situations like: development work in your project.

How do I install Continuous Learning V2 in Claude Code?

Run `npx skills add affaan-m/ECC --skill continuous-learning-v2 -a claude-code`. Or copy the skill folder (docs/zh-CN/skills/continuous-learning-v2 in affaan-m/ECC) into .claude/skills/continuous-learning-v2 in your project. Claude Code loads it when a task matches its description.

How do I install Continuous Learning V2 in Codex?

Run `npx skills add affaan-m/ECC --skill continuous-learning-v2 -a codex`. Or copy the skill folder (docs/zh-CN/skills/continuous-learning-v2 in affaan-m/ECC) into .agents/skills/continuous-learning-v2 in your project. Codex loads it when a task matches its description.

Can I use Continuous Learning V2 in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add affaan-m/ECC --skill continuous-learning-v2 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/continuous-learning-v2, .gemini/skills/continuous-learning-v2, .github/skills/continuous-learning-v2 and .opencode/skills/continuous-learning-v2 in your project.

What does Continuous Learning V2 need to run?

Going by SKILL.md and its folder, Continuous Learning V2 needs the command-line tools its instructions call (python3 and git). Our summary lists: Python 3.

Does Continuous Learning V2 access the network?

SKILL.md names 2 domains. As links in the text: skill-creator.app and x.com. This is read from the text; nothing was executed.

Is Continuous Learning V2 safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Continuous Learning V2 use?

Continuous Learning V2 is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Continuous Learning V2 use?

About 2.1k tokens (SKILL.md is roughly 8.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Continuous Learning V2?

Skills that share tags, products or a category with Continuous Learning V2: Finishing a Development Branch (obra/superpowers, 297k stars), Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), Code Design Rationale Investigator (cursor/plugins, 11k stars) and Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Continuous Learning V2?

affaan-m (a GitHub user) maintains it in affaan-m/ECC, which has 276,111 GitHub stars. The repository holds 683 skills in this directory. The repository was last updated on October 10, 2026.

Source: affaan-m/ECC on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.