用途:把对话中已有的结构化内容持久化到 Obsidian 仓库,处理内容检测、frontmatter 生成、文件夹路由、去重、wikilink 注入和重新索引。该技能不做研究,只保存对话中已存在的内容。
前置条件:必须安装 doc-obsidian 技能,用于通过 notesmd-cli 进行仓库增删改查、通过 qmd 搜索。
工作流:Step 0 设置 → Step 1 检测内容 → Step 2 命名与路由 → Step 3 去重检查 → Step 4 构建笔记 → Step 5 保存 → Step 6 生成 wikilink → Step 7 重新索引并确认。
Step 0 每次保存前运行: VAULT=$(notesmd-cli print-default --path-only) qmd status 任一失败则停止并提示用户先配置 doc-obsidian。
内容类型:res-deep(含 Framework: 字段头与 Research Statistics 页脚)、res-price-compare(含 PLN/EUR 价格表、TOP 3 或购买建议)、generic(其他内容)。用户可用“save as research”“save as price comparison”“save as note”强制指定。
命名与路由:res-deep 用 {topic-slug},res-price-compare 用 {product-slug}-pricing,generic 用 {topic-slug};kebab-case、小写、无特殊字符、最长 60 字符。res-deep 与 res-price-compare 默认存入 research/,generic 存入仓库根目录,可用“save to {folder}”覆盖。保存前展示名称与文件夹供确认。
去重:用 qmd search "{topic}" --json -n 5 与 notesmd-cli print 检查;无匹配则新建,完全同名则询问覆盖/追加/加后缀,主题相似则展示匹配项供选择。
构建与保存:按类型生成 frontmatter(res-deep 含 type、topic、date、sources、framework、depth、status、tags;res-price-compare 含 type、product、date、market、status、tags;generic 含 type、topic、date、status、tags),自动派生 2-5 个标签。保存用 notesmd-cli create "{folder}/{note-name}" --content "{frontmatter + body}" --overwrite;追加用 --append;更新用读取后编辑。内容超过约 100KB 时改用 Write 工具直接写入 "$VAULT/{folder}/{note-name}.md"。保存后用 notesmd-cli fm 更新 date。
wikilink:用 qmd vsearch "{topic}" --json -n 10 查找相关笔记,排除刚保存的笔记与分数低于 0.3 的项,保留前 3-5 个,在 frontmatter 后插入 Related: [[note-a]] | [[note-b]] | [[note-c]],已有则替换。
重新索引:qmd update && qmd embed,然后输出保存路径、类型、标签、相关笔记与索引状态。
模式:save(默认,完整流程)、quick(跳过去重与 wikilink)、update(对已有笔记做局部编辑)、dry-run(只预览不保存)。
限制:必须先运行 Step 0;必须先检测内容类型;除 quick 模式外必须先查重;保存后必须重新索引;仓库路径须动态获取,不得硬编码;不得创建无 frontmatter 的笔记;不得保存空笔记或占位笔记;不得在未获用户批准时修改其他技能创建的笔记;不得重复 doc-daily-digest 的功能。参考资料包括 references/frontmatter-schemas.md 与 references/folder-routing.md。