/common-skills:obsidian-insightfrom common-skills
Write lessons learned to the Obsidian vault's insight system. Use when the user says '记住这个教训', '沉淀一下', 'record this lesson', or wants to capture a pitfall/mistake during conversation. Creates insight files with proper frontmatter for Bases indexing. Does NOT touch common-skills:review-checklist — that's a separate compression step.
Ships in common-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
~/obsidian/sam/
首次使用时先读 ~/obsidian/sam/CLAUDE.md 的"Insight 知识沉淀体系"章节了解完整规则。
从用户消息或当前对话上下文中收集:
| 字段 | 说明 | 必填 |
|---|---|---|
| 语言/平台 | android、kotlin、rust、typescript、go 等 | 是 |
| 一句话标题 | 陷阱的本质,如"runCatching 吞 CancellationException" | 是 |
| 什么问题 | 问题本质和后果 | 是 |
| 怎么出的事 | 关键因果链(不用完整排查过程) | 是 |
| 怎么防 | 解决方案和注意事项 | 是 |
| source-bugs | 来源 bug 的 task-id(如果有) | 否 |
如果上下文中已经有足够信息(比如刚修完一个 bug),直接从上下文提炼,不要让用户重复描述。信息不足时向用户补问。
在 insights/{language}/ 下用可用的搜索工具或 shell 搜索,看是否已有覆盖同一陷阱的 insight 文件。
格式:INSIGHT-{平台缩写}-{主题}-{序号}
平台缩写:AN=Android, KT=Kotlin, RS=Rust, TS=TypeScript, GO=Go
序号从 01 开始。如果同主题已有 01,递增。
~/obsidian/sam/templates/Insight模板.md{{insight-id}}、{{language}}、{{topic}}、{{task-id}}、{{date}}、{{title}}source-bugs 改为空列表 [],删掉关联段的 root-cause 链接insights/{language}/{短横线命名}.mdcheck-ids 初始为空列表,compressed 初始为 false——压缩到 checklist 是后续独立步骤,不在本 skill 范围内。压缩完成后由压缩流程把 compressed 改为 true、check-ids 填入对应的 CHECK-XX ID。uncompressed-insights.base 视图通过 compressed == false 找到待压缩的 insight。
如果 insight 来自某个已有的 bug root-cause 文件:
projects/{project}/bugs/{task-id}/root-cause.mdinsight-status: distilled(注意是 distilled 不是 mapped——还没压缩到 checklist)insight-refs: 加上新 insight 的 ID如果 root-cause 文件不存在(用户在对话中随口提的教训,没有对应 bug),跳过这步。
输出:
common-skills:review-checklist 中。"common-skills:review-checklist——从 insight 压缩到 checklist 是独立流程(可以是手动操作或定时任务),不在本 skill 范围内.base 索引视图会自动通过 tag 查询到新 insight.obsidian/ 目录[[wikilink]] 链接相关文件insights/rust/)不存在,创建它What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
20 skills in this plugin
/adb-installGradle build 完 Android 包之后,主动提出把 APK 推到 adb 连接的设备(真机或模拟器)并拉起。TRIGGER whenever the user asks to build/compile/package an Android app, runs assembleDebug/assembleRelease, 说 '打 android 包' / '编译 android' / 'build apk' / '跑到手机上' / '装到模拟器' / 'deploy 到设备', 或者任何基于 Gradle 的 Android 构建任务 —— 即使用户没明说 adb 或部署也要触发。构建成功后主动向用户确认是否部署;若用户一开始就说了 'build 完部署' 类指令则跳过询问直接部署。设备选择: 上下文里有最近一次用过的 serial 就复用, 单设备直接用, 多设备向用户确认。部署 = adb install -r + 用 monkey 拉起 launcher activity。/defuddleExtract clean markdown content from web pages using Defuddle CLI, removing clutter and navigation to save tokens. Use instead of WebFetch when the user provides a URL to read or analyze, for online documentation, articles, blog posts, or any standard web page. Do NOT use for URLs ending in .md — those are already markdown, use WebFetch directly./npx claudepluginhub sampeng87/skills --plugin common-skills