This skill tracks and archives X data including following, bookmarks, and tweets, enabling periodic digests, rewrite, and Notion synchronization.
npx playbooks add skill deletexiumu/agentskills-hub --skill x-tracker
同步并归档 X 数据(关注列表、书签、个人推文),支持内容聚合、改写和 Notion 同步。
路径约定:
{SKILL_DIR} — skill 目录(含 scripts/、references/){PROJECT_ROOT} — skill 父目录(含 config.json、data/、digests/)references/oauth-setup.mdcd {SKILL_DIR} && bun scripts/auth.ts initcd {SKILL_DIR} && bun scripts/auth.ts login所需 scope:tweet.read, users.read, follows.read, bookmark.read, offline.access
重要:不要主动运行 sync-following.ts。关注列表由定时任务或用户手动同步,新增关注需用户确认后才纳入跟踪。
cd {SKILL_DIR}
# bun scripts/sync-following.ts # ⚠️ 仅限用户明确要求时运行
bun scripts/sync-bookmarks.ts # 书签 → data/bookmarks/
bun scripts/fetch-my-tweets.ts # 个人推文 → data/my-tweets/
bun scripts/fetch-following-tweets.ts # 关注者推文 → data/following-tweets/
日常同步(不含关注列表):bun scripts/sync-bookmarks.ts && bun scripts/fetch-my-tweets.ts && bun scripts/fetch-following-tweets.ts
cd {SKILL_DIR} && bun scripts/analyze.ts digest [--date YYYY-MM-DD]
零 API 调用,基于本地 following-tweets + bookmarks。按 score = like + retweet×3 + bookmark×2 排序取 Top 20。输出 digests/{date}/digest.json。
触发流程("每日精选"/"今日精选"):
digests/{date}/digest.jsondate_distribution 日期分布作者 | 类型 | 来源标签 | 互动数据tweet_date 标注发布日期,非当日内容标注 [MM-DD]{PROJECT_ROOT}/digests/{date}/digest.mdcd {SKILL_DIR} && bun scripts/analyze.ts rewrite [--date YYYY-MM-DD] [--top 10]
按分数取 Top N,输出 digests/{date}/rewrite.json(含 is_link_only、expanded_url)。
触发流程("推文改写"/"内容改写"/"rewrite"):
date_distribution 中各日期占比,若当日(tweet_date = 今天)不足半数则展示分布并让用户确认是否继续is_link_only: true):列出这些推文的 expanded_url,提示用户手动转存网页内容后再改写,跳过这些条目先处理其余内容digests/{date}/rewrite.md改写风格指南(sub-agent prompt 必须包含):
data/my-tweets/all.json 中的原创推文风格——中英混用、网络用语自然、技术人视角cd {SKILL_DIR} && bun scripts/analyze.ts style
分析个人推文风格,输出 data/my-style/style-profile.json。
cd {SKILL_DIR} && bun scripts/fetch-tweet.ts <tweet_id>
通过 X API v2 获取单条推文全文(含 note_tweet),JSON 输出到 stdout。
cd {SKILL_DIR} && bun scripts/notion-sync.ts <following|bookmarks|all>
增量推送到 Notion 数据库。详见 references/notion-schema.md。
{PROJECT_ROOT}/config.json(gitignored):
{
"client_id": "...",
"client_secret": "...",
"access_token": "...",
"refresh_token": "...",
"user_id": "...",
"data_dir": "./data",
"notion": { "following_db_id": "...", "bookmarks_db_id": "..." }
}
references/x-api-endpoints.md — API 端点参考references/oauth-setup.md — OAuth 2.0 配置指南references/notion-schema.md — Notion 数据库 schemaWeekly roundup of top Claude Code skills, MCP servers, and AI coding tips.