learning
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLearning
知识管理
You are managing institutional knowledge — capturing insights, searching prior learnings, and promoting important patterns into CLAUDE.md for permanent reference.
你负责管理机构知识——捕获洞察、检索过往知识,并将重要模式推广至CLAUDE.md中作为永久参考。
When to Use
使用场景
This skill activates when:
- User invokes command
/learning - Another skill references
desplega:learning - User says "let's capture this," "what did we learn about X," or similar knowledge-management phrases
当出现以下情况时,该技能激活:
- 用户调用 命令
/learning - 其他技能引用
desplega:learning - 用户说出“我们记录下这个”、“关于X我们有哪些经验”或类似知识管理相关表述
Subcommand Routing
子命令路由
Parse the first argument to determine the flow:
| Argument | Flow |
|---|---|
(no args) or | Setup / Status |
| Capture |
| Recall |
| Promote |
| Review |
解析第一个参数以确定执行流程:
| 参数 | 流程 |
|---|---|
无参数或 | 配置/状态查看 |
| 知识捕获 |
| 知识检索 |
| 知识推广 |
| 知识审核 |
Setup / Status (/learning
with no args)
/learning配置/状态查看(无参数的 /learning
)
/learning- Check for config: Read
~/.agentic-learnings.json - If not found (first run):
- Explain the learning system briefly: "The learning skill captures, searches, and promotes institutional knowledge across sessions and projects. It stores learnings as markdown files with structured frontmatter."
- Create with the default schema (see Config File Schema below), using the local backend
~/.agentic-learnings.json - Use AskUserQuestion: "Would you like to configure additional backends? (qmd for semantic search, agent-fs for remote team storage)" with options:
["Local only (default)", "Configure qmd", "Configure agent-fs", "Configure both"] - If qmd selected:
- Check if qmd MCP tools are available (try ). Note this in config as
mcp__qmd__statusor"accessMode": "mcp"."cli" - Use AskUserQuestion: "Which qmd collections should be searched for learnings? (enter comma-separated names, e.g., 'ai-toolbox, my-notes')"
- Check if qmd MCP tools are available (try
- If agent-fs selected, walk through configuration step by step:
- Use AskUserQuestion: "Do you have an agent-fs API key configured?" with options:
["Yes, it's set in my environment (AGENT_FS_API_KEY)", "Yes, I'll provide it now", "No, I need to set one up first"] - If providing now: use AskUserQuestion: "Enter your agent-fs API key"
- If needs setup: explain how to get one and pause
- Use AskUserQuestion: "Which agent-fs organization should learnings be stored in?" with options:
["Use existing org (I'll provide the name)", "Create a new org for learnings"] - If existing: use AskUserQuestion: "Enter the organization name"
- If new: use AskUserQuestion: "What should the new organization be called?" — then run via Bash
agent-fs org create <name> - Use AskUserQuestion: "Which drive should learnings be stored in?" with options:
["Use existing drive (I'll provide the name)", "Create a new 'learnings' drive"] - If existing: use AskUserQuestion: "Enter the drive name"
- If new: run via Bash
agent-fs drive create learnings --org <org>
- Use AskUserQuestion: "Do you have an agent-fs API key configured?" with options:
- CLAUDE.md Bootstrap: After config creation, use AskUserQuestion: "Would you like me to add a Learning System section to your project CLAUDE.md so future sessions know about the learning system?" with options:
["Yes, add to project CLAUDE.md", "Yes, add to global ~/.claude/CLAUDE.md", "No, skip"] - If yes, append the following section to the chosen CLAUDE.md:
markdown
## Learning System Use `/learning recall <topic>` before research/planning to check for prior learnings. Use `/learning capture` to record significant insights, decisions, and gotchas. Config: `~/.agentic-learnings.json`
- If found (returning user):
- Show configured backends and their status (enabled/disabled)
- Count learnings per backend (local: Glob count, agent-fs: count)
agent-fs ls - Show 5 most recent learnings (filename + topic from frontmatter)
- 检查配置文件:读取
~/.agentic-learnings.json - 未找到配置文件(首次运行):
- 简要说明知识管理系统:“Learning技能可跨会话与项目捕获、检索并推广机构知识,它将知识存储为带结构化前置元数据的markdown文件。”
- 使用本地后端创建默认架构的 (参见下方配置文件架构)
~/.agentic-learnings.json - 使用 AskUserQuestion:“是否要配置额外后端?(qmd用于语义检索,agent-fs用于远程团队存储)”,选项:
["仅本地(默认)", "配置qmd", "配置agent-fs", "同时配置两者"] - 若选择qmd:
- 检查qmd MCP工具是否可用(尝试调用 ),在配置中记录为
mcp__qmd__status或"accessMode": "mcp""cli" - 使用 AskUserQuestion:“应检索哪些qmd集合中的知识?(输入逗号分隔的名称,例如:'ai-toolbox, my-notes')”
- 检查qmd MCP工具是否可用(尝试调用
- 若选择agent-fs,逐步完成配置流程:
- 使用 AskUserQuestion:“是否已配置agent-fs API密钥?”,选项:
["是,已在环境变量(AGENT_FS_API_KEY)中设置", "是,我现在提供", "否,我需要先设置"] - 若选择现在提供:使用 AskUserQuestion:“请输入你的agent-fs API密钥”
- 若需要设置:说明获取方式并暂停流程
- 使用 AskUserQuestion:“知识应存储到哪个agent-fs组织?”,选项:
["使用现有组织(我将提供名称)", "为知识创建新组织"] - 若选择现有:使用 AskUserQuestion:“请输入组织名称”
- 若选择新建:使用 AskUserQuestion:“新组织名称是什么?”——随后通过Bash执行
agent-fs org create <name> - 使用 AskUserQuestion:“知识应存储到哪个驱动器?”,选项:
["使用现有驱动器(我将提供名称)", "创建名为'learnings'的新驱动器"] - 若选择现有:使用 AskUserQuestion:“请输入驱动器名称”
- 若选择新建:通过Bash执行
agent-fs drive create learnings --org <org>
- 使用 AskUserQuestion:“是否已配置agent-fs API密钥?”,选项:
- CLAUDE.md初始化:配置完成后,使用 AskUserQuestion:“是否要在项目CLAUDE.md中添加知识管理系统章节,以便后续会话了解该系统?”,选项:
["是,添加到项目CLAUDE.md", "是,添加到全局~/.claude/CLAUDE.md", "否,跳过"] - 若选择是,将以下章节追加到选定的CLAUDE.md中:
markdown
## 知识管理系统 在研究/规划前使用 `/learning recall <topic>` 检索过往知识。 使用 `/learning capture` 记录重要洞察、决策与注意事项。 配置文件:`~/.agentic-learnings.json`
- 已找到配置文件(返回用户):
- 显示已配置的后端及其状态(启用/禁用)
- 统计各后端的知识数量(本地:全局匹配计数,agent-fs:计数)
agent-fs ls - 显示最近5条知识(文件名+前置元数据中的主题)
Capture (/learning capture
)
/learning capture知识捕获(/learning capture
)
/learning captureStep 1: Get the Insight
步骤1:获取洞察内容
- If invoked with inline text (e.g., ): use that as the insight
/learning capture "qmd requires manual update" - If no text provided: use AskUserQuestion: "What insight or learning would you like to capture?"
- 若调用时附带内联文本(例如:):直接使用该文本作为洞察内容
/learning capture "qmd requires manual update" - 若无文本提供:使用 AskUserQuestion:“你想捕获哪些洞察或知识?”
Step 2: Significance Check
步骤2:重要性检查
Before proceeding, evaluate using these default heuristics:
- Would this help someone else in a future session? (primary test)
- Is this already documented in CLAUDE.md or code comments? (skip if yes)
- Did the user correct the agent's approach? (always capture)
- Was something surprisingly difficult or broken? (usually capture)
Override: If a section exists in project or global CLAUDE.md, those rules take precedence over the defaults above.
## Learning Capture RulesIf the insight doesn't pass the significance threshold, mention this to the user but still offer to capture it — the user has final say.
在继续前,使用以下默认规则评估:
- 该内容是否能帮助未来会话中的其他人?(核心标准)
- 该内容是否已在CLAUDE.md或代码注释中记录?(若是则跳过)
- 用户是否纠正了Agent的方法?(始终捕获)
- 是否遇到了意外困难或故障?(通常需要捕获)
覆盖规则:若项目或全局CLAUDE.md中存在 章节,该章节规则优先于上述默认规则。
## Learning Capture Rules若洞察未达到重要性阈值,需告知用户,但仍提供捕获选项——最终决定权在用户手中。
Step 3: Categorize
步骤3:分类
Use AskUserQuestion: "What category best fits this learning?" with options:
- — architectural choices, trade-offs, why we chose X over Y
product-decisions - — bugs, footguns, surprising behavior, workarounds
technical-gotchas - — user corrections, workflow preferences, communication style
human-nudges - — reusable approaches, conventions, best practices discovered
patterns - — things that went wrong and what to do differently
mistakes
使用 AskUserQuestion:“该知识最适合哪个类别?”,选项:
- —— 架构选择、权衡方案、选择X而非Y的原因
product-decisions - —— 漏洞、陷阱、意外行为、解决方案
technical-gotchas - —— 用户纠正、工作流偏好、沟通风格
human-nudges - —— 可复用方法、约定、已发现的最佳实践
patterns - —— 出错的环节及改进方向
mistakes
Step 4: Scope
步骤4:范围选择
Use AskUserQuestion: "Should this learning be personal or shared?" with options:
- — saved to
Personal, visible only in this user's contextthoughts/{user}/learnings/ - — saved to
Shared, git-tracked, visible to all collaborators (human and agent)thoughts/shared/learnings/
使用 AskUserQuestion:“该知识应设为个人可见还是共享可见?”,选项:
- —— 保存到
Personal,仅当前用户可见thoughts/{user}/learnings/ - —— 保存到
Shared,受git追踪,所有协作者(人类与Agent)可见thoughts/shared/learnings/
Step 5: Write the Learning
步骤5:写入知识
- Generate filename:
YYYY-MM-DD-<slug>.md- Slug: derive from topic, lowercase, hyphens, max 50 chars
- When capturing to shared scope, include author name in slug to avoid multi-user conflicts (e.g., )
2026-03-19-taras-qmd-indexing.md
- Fill the template from with the collected information
cc-plugin/base/skills/learning/template.md - Write using the Write tool to the appropriate path
- Sync backends:
- If qmd backend enabled: run via Bash
qmd update - If agent-fs backend enabled: run via Bash
agent-fs write /learnings/<filename> --content "<content>"
- If qmd backend enabled: run
- Confirm capture with file path
- 生成文件名:
YYYY-MM-DD-<slug>.md- Slug:从主题衍生,小写字母、连字符分隔,最长50字符
- 若捕获到共享范围,slug中需包含作者名称以避免多用户冲突(例如:)
2026-03-19-taras-qmd-indexing.md
- 使用收集到的信息填充 中的模板
cc-plugin/base/skills/learning/template.md - 使用 Write 工具写入对应路径
- 同步后端:
- 若qmd后端启用:通过Bash执行
qmd update - 若agent-fs后端启用:通过Bash执行
agent-fs write /learnings/<filename> --content "<content>"
- 若qmd后端启用:通过Bash执行
- 返回文件路径确认捕获成功
Recall (/learning recall
)
/learning recall知识检索(/learning recall
)
/learning recallStep 1: Get the Topic
步骤1:获取检索主题
- If invoked with a topic (e.g., ): use that
/learning recall qmd indexing - If no topic: use AskUserQuestion: "What topic would you like to search for?"
- 若调用时附带主题(例如:):直接使用该主题
/learning recall qmd indexing - 若无主题:使用 AskUserQuestion:“你想检索哪个主题?”
Step 2: Search All Configured Backends in Parallel
步骤2:并行检索所有已配置后端
Query all enabled backends simultaneously:
- Local: Grep for the topic in and
thoughts/{user}/learnings/thoughts/shared/learnings/ - qmd: Use with
mcp__qmd__query, scoped to configured collections[{type:'lex', query:'<topic>'}, {type:'vec', query:'<topic>'}] - agent-fs: Run or
agent-fs search --query "<topic>"via Bashagent-fs fts --query "<topic>"
同时查询所有启用的后端:
- 本地:在 和
thoughts/{user}/learnings/中匹配主题thoughts/shared/learnings/ - qmd:使用 ,参数为
mcp__qmd__query,范围限定为已配置的集合[{type:'lex', query:'<topic>'}, {type:'vec', query:'<topic>'}] - agent-fs:通过Bash执行 或
agent-fs search --query "<topic>"agent-fs fts --query "<topic>"
Step 3: Present Results
步骤3:展示结果
- Rank results by relevance (exact matches first, semantic matches second)
- Show each result with: date, category, topic, and a 1-line summary
- Include references for local results
file:line - Offer to read the full learning or take action (promote, archive)
- 按相关性排序(精确匹配优先,语义匹配次之)
- 每条结果展示:日期、类别、主题、一行摘要
- 本地结果需包含 引用
file:line - 提供读取完整知识或执行操作(推广、归档)的选项
Promote (/learning promote
)
/learning promote知识推广(/learning promote
)
/learning promoteStep 1: Select a Learning
步骤1:选择待推广知识
- If given a file path: read that learning directly
- If given a topic: run recall first, then let the user select which learning to promote
- If no argument: run recall with no topic (list recent), let user select
- 若提供文件路径:直接读取该知识
- 若提供主题:先执行检索流程,再让用户选择待推广的知识
- 若无参数:执行无主题检索(列出最近知识),让用户选择
Step 2: Choose Target
步骤2:选择目标位置
Use AskUserQuestion: "Where should this learning be promoted to?" with options:
- — add to the current project's CLAUDE.md
Project CLAUDE.md - — add to the global CLAUDE.md
Global ~/.claude/CLAUDE.md
使用 AskUserQuestion:“该知识应推广至何处?”,选项:
- —— 添加到当前项目的CLAUDE.md
Project CLAUDE.md - —— 添加到全局CLAUDE.md
Global ~/.claude/CLAUDE.md
Step 3: Format and Append
步骤3:格式化并追加
- Read the full learning file
- Format it as a concise rule (1-3 lines) suitable for CLAUDE.md
- Use AskUserQuestion to confirm the formatted rule before writing
- Append to the chosen CLAUDE.md under an appropriate section (create a section if needed)
- Update the learning file's frontmatter: set to the target path (e.g.,
promoted_to:orpromoted_to: "CLAUDE.md")promoted_to: "~/.claude/CLAUDE.md"
- 读取完整知识文件
- 将其格式化为适合CLAUDE.md的简洁规则(1-3行)
- 使用 AskUserQuestion 确认格式化后的规则再写入
- 将规则追加到选定CLAUDE.md的对应章节(若需则创建章节)
- 更新知识文件的前置元数据:设置 为目标路径(例如:
promoted_to:或promoted_to: "CLAUDE.md")promoted_to: "~/.claude/CLAUDE.md"
Review (/learning review
)
/learning review知识审核(/learning review
)
/learning reviewStep 1: List All Learnings
步骤1:列出所有知识
- List all learnings from the default backend (most recent first)
- Show 1-line summaries: date, category, topic, promoted status
- Use local backend: Glob +
thoughts/{user}/learnings/*.mdthoughts/shared/learnings/*.md
- 从默认后端列出所有知识(按时间倒序)
- 展示一行摘要:日期、类别、主题、推广状态
- 使用本地后端:匹配 +
thoughts/{user}/learnings/*.mdthoughts/shared/learnings/*.md
Step 2: Select for Review
步骤2:选择待审核知识
Use AskUserQuestion (multiSelect): "Which learnings would you like to review?" with the list of learnings
使用 AskUserQuestion(多选):“你想审核哪些知识?”,选项为知识列表
Step 3: Process Each Selected Learning
步骤3:处理每个选定知识
For each selected learning:
- Show the full content
- Use AskUserQuestion: "What would you like to do with this learning?" with options:
- — no changes
Keep - — run the Promote flow for this learning
Promote - — move to
Archive(or shared equivalent)thoughts/{user}/learnings/archive/ - — remove the file entirely
Delete
对每个选定知识:
- 展示完整内容
- 使用 AskUserQuestion:“你想对该知识执行什么操作?”,选项:
- —— 不做修改
Keep - —— 为该知识执行推广流程
Promote - —— 移动到
Archive(或共享目录对应位置)thoughts/{user}/learnings/archive/ - —— 彻底删除文件
Delete
Step 4: Alternative — File Review
步骤4:替代方案——文件批量审核
If is available (check if the command exists), offer it as an alternative for batch review:
file-review- "Would you like to use file-review for a visual batch review instead?"
- If yes: create a temporary summary file and launch file-review
若 命令可用(检查命令是否存在),提供批量审核的替代选项:
file-review- “是否使用file-review进行可视化批量审核?”
- 若选择是:创建临时摘要文件并启动file-review
Step 5: Report
步骤5:结果报告
After processing all selected learnings, report: "Kept N, promoted N, archived N, deleted N."
处理完所有选定知识后,报告:“保留N条,推广N条,归档N条,删除N条。”
Backend Adapter Reference
后端适配器参考
All backends support 4 operations: write, search, list, delete.
所有后端支持4种操作:write、search、list、delete。
Local Backend
本地后端
| Operation | Implementation |
|---|---|
| write | Write tool to |
| search | Grep/Glob for topic across both personal and shared learnings directories |
| list | |
| delete | |
| 操作 | 实现方式 |
|---|---|
| write | 使用Write工具写入 |
| search | 在个人与共享知识目录中通过Grep/Glob匹配主题 |
| list | |
| delete | 通过Bash执行 |
qmd Backend
qmd后端
qmd is a local search engine over markdown documents. It can be accessed via MCP tools (if configured as an MCP server) or via CLI.
- Install: (or
npm install -g @tobilu/qmd) — github.com/tobi/qmdbun install -g @tobilu/qmd - MCP access: Use ,
mcp__qmd__query,mcp__qmd__gettools (available when qmd MCP server is configured)mcp__qmd__multi_get - CLI access: Run ,
qmd query,qmd getvia Bash (always available if installed)qmd update
| Operation | Implementation |
|---|---|
| write | Same as local (qmd indexes local files), then |
| search | MCP: |
| list | MCP: |
| delete | Delete local file + |
Prefer MCP tools when available (richer output, no shell escaping). Fall back to CLI if MCP is not configured.
qmd 是针对markdown文档的本地搜索引擎,可通过MCP工具(若配置为MCP服务器)或CLI访问。
- 安装:(或
npm install -g @tobilu/qmd)—— github.com/tobi/qmdbun install -g @tobilu/qmd - MCP访问:使用 、
mcp__qmd__query、mcp__qmd__get工具(配置qmd MCP服务器后可用)mcp__qmd__multi_get - CLI访问:通过Bash执行 、
qmd query、qmd get(安装后始终可用)qmd update
| 操作 | 实现方式 |
|---|---|
| write | 与本地后端相同(qmd会索引本地文件),随后通过Bash执行 |
| search | MCP:使用带lex+vec子查询的 |
| list | MCP:使用通配符模式的 |
| delete | 删除本地文件 + 通过Bash执行 |
优先使用MCP工具(输出更丰富,无需转义shell),若未配置MCP则回退到CLI。
agent-fs Backend
agent-fs后端
agent-fs provides remote, team-wide file storage with semantic search. Accessed via CLI only.
- Install: — github.com/desplega-ai/agent-fs
bun add -g @desplega.ai/agent-fs - CLI access: All operations use via Bash
agent-fs <command>
| Operation | Implementation |
|---|---|
| write | |
| search | |
| list | |
| delete | |
agent-fs 提供支持语义检索的远程团队文件存储,仅可通过CLI访问。
- 安装:—— github.com/desplega-ai/agent-fs
bun add -g @desplega.ai/agent-fs - CLI访问:所有操作通过Bash执行
agent-fs <command>
| 操作 | 实现方式 |
|---|---|
| write | 通过Bash执行 |
| search | 通过Bash执行 |
| list | 通过Bash执行 |
| delete | 通过Bash执行 |
Config File Schema
配置文件架构
The config file lives at :
~/.agentic-learnings.jsonjson
{
"defaultBackend": "local",
"backends": {
"local": { "enabled": true, "basePath": "thoughts/{user}/learnings/" },
"qmd": { "enabled": false, "accessMode": "mcp", "collections": [] },
"agentFs": { "enabled": false, "apiKey": "", "org": "", "drive": "" }
}
}- : which backend to use for writes (always "local" initially)
defaultBackend - : path template —
backends.local.basePathis replaced at runtime with the current user's name{user} - :
backends.qmd.accessMode(preferred, uses MCP tools) or"mcp"(fallback, uses qmd CLI via Bash)"cli" - : list of qmd collection names to search
backends.qmd.collections - : agent-fs connection details (only needed if using remote team storage)
backends.agentFs - : API key — can be set here or via
backends.agentFs.apiKeyenv varAGENT_FS_API_KEY
配置文件位于 :
~/.agentic-learnings.jsonjson
{
"defaultBackend": "local",
"backends": {
"local": { "enabled": true, "basePath": "thoughts/{user}/learnings/" },
"qmd": { "enabled": false, "accessMode": "mcp", "collections": [] },
"agentFs": { "enabled": false, "apiKey": "", "org": "", "drive": "" }
}
}- : 写入操作使用的默认后端(初始值始终为"local")
defaultBackend - : 路径模板——
backends.local.basePath在运行时替换为当前用户名{user} - :
backends.qmd.accessMode(优先,使用MCP工具)或"mcp"(回退,通过Bash使用qmd CLI)"cli" - : 需检索的qmd集合名称列表
backends.qmd.collections - : agent-fs连接详情(仅使用远程团队存储时需要)
backends.agentFs - : API密钥——可在此设置或通过
backends.agentFs.apiKey环境变量设置AGENT_FS_API_KEY
What This Skill is NOT
本技能不具备的能力
- Not a chatbot memory — learnings are deliberate, curated knowledge, not conversation history
- Not automatic — the agent doesn't auto-capture; it nudges via sub-skill references and the user/agent decides
- Not a replacement for CLAUDE.md — learnings are the staging area; important ones get promoted to CLAUDE.md
- Not brain — brain is a separate personal knowledge tool; this skill is for project/team institutional knowledge
- 不是聊天机器人记忆——知识是经过刻意筛选的结构化内容,而非对话历史
- 不是自动捕获——Agent不会自动捕获知识,仅通过子技能引用提示,由用户/Agent决定是否捕获
- 不是CLAUDE.md的替代品——知识是临时存储区,重要内容会被推广至CLAUDE.md
- 不是个人知识库(brain)——brain是独立的个人知识工具,本技能用于项目/团队级机构知识管理