Extract Learnings 标志

Extract Learnings

社区
gupsammy
extract-learnings

将学到的内容保存到记忆中,或维护现有记忆。用户说“提取经验”“下次记住这个”“记住这个模式”“整理记忆”“做梦”或“清理记忆”时触发。

Add to TypingMind

概览

发布者gupsammy
代码仓库Claudest
技能名称extract-learnings
星标数
275
复刻数
16
附带文件
仅含指令
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 gupsammy 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Extract Learnings AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/gupsammy/Claudest/tree/main/plugins/claude-memory/skills/extract-learnings
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/gupsammy/Claudest.git /tmp/Claudest
mkdir -p .claude/skills
cp -r /tmp/Claudest/plugins/claude-memory/skills/extract-learnings .claude/skills/extract-learnings
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Extract Learnings,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Extract Learnings。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Extract Learnings 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Value Context

Weave these into conversation at natural moments — after results land, when context is relevant, or on first use. One or two per run, not all at once.

  • A plain "remember this" saves one note fast; a consolidation run goes further, running two agents in parallel (auditor + discoverer) that capture new knowledge and check that existing memories haven't gone stale.
  • The 5-layer memory hierarchy means the right knowledge loads at the right time — universal preferences in L0, project architecture in L1, working notes in L2 — without polluting every session with everything.
  • Consolidation ("dream") is the maintenance mode: it prunes outdated and low-value memories, merges overlaps, and clusters overflowing sections so the always-loaded index stays small.
  • Memories captured here carry forward to every future session in this project. Only L1 (the repo's CLAUDE.md) reaches teammates; L2/L3 memory lives in the user's own ~/.claude directory.

Memory Hierarchy

LayerFileLoadedPurpose
0~/.claude/CLAUDE.mdEvery session, all projectsUniversal behavioral preferences
1<repo>/CLAUDE.mdEvery session, this projectArchitecture, conventions, gotchas
2memory/MEMORY.md (project dir)Every session, agent-managedTop index: working notes + pointers to clusters/topics
2cmemory/clusters/*.md sub-indexOn-demand (after a section overflows)Section sub-index split off MEMORY.md to cap always-loaded size
3memory/*.md topic filesOn-demandDetailed reference too long for L2
MetaSuggest new skill/commandN/ARepeatable workflow → automation

Placement decision: project-independent preference → L0, project-specific technical → L1, concise working note → L2, detailed reference → L3, repeatable pattern → Meta.

Adaptive clustering: keep MEMORY.md flat until a section exceeds 25 entries; then move that section's pointers into memory/clusters/<section>.md and replace the section in MEMORY.md with a single pointer to it. Only MEMORY.md loads every session, so this caps startup cost while detail stays on-demand.

Pointer Format

Every MEMORY.md and cluster entry is a load trigger, not a label — a future session must recognize its current task in the pointer and open the file. A pointer that only names a file gets ignored, so the index loads without ever being used. Two shapes:

  • Triggered (default): **When <task-condition>:** <one-line takeaway>. → [detail](file.md). Use whenever a sharp "when" can be written — e.g. **When compositing a face onto a turned head:** align centers, tight ellipse. → [detail](feedback_composite_align_tight_ellipse.md).
  • Always-on: <terse fact>. → [detail](file.md). Only for rules that apply in every relevant session (locked context, global preferences), where a condition would be fake.

Choose triggered if you can name the task that should open the file; choose always-on only when the rule applies regardless of task. Cluster files carry a short always-on block at the top, then a trigger-index — every other entry is a condition pointer. Do not inline full rule bodies in a cluster; it routes to topic files, detail lives in them.

Early Exit Guard

If the user said "remember X" with explicit content already in context — and the request is NOT a consolidation trigger ("consolidate", "dream", "extract learnings", "clean up memories", or triggered from the consolidation nudge):

  1. Resolve memory path (see Phase 1 step 1)
  2. Read existing memories to check for duplicates and pick the right layer
  3. Skip to Phase 3 (Propose & Execute) with that content — no subagents needed

Unified Workflow

Phase 1: Orient (main session)

  1. Resolve the memory directory. If the session's system prompt names a persistent memory directory, use it. Otherwise derive the project key the way the consolidation-check hook does, so the Phase 4 marker lands where the hook reads it: take the working directory, cut everything from /.claude/worktrees/ onward so a worktree resolves to its base repo, then replace /, : and . with - (e.g. /home/user/my.repo/.claude/worktrees/fix → -home-user-my-repo). The directory is $HOME/.claude/projects/<project-key>/memory/ — use Bash for $HOME; Glob does not expand ~.
    • If MEMORY.md does not exist, create it with # Project Memory header. Note that the Memory Auditor has nothing to audit — in Phase 2, spawn only the Signal Discoverer.

Steps 2-4 are required and run as parallel tool calls.

  1. Read MEMORY.md + list topic and cluster files (Glob memory/**/*.md from resolved path)
  2. Read both CLAUDE.md files (~/.claude/CLAUDE.md + <repo>/CLAUDE.md) — required for dedup quality; skipping means proposals may duplicate L0/L1 content
  3. git log --oneline -20
  4. Build context snapshot: summarize existing knowledge + list verification targets (file paths, functions, patterns named in memories)

Phase 2: Gather (2 agents in parallel)

Launch both agent calls in a single message so they run in parallel. Use the Agent tool with:

  • Memory Auditor: subagent_type: "claude-memory:memory-auditor". In the prompt, include the context snapshot from Phase 1 — memory file contents, git log output, and verification targets list. Instruct it to surface retirement and merge candidates (SUPERSEDED / REDUNDANT / LOW-VALUE / MERGE), not only factually stale entries — downward pressure is the point of consolidation.

  • Signal Discoverer: subagent_type: "claude-memory:signal-discoverer". In the prompt, include existing memory summaries (for dedup).

If Phase 1 noted MEMORY.md was just created (no existing memories), skip the Memory Auditor and spawn only the Signal Discoverer.

Phase 2 is complete when both agents return reports. If either returns empty or clearly truncated (one line, no structured findings), proceed with the other's results — but if the Signal Discoverer fails, also perform a manual fallback: run python3 ${CLAUDE_PLUGIN_ROOT}/skills/recall-conversations/scripts/recent_chats.py --limit 5 --summary (the script the Signal Discoverer uses), and apply the signal criteria from the Content Quality Rules section below.

Phase 3: Synthesize & Propose (main session)

  1. Receive agent reports
  2. Deduplicate across reports and against existing memories
  3. Rank by impact, limit ADDs to 3-7 candidates; retirements and merges from the auditor are separate and not capped
  4. For each candidate: determine target layer, target section, action (ADD / EDIT / MERGE / REMOVE); write every index/cluster pointer in the Pointer Format (condition-first)
  5. Read target files, check for duplicates
  6. Present proposals:
    ### [ACTION] Learning: <summary>
    **Target:** <file> → <section>
    **Rationale:** <why this layer>
    ```diff
    - <old line>
    + <new line>
  7. Consolidation pressure (every consolidation run): (a) turn the auditor's SUPERSEDED / REDUNDANT / LOW-VALUE / MERGE findings into concrete REMOVE/MERGE proposals — a run that only adds is a failure mode; (b) then, on the reduced set, run the per-section overflow check: if a MEMORY.md section still exceeds 25 entries, propose moving it to memory/clusters/<section>.md behind a single pointer. Clustering comes after retirement so it cannot hide removable entries. When migrating into or editing a cluster, move inline rule bodies into topic files so the cluster stays a pure trigger-index (Pointer Format). Early-exit captures (no auditor findings) skip (a) and run (b) only if the new entry pushes a section past 25.
  8. Layer 0 gate — if targeting ~/.claude/CLAUDE.md, warn: "This modifies global instructions loaded in every session across all projects. Confirm?"
  9. AskUserQuestion: Approve all / Approve selectively / Reject

Phase 4: Execute

Apply approved edits in this order, so downward pressure actually lands:

  1. REMOVE: delete each retired topic file with Bash: trash <path> (trash, never rm — reversible), then remove its pointer from MEMORY.md or the cluster file.
  2. MERGE: write the merged entry, then trash the absorbed file(s) and drop their pointers.
  3. Cluster: apply approved section → memory/clusters/<section>.md migrations on the post-removal set.
  4. ADD / EDIT: apply remaining additions and edits, each pointer in the Pointer Format.

Verify before reporting: after REMOVE/MERGE, run Glob memory/**/*.md from resolved path and confirm each retired file is gone. Never mark a REMOVE/MERGE row "done" unless the file is verified absent — claiming a deletion that did not happen is the exact failure this guards against.

Output summary table:

| Learning | Action | Target | Status |
|----------|--------|--------|--------|

Only if Phase 2 agents ran (not an early-exit capture): write the consolidation marker (required — a skipped marker re-fires the nudge next session). Use Bash, not Write — the marker usually exists already, and Write refuses to overwrite a file not Read this session: Bash: date -u +%Y-%m-%dT%H:%M:%SZ > <memory-dir>/.last-consolidation

Phase 4 is complete when all approved edits are applied, every REMOVE/MERGE is verified absent via Glob, the marker is written, and the summary table is presented.

Content Quality Rules

Every candidate must pass: (1) agent would benefit from knowing this in future sessions, (2) condensed to minimum useful form, (3) placed at correct layer, (4) not already captured in target file, (5) stated as reusable principle not session-specific incident.

Pass: commands discovered through trial-and-error, non-obvious gotchas, architectural decisions with rationale, user behavioral corrections, configuration quirks, version milestones.

Fail: information readable from code, generic best practices, one-off bugs without pattern, verbose explanations, duplicates, temporary state, unverified speculation, incidents without generalizable principle.

常见问题

Extract Learnings AI 技能有什么作用?

将学到的内容保存到记忆中,或维护现有记忆。用户说“提取经验”“下次记住这个”“记住这个模式”“整理记忆”“做梦”或“清理记忆”时触发。

为什么在 TypingMind 中使用 Extract Learnings?

因为您只需安装一次,就能搭配任何模型使用。Extract Learnings 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Extract Learnings?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/gupsammy/Claudest/tree/main/plugins/claude-memory/skills/extract-learnings。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Extract Learnings?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Extract Learnings 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Extract Learnings 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Extract Learnings AI 技能免费吗?

gupsammy 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇