From kflow
Records pitfalls and knowledge items into searchable learning documents during feature or issue workflows. Automatically prompts after acceptance/fix or on user request.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kflow:k-learnThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
开始任何判断或动作前,先读取 `.kflow/attention.md`;缺失则视为骨架不完整,提示先补齐或运行 `k-onboard`。
开始任何判断或动作前,先读取 .kflow/attention.md;缺失则视为骨架不完整,提示先补齐或运行 k-onboard。
每次做 feature 或修 issue 都会留下 spec 文件。但 spec 记录的是"做了什么"和"怎么做的",不会记录"踩了什么坑"和"发现了什么更好的做法"。没有沉淀的团队总在重复解决同一个问题。
两条轨道:
两者都写入 .kflow/compound/(共享目录见 shared-conventions.md 第 1 节"归档类文档")。本技能产出 frontmatter 带 doc_type: learning,命名 YYYY-MM-DD-learning-{slug}.md。
| 情境 | 说明 |
|---|---|
| 完成 feature 工作流 | k-feat-accept 主动问"要记录这次的学习点吗?" |
| 完成 issue 工作流 | k-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 条处理写完若发现一两行"每次 kflow 技能启动都该知道"的项目硬约束,提示用户用 k-note 追加到 .kflow/attention.md。不要自作主张改 attention,也不要写外部 AI 入口。
完整语法见
.kflow/reference/tools.md。
# 按轨道筛选坑点
python .kflow/tools/search-yaml.py --dir .kflow/compound --filter doc_type=learning --filter track=pitfall --filter severity=high
# 按组件查相关学习点
python .kflow/tools/search-yaml.py --dir .kflow/compound --filter doc_type=learning --filter component~={组件名}
# 归档后查重叠
python .kflow/tools/search-yaml.py --dir .kflow/compound --filter doc_type=learning --filter tags~={主要 tag} --json
归档类共享规则见
shared-conventions.md第 6 节。本技能特有:
features/ 或 issues/;spec 也不放进 compound/doc_type: learningCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub kunbo928/kflow