‹ 首页

twitter-digest

@bofai · 收录于 5 天前 · 上游提交 1 周前

Use when the user asks to generate an X/Twitter daily digest or says phrases such as "生成X日报", "生成 x 日报", "X日报", "推特日报", "Twitter digest", or wants an agent to analyze their own X/Twitter mentions, home timeline, reply opportunities, and daily social-media summaries. This skill is API-only.

适合你,如果需要每天追踪X/Twitter上的讨论和提及

/ 通过 npx 安装 校验哈希
npx oh-my-skill add bofai/skills/twitter-digest
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- bofai/skills/twitter-digest
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify bofai/skills/twitter-digest
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
88GitHub stars
~1.7K最小装载
~4.3K含声明引用
~28.5K文本包总量
索引托管

怎么用

商店整理自技能原文 · 版本 39919d1 · 表述以原文为准
它做什么

装上后,Claude 会为用户生成一份中文的 X/Twitter 每日摘要,内容包括今日总结、需处理事项、提及你的推文、时间线热点、你的动态、数据缺口和建议回复草稿。它只通过 API 采集数据,不会自动发推或回复。

什么时候触发

当用户要求生成 X/Twitter 日报,或说出“生成X日报”、“推特日报”等关键词时触发。首次使用需配置 API 凭证。

装好后可以这样说
Claude 会运行脚本采集数据并生成摘要。
Claude 会返回时间线热点等摘要内容。
Claude 会列出提及列表并提供回复建议。
技能原文 SKILL.md作者撰写 · MIT · 39919d1

X/Twitter Digest

Overview

Use this skill to produce a concise Chinese daily digest from the user's own X/Twitter account. The data source is API-only.

Normal daily runs use:

RUN_DAILY_DIGEST

RUN_DAILY_DIGEST means the installed command for the current agent:

  • Claude Code: python3 ~/.claude/skills/twitter-digest/scripts/run_daily_digest.py
  • Codex: python3 ~/.codex/skills/twitter-digest/scripts/run_daily_digest.py

For API maintenance, CONFIGURE_API means:

  • Claude Code: python3 ~/.claude/skills/twitter-digest/scripts/configure_api.py
  • Codex: python3 ~/.codex/skills/twitter-digest/scripts/configure_api.py
Source Contract

twitter-digest has only one supported collector:

python3 twitter-digest/scripts/api_x_digest.py

The wrapper scripts/run_daily_digest.py uses API directly.

Source rules:

  • A normal "生成日报" / "日报" / "要" request always runs RUN_DAILY_DIGEST.
  • API credentials are required before a digest can be generated.
  • If API credentials are already saved, the run uses API and refreshes OAuth tokens when possible.
  • If API credentials are missing or expired, the wrapper starts API configuration. The digest must be rerun after configuration succeeds.
  • When configuration is opened in Terminal, do not ask the user to paste Client ID, Client Secret, tokens, or app credentials in chat. Tell the user to finish the Terminal flow, then rerun RUN_DAILY_DIGEST.
  • Do not switch to another data source on API errors, missing DM coverage, rate limits, permission errors, or user requests for "more complete" data.
  • If the user asks for a non-API source, visible DMs, X Chat, or cookies, explain that this skill only supports API collection and continue only if they still want an API digest.

API source isolation is strict:

  • It runs only api_x_digest.py.
  • It never reads a local profile or cookies.
  • It never supplements missing API data with another collector.
  • It never asks the user to copy cookies.

OAuth setup may open the X authorization page. That is only for authorization and is not data collection.

Required API Configuration

API access is required. If the user asks to configure API access, run:

RUN_DAILY_DIGEST --configure-api

This is the primary setup flow. It uses OAuth2 PKCE with an X Developer App Client ID and local callback URL. Request scopes:

tweet.read users.read offline.access dm.read

If the user already has an OAuth2 user access token, run:

RUN_DAILY_DIGEST --configure-api-token

If the agent is not inside an interactive Terminal, use the wrapper. It opens a real Terminal window for secure credential input and OAuth callback handling. After that command reports api_configuration_required, stop and tell the user to finish the Terminal flow. When the user says configuration is done, rerun RUN_DAILY_DIGEST.

Verify saved API configuration with:

CONFIGURE_API --verify

Clear saved API configuration with:

CONFIGURE_API --clear

Do not write ad-hoc token verification scripts. Do not ask the user to export bearer tokens manually unless they explicitly want to use environment variables.

Data Collection

For every new digest request, run collection again before reading digest-context.*. Do not reuse previous run files as if they were fresh.

Default scope:

  • Mentions of the authenticated handle.
  • Home timeline hotspots.
  • Own profile activity.
  • Optional keyword searches only when the user explicitly passes --keywords.

DM / X Chat caveat:

  • API DM access is incomplete for many accounts and may return zero events even when the user has X Chat messages.
  • Do not say "没有私信" based only on API DM results.
  • If API DM results are unavailable, report a data gap. Do not suggest another collector as a fallback inside this skill.

Time window rules:

  • Final summary facts must use only items inside [now - 24 hours, now] in the user's current local timezone.
  • Items with missing or unparseable timestamps are excluded from final-summary facts and reported as data gaps.
  • Mentions older than the 24-hour window must not appear as pending reply opportunities.

Mention handling:

  • Consider both direct mention/notification data and recent search results when available.
  • Do not present an already-replied mention as needing reply.
  • If reply status cannot be verified from current API data, label it 回复状态未确认 instead of claiming the user must reply.
Writing The Digest

After collection, read the installed current-run context with the agent's file Read tool, not shell text commands.

Normal context paths:

  • Claude Code: ~/.claude/skills/twitter-digest/.state/run/digest-context.md
  • Codex: ~/.codex/skills/twitter-digest/.state/run/digest-context.md

Focused slices:

  • digest-context-timeline.md
  • digest-context-mentions.md
  • digest-context-dm.md

Use digest-context.md and its Final Summary Facts as the content source for the Chinese digest. Use digest-input.* only for debugging collection issues.

Do not use cat, head, tail, grep, sed, python3 -c, or temporary scripts to inspect private context during normal summarization. If counts or structure must be checked, run:

python3 ~/.claude/skills/twitter-digest/scripts/inspect_digest.py
python3 ~/.codex/skills/twitter-digest/scripts/inspect_digest.py

Adjust the path to the current agent.

Digest format:

  • 今日总结.
  • 该处理.
  • 谁 @ 了你.
  • 时间线热点.
  • 你的动态.
  • 数据缺口.
  • 建议回复草稿.

Never automatically post, reply, like, follow, block, open suspicious links, accept requests, or send DMs. Replies are drafts only unless the user explicitly asks to send after reviewing.

Install

From a checked-out repository:

python3 twitter-digest/scripts/install.py

The installer checks Python 3.9+ and installs the skill into the target agent skill directory.

Default install targets the current agent client:

  • Codex: ~/.codex/skills/twitter-digest
  • Claude Code: ~/.claude/skills/twitter-digest

Use --client codex, --client claude, or --skills-dir to override. Local development can use --symlink.

Reinstalling is upgrading. The installer moves the existing installed skill to .backups/, disables backup SKILL.md files so agents do not load old duplicate skills, and preserves the active installed .state directory.

Uninstall:

~/.codex/skills/twitter-digest/uninstall.sh --client codex
~/.claude/skills/twitter-digest/uninstall.sh --client claude

Use --purge-state only when the user explicitly wants API config and current-run files removed permanently.

Run Outputs

Each run writes only current-run files:

  • <installed-skill>/.state/config.json
  • <installed-skill>/.state/api_config.json
  • <installed-skill>/.state/run/digest-context.md
  • <installed-skill>/.state/run/digest-context.json
  • <installed-skill>/.state/run/digest-context-timeline.md
  • <installed-skill>/.state/run/digest-context-mentions.md
  • <installed-skill>/.state/run/digest-context-dm.md
  • <installed-skill>/.state/run/digest-input.md
  • <installed-skill>/.state/run/digest-input.json

No long-term memory or daily archive is produced. Run dates use the user's local timezone.

Troubleshooting
  • Missing API config: run RUN_DAILY_DIGEST --configure-api.
  • Token refresh failed: the wrapper opens API configuration and retries once.
  • API permission/tier/rate-limit errors: report the data gap or failure.
  • Non-API source requests: unsupported in this skill.
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。