Source profileQuality 82/100Review permissions

affaan-m/ECC/docs/zh-CN/skills/continuous-learning-v2/SKILL.md

continuous-learning-v2

Review continuous-learning-v2's use cases, installation, workflow, and original source instructions.

Source repository stars
234,327
Declared platforms
0
Static risk flags
1
Last source update
2026-07-27
Source checked
2026-07-28

Decision brief

What it does—and where it fits

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

Best for

    Not for

    • Tasks that require unconfirmed production actions or broad system permissions.
    • Environments where the pinned source and install steps cannot be inspected.

    Compatibility matrix

    Platform support, with evidence labels

    PlatformStatusEvidenceWhat to check
    CodexNot declaredNo explicit evidencePortability before use
    Claude CodeNot declaredNo explicit evidencePortability before use
    CursorNot declaredNo explicit evidencePortability before use
    Gemini CLINot declaredNo explicit evidencePortability before use
    Open the compatibility checker

    Installation

    Inspect first. Install second.

    The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

    Source-detected install commandSource
    npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-CN/skills/continuous-learning-v2"
    Safe inspection promptEditorial

    Inspect the Agent Skill "continuous-learning-v2" from https://github.com/affaan-m/ECC/blob/4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38/docs/zh-CN/skills/continuous-learning-v2/SKILL.md at commit 4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

    Workflow

    What the source asks the agent to do

    1. 01

      何时激活

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

      设置从 Claude Code 会话自动学习通过钩子配置基于本能的行为提取调整已学习行为的置信度阈值
    2. 02

      v2.1 的新特性

      Review the “v2.1 的新特性” section in the pinned source before continuing.

      Review and apply the “v2.1 的新特性” source section.
    3. 03

      v2 的新特性(对比 v1)

      Review the “v2 的新特性(对比 v1)” section in the pinned source before continuing.

      Review and apply the “v2 的新特性(对比 v1)” source section.
    4. 04

      本能模型

      yaml --- id: prefer-functional-style trigger: "when writing new functions" confidence: 0.7 domain: "code-style" source: "session-observation" scope: project projectid: "a1b2c3d4e5f6" projectname: "my-react-app" ---

      yaml --- id: prefer-functional-style trigger: "when writing new functions" confidence: 0.7 domain: "code-style" source: "session-observation" scope: project projectid: "a1b2c3d4e5f6" projectname: "my-react-app" ---

    Permission review

    Static risk signals and limitations

    Runs scripts

    medium · line 279

    The documentation asks the agent to run terminal commands or scripts.

    python3 instinct-cli.py promote prefer-explicit-errors

    Runs scripts

    medium · line 282

    The documentation asks the agent to run terminal commands or scripts.

    python3 instinct-cli.py promote

    Evidence record

    Why each signal appears

    EvidenceSourceComputedTestedEditorial
    SignalValueEvidence typeMeaning
    Quality score82/100ComputedDocumentation, specificity, maintenance, and trust rules
    Repository stars234,327SourceRepository attention, not individual Skill quality
    Compatibility0 platformsSourceDeclared in the catalog source record
    Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

    Pinned source

    Provenance and original SKILL.md

    Repository
    affaan-m/ECC
    Skill path
    docs/zh-CN/skills/continuous-learning-v2/SKILL.md
    Commit
    4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38
    License
    MIT
    Collected
    2026-07-28
    Default branch
    main
    View the original SKILL.md

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

    的架构

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

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

    何时激活

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

    v2.1 的新特性

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

    v2 的新特性(对比 v1)

    特性v1v2
    观察停止钩子(会话结束)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"
    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

    {
      "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. 初始化目录结构

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

    # 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. 使用本能命令

    /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 以控制后台观察器:

    {
      "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.pyobserve.sh 中的代码默认值进行配置。

    文件结构

    ~/.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

    如何提升:

    # 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 您的模式。

    Alternatives

    Compare before choosing