Skip to content

feat: Add Obsidian integration and content deduplication - #9

Open
iBlinkQ wants to merge 2 commits into
zarazhangrui:mainfrom
iBlinkQ:feat/obsidian-integration
Open

feat: Add Obsidian integration and content deduplication#9
iBlinkQ wants to merge 2 commits into
zarazhangrui:mainfrom
iBlinkQ:feat/obsidian-integration

Conversation

@iBlinkQ

@iBlinkQ iBlinkQ commented Mar 26, 2026

Copy link
Copy Markdown

Hi Zara,这个 skill 很棒!

我喜欢用 Obsidian 做知识管理,如果能将每日的 AI 摘要同步存入 Obsidian Daily 笔记,进行归档,可能会让每日的 AI 摘要产生更长期的价值,让外部资讯与个人知识库产生链接,因此我做了一些更新:

三个核心功能的增强:新增 Obsidian 每日记录自动归档新增内容去重(避免重复推送) 以及 优化摘要内容的 Markdown 排版结构

1. 新增 Obsidian 每日日记集成 (核心功能)

让生成的摘要可以在推送的同时,自动追加写入到本地的 Obsidian 每日笔记中(用户可选择是否启用)。

  • README.md / README.zh-CN.md:更新了功能介绍和快速开始步骤,补充了“可将摘要自动追加到 Obsidian”的特性说明。
  • SKILL.md
    • 在配置向导中加入了全新的 Step 5: Obsidian Archive 环节,让 Agent 询问用户是否需要启用 Obsidian 归档,并通过运行 obsidian vaults 命令验证 Vault 名称。
    • 在最后生成 config.json 的环节中加入了 obsidian 相关的配置信息。
  • config/config-schema.json:在配置结构中新增了 obsidian 相关字段设置,包含 enabled, vaultName, dailyDir (默认 "Daily") 和 sectionTitle (默认 "AI Builders Digest")。
  • scripts/deliver.js
    • 引入了 child_process.execFileSync 用作执行系统命令。
    • 新增了 saveToObsidianrunObsidiangetLocalDateString 函数。利用 Obsidian CLI 命令(如 search, daily, append)检查今天的笔记是否存在,并将摘要内容无缝拼接进去。
image

2. 本地内容去重(避免阅读重复内容)

确保每次生成的摘要只包含尚未发送过的新内容。

  • scripts/prepare-digest.js
    • 新设了持久化状态文件 ~/.follow-builders/seen-content.json,用来记录已经看过的推文、视频和文章。
    • 增加了 loadSeen(), saveSeen()filterNew() 逻辑。通过比对 Twitter ID、Video ID 和文章 URL 过滤掉历史已拉取过的内容。
    • 代码结构做了一定精简,移除了部分多余的纯文本注释。

3. 排版格式优化

让生成的报告更具结构化,优化阅读体验。

  • prompts/digest-intro.md & examples/sample-digest.md:对摘要的生成 prompt 和示例库格式进行了调整。把原来普通的纯文本大写标题加上了标准的 Markdown 层级标签(例如将 "AI Builders Digest" 改为 ## AI Builders Digest,分类模块加上了 ### 层级),从而改善在支持 Markdown 显示的终端及 Obsidian 中的排版效果。

@iBlinkQ
iBlinkQ force-pushed the feat/obsidian-integration branch from 0c3c2df to d656b04 Compare March 30, 2026 10:36
@iBlinkQ
iBlinkQ force-pushed the feat/obsidian-integration branch from e5a0723 to 61ec6fe Compare March 30, 2026 11:00
@yurenji

yurenji commented May 13, 2026

Copy link
Copy Markdown

+1 I have the same use case.
email for daily read, obsidian for knowledge base

Comment thread scripts/deliver.js
finalArgs.push(...args);
if (vaultName) finalArgs.push(vaultName);
finalArgs.push('--silent');
const obsidianPath = '/Applications/Obsidian.app/Contents/MacOS/obsidian';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

仅支持MacOS吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants