Communitygithub.com

持续学习技能 - 已废弃

[已废弃 - 请使用 continuous-learning-v2] 基于停止钩子的传统 v1 模式提取技能。v2 是严格超集,采用基于直觉、项目范围、钩子可靠的学习方式。请勿调用 v1:当需要持续学习、会话学习或模式提取时,应路由至 continuous-learning-v2。

持续学习技能 - 已废弃 是什么?

此技能代表 Claude Code 持续学习能力的 v1 版本,现已废弃,建议迁移至更先进的 v2 版本。v1 核心机制是在每个会话结束时通过 Stop 钩子运行,评估会话历史(默认至少 10 条消息),从中识别可复用的模式,并将有用的模式保存为技能文件到 `~/.claude/skills/learned/`。它支持五种预设模式类型(错误解决、用户修正、变通方案、调试技巧、项目特定),并可通过 JSON 配置文件调整提取阈值、忽略列表等。与 v2 相比,v1 存在多个局限:依赖概率性技能触发(仅约 50-80% 可靠性)、粒度仅为完整技能、缺乏置信度评分、不支持项目级作用域。v2 通过使用 PreToolUse/PostToolUse 钩子实现 100% 可靠观察,并以原子化的"直觉"(instincts)作为学习基本单元,支持置信度衰减、领域标签和导出/导入。此 SKILL.md 文档仅供存档参考和向后兼容,新用户应直接使用 `continuous-learning-v2`。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/continuous-learning

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

持续学习技能 - 已废弃 是做什么的?

2026-04-28 已废弃。 请使用 continuous-learning-v2 替代。v2 是严格超集:Stop 钩子观察变为 PreToolUse/PostToolUse 观察,完整技能变为带置信度评分的原子直觉,仅全局存储变为项目范围加全局推广。

本文件保留作为存档参考,并与现有安装保持向后兼容。


原始 v1 文档(存档)

在 Claude Code 会话结束时自动评估会话,提取可复用模式,并将其保存为学到的技能。

何时激活

  • 设置从 Claude Code 会话中自动提取模式
  • 配置用于会话评估的 Stop 钩子
  • 查看或管理 ~/.claude/skills/learned/ 中的已学技能
  • 调整提取阈值或模式类别
  • 比较 v1(旧版)与 v2(基于直觉)方法

状态

此 v1 技能仍受支持,但 continuous-learning-v2 是新安装的首选路径。若你明确需要更简单的 Stop 钩子提取流程,或需要与旧版已学技能工作流兼容,则可保留 v1。

工作原理

此技能作为 Stop 钩子 在每个会话结束时运行:

  1. 会话评估:检查会话是否有足够多的消息(默认:10 条以上)
  2. 模式检测:识别会话中可提取的模式
  3. 技能提取:将有价值的模式保存到 ~/.claude/skills/learned/

配置

编辑 config.json 以自定义:

{
  "min_session_length": 10,
  "extraction_threshold": "medium",
  "auto_approve": false,
  "learned_skills_path": "~/.claude/skills/learned/",
  "patterns_to_detect": [
    "error_resolution",
    "user_corrections",
    "workarounds",
    "debugging_techniques",
    "project_specific"
  ],
  "ignore_patterns": [
    "simple_typos",
    "one_time_fixes",
    "external_api_issues"
  ]
}

模式类型

模式描述
error_resolution特定错误如何被解决
user_corrections来源于用户修正的模式
workarounds针对框架或库怪癖的解决方案
debugging_techniques有效的调试方法
project_specific项目特定的约定

钩子设置

添加至你的 ~/.claude/settings.json:

{
  "hooks": {
    "Stop": [{
      "matcher": "*",
      "hooks": [{
        "type": "command",
        "command": "~/.claude/skills/continuous-learning/evaluate-session.sh"
      }]
    }]
  }
}

为什么选择 Stop 钩子?

  • 轻量:仅在会话结束时运行一次
  • 非阻塞:不会增加每条消息的延迟
  • 上下文完整:能访问完整会话记录

相关链接

  • 长篇指南 - 关于持续学习的章节
  • /learn 命令 - 会话中手动提取模式

对比笔记(研究时间:2025 年 1 月)

与 Homunculus 对比

Homunculus v2 采用了更成熟的方法:

特性我们的方法Homunculus v2
观察方式Stop 钩子(会话结束时)PreToolUse/PostToolUse 钩子(100% 可靠)
分析模式主上下文后台代理(Haiku)
粒度完整技能原子化的“直觉”
置信度无0.3-0.9 加权
演化方式直接成为技能直觉 → 聚类 → 技能/命令/代理
共享方式无导出/导入直觉

来自 homunculus 的关键见解:

“v1 依赖技能来进行观察。技能是概率性的——它们大约 50-80% 的时间会触发。v2 使用钩子进行观察(100% 可靠),并以直觉作为学习行为的原子单位。”

潜在的 v2 增强

  1. 基于直觉的学习 - 更小的原子行为,带有置信度评分
  2. 后台观察者 - Haiku 代理并行分析
  3. 置信度衰减 - 若被矛盾证据反驳,直觉的置信度下降
  4. 领域标签 - 代码风格、测试、git、调试等
  5. 演化路径 - 将相关直觉聚类为技能/命令

完整规范请参见:docs/continuous-learning-v2-spec.md

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

相关技能