Communitygithub.com

持續學習技能(已棄用)

[已棄用 - 請改用 continuous-learning-v2] 舊版 v1 stop-hook 技能提取器。v2 為嚴格超集,具備基於直覺、專案範圍、掛鉤可靠的學習機制。請勿調用 v1:當請求持續學習、會話學習或模式提取時,請改為路由至 continuous-learning-v2。

持續學習技能(已棄用) 是什麼?

此技能(continuous-learning v1)是一個已棄用的 Claude Code 技能,設計用於在每次會話結束時自動評估並提取可重複使用的模式,並將其儲存為學習技能。它透過 Stop 掛鉤運作,會話結束時檢查訊息數量(預設至少 10 則),偵測模式(如錯誤解決方案、使用者修正、解決方法),並將有用的模式儲存至 `~/.claude/skills/learned/`。技能支援透過 JSON 設定調整提取門檻、偵測與忽略的模式類型,以及自動核准行為。由於技能本身是機率性觸發(約 50-80%),此 v1 方法被認為不如改用 PreToolUse/PostToolUse 掛鉤的 v2 可靠;因此建議新安裝使用 `continuous-learning-v2`,它提供 100% 可靠的觀察與直覺式學習。此 v1 技能僅保留用於回溯相容性與參考。

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

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

持續學習技能 - 已棄用

2026-04-28 已棄用。請改用 continuous-learning-v2。v2 是嚴格超集:stop-hook 觀察升級為 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 月)

vs 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/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

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.

相關技能