Captures lessons learned and pitfalls from your development work into searchable markdown files in `.codestable/compound/`. Two tracks: pitfalls (what broke and why) and knowledge (better practices you discovered). Triggers when you say "沉淀知识" or "learning", or automatically at the end of feature/issue workflows when cs-feat-accept or cs-issue-fix ask if you want to record what happened. The interview is intentionally brief, one question at a time, and skips sections if you say "nothing to add". What makes this useful is it distinguishes between specs (what you built) and learning docs (what you figured out the hard way), so teams stop solving the same problem twice. Checks for duplicates before creating new files and can update existing learning docs instead.
npx -y skills add liuzhengdongfortest/codestable --skill cs-learn --agent claude-codeInstalls into .claude/skills of the current project.
开始任何判断或动作前,先读取 .codestable/attention.md;缺失则视为骨架不完整,提示先补齐或运行 cs-onboard,不要回退到外部 AI 入口文件。
每次做 feature 或修 issue 都会留下 spec 文件。但 spec 记录的是"做了什么"和"怎么做的",不会记录"踩了什么坑"和"发现了什么更好的做法"。没有沉淀的团队总在重复解决同一个问题。
两条轨道:
两者都写入 .codestable/compound/(共享目录见 shared-conventions.md 第 1 节"归档类文档")。本技能产出 frontmatter 带 doc_type: learning,命名 YYYY-MM-DD-learning-{slug}.md。
| 情境 | 说明 |
|---|---|
| 完成 feature 工作流 | cs-feat-accept 主动问"要记录这次的学习点吗?" |
| 完成 issue 工作流 | cs-issue-fix 主动问"要把这个坑记录下来吗?" |
| 用户主动 | "记录一下"、"沉淀知识"、"learning"等 |
| 解决了一次性难题 | 不在 feature / issue 内但花了大量时间才解决的工程问题 |
主动推荐一句话即可,用户说"不用了"立刻跳过——重复推可能让用户觉得 AI 在加戏。
坑点:调试过的 bug / 绕过的配置陷阱 / 环境问题 / 集成失败……一切"本来应该好但没好"的经历。
知识:发现的最佳实践 / 工作流改进 / 架构洞见 / 可复用设计模式……一切"以后应该默认这样做"的学习。
frontmatter / 正文模板 / 完整示例见同目录 reference.md。
从对话上下文提取:
来源不明确问用户一个问题澄清不要猜。
按 shared-conventions.md §6 第 5/6 条:
--filter tags~= 或 --query 查一遍,命中相近旧文档时把候选列给用户更新路径:读旧文档 → 和用户对齐要改哪几节(常见是补新踩的坑、补当时"没找到原因"的根因)→ 起草 diff → 写回原文件 + updated: YYYY-MM-DD,不新建。
坑点轨道问:
知识轨道问:
用户对某问题说"没什么"或"跳过"就跳过——宁可少一节也不用空话填充。
AI 一次性起草完整文档(YAML frontmatter + 所有正文节)。一次性展示给用户。
compound/YYYY-MM-DD-learning-{slug}.md(日期取归档当天),frontmatter 带 doc_type: learningupdated: YYYY-MM-DDshared-conventions.md §6 第 5 条处理写完若发现一两行"每次 CodeStable 技能启动都该知道"的项目硬约束,提示用户用 cs-note 追加到 .codestable/attention.md。不要自作主张改 attention,也不要写外部 AI 入口。
完整语法见
.codestable/reference/tools.md。
# 按轨道筛选坑点
python .codestable/tools/search-yaml.py --dir .codestable/compound --filter doc_type=learning --filter track=pitfall --filter severity=high
# 按组件查相关学习点
python .codestable/tools/search-yaml.py --dir .codestable/compound --filter doc_type=learning --filter component~={组件名}
# 归档后查重叠
python .codestable/tools/search-yaml.py --dir .codestable/compound --filter doc_type=learning --filter tags~={主要 tag} --json
归档类共享规则见
shared-conventions.md第 6 节。本技能特有:
features/ 或 issues/;spec 也不放进 compound/doc_type: learningsupercent-io/skills-template
supercent-io/skills-template
huangjia2019/claude-code-engineering
reactjs/react.dev
reactjs/react.dev