Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/xiaobei930/cc-best/learngit clone --depth 1 https://github.com/xiaobei930/cc-bestWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00013 | $0.02167 |
| Opus 5 | $0.00006 | $0.01084 |
| Sonnet 5 | $0.00003 | $0.00433 |
| Haiku 4.5 | $0.00001 | $0.00217 |
Grade A, and why
learn scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 239 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/learn - 会话学习
从当前会话中提取可复用的知识,更新项目配置和文档。核心原则:从经验中学习,持续改进。
用法
/cc-best:learn # 从当前会话提取知识
/cc-best:learn --eval # 仅评估知识质量,不保存
/cc-best:learn --status # 查看已学习内容和置信度
/cc-best:learn --export # 导出学习内容(用于分享)
/cc-best:learn --import <file> # 导入他人的学习内容
角色定位
- 身份: 知识萃取专家
- 目标: 将会话中的经验转化为项目记忆
- 原则: 只记录有价值的、可复用的知识
核心理念
📋 详细学习理念(学习什么/不学习什么)、知识分类矩阵、学习模板、常见场景参见预加载的
skills/learning/extraction-guide.md
工作流程
0. 观察数据预加载
├─ 读取 memory-bank/observations.jsonl(如存在)
├─ 按 pattern 分组:error_fix / repeated_search / multi_file_edit / test_after_edit / fix_retry
├─ 按 pattern_id 聚合统计(v0.8.2+),显示每个 pattern_id 的 occurrence 和置信度
├─ 筛选 confidence ≥ 0.3 且当前会话的观察
├─ 高置信度模式(confidence ≥ 0.7)标记为演化候选(可固化为规则)
└─ 作为会话分析的补充输入(自动捕获 + 人工回顾 = 完整画面)
1. 会话分析
├─ 回顾当前会话的关键交互
├─ 结合 Step 0 的自动观察数据
├─ 识别有价值的知识点
└─ 分类:模式/约定/偏好/陷阱
2. 知识萃取
├─ 提炼核心要点
├─ 确定适用范围
└─ 编写简洁描述
2.5 质量评估(自动执行,--eval 模式到此为止)
├─ 具体性: 是否包含具体代码/命令/路径(非抽象原则)
├─ 可操作性: 步骤是否清晰可立即执行
├─ 范围适配: 是否与项目技术栈匹配
├─ 独特性: 是否与已有知识重复(检查 CLAUDE.md + rules/)
└─ 覆盖度: 是否覆盖主要用例和边界
评分: 每维 1-5 分,总分 ≥15 分通过
未通过: 提示改进建议,不自动保存
3. 知识存储
├─ 更新 CLAUDE.md(核心规则)
├─ 更新 rules/(具体规范)
├─ 更新 memory-bank/(项目记忆)
└─ 创建 hookify 规则(如需自动化)
4. 验证确认
├─ 检查不重复
├─ 检查不冲突
└─ 确认位置正确
触发时机
自动触发建议
- 会话结束前
- 解决复杂问题后
- 用户纠正错误后
- 发现新的项目规范后
手动触发
- 用户输入
/cc-best:learn - 用户说"记住这个"
- 用户说"以后都这样做"
学习检查清单
提取知识前
- 这个知识是项目特有的吗?
- 这个知识是可复用的吗?
- 这个知识足够重要吗?
存储知识前
- 选择了正确的存储位置?
- 描述是否清晰简洁?
- 是否与现有知识冲突?
- 是否已经存在类似记录?
存储知识后
- 格式是否正确?
- 是否需要创建 hookify 规则自动化检查?
置信度系统
📋 详细置信度等级定义和提升规则参见预加载的
skills/learning/extraction-guide.md
质量评估 | Quality Gate
知识保存前的 5 维质量评分,防止低质量知识进入知识库。
评分维度
| 维度 | 权重 | 满分条件 | 0 分条件 |
|---|---|---|---|
| 具体性 | 1-5 | 包含具体代码/命令/路径 | 仅抽象原则 |
| 可操作性 | 1-5 | 步骤清晰,可立即执行 | 模糊的"应该"建议 |
| 范围适配 | 1-5 | 与项目技术栈精确匹配 | 通用知识,无项目关联 |
| 独特性 | 1-5 | 与 CLAUDE.md / rules/ 无重叠 | 已有完全相同的记录 |
| 覆盖度 | 1-5 | 覆盖主要用例和边界 | 仅覆盖 happy path |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 239 lines · 13 tokens per session scan A 37328a9bf58e
learn is a command published in the GitHub repository xiaobei930/cc-best (50 stars, last pushed 2mo ago), licensed MIT. It adds 13 tokens to every session and 2,167 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
al
Run AgentLint diagnostic across all projects. Use when: user says /al, 'check all projects', 'agent lint', or '体检'.
tldr
Re-apply TLDR rules for this turn (verdict first, no filler).
moyu-lite
Invoke the moyu:moyu-lite skill and follow it exactly.
audit-plugin
Audit plugin skills, commands, and agents for structure, size, and naming issues.
lfe-dep-audit
Inspector sub-skill. Reviews dependency manifest files (package.json, requirements.txt, go.mod, Cargo.toml, pom.xml) changed in the current diff for risky version patterns and stale majors. Emits a human-run audit instruction rather than executing tools. Writes .plans/checks/depfindings.md. Called by lfe-inspector…
lfe-plan-critique
Run a 5-lens pre-build critique of the approved active plan before the Builder starts. Acts as the Architect persona, read-only on src/. Writes .plans/plancritique.md. Use immediately after Brain approves activeplan.md.