Files
dotfiles/home/.config/opencode/skills/read-tweet/SKILL.md
T
Lap Tran aae4dfd6d0 feat(bird): read X cookies from Brave only
Bird 0.8.0 asks Keychain for Chrome Safe Storage, but Brave stores its key
under Brave Safe Storage, so the reader fails before it can use Brave.

Manage the Bird config in Nix and add a wrapper at ~/.pi/agent/bin/bird.
The wrapper decrypts auth_token and ct0 from Brave cookie database with the
Brave Safe Storage key and passes them to bird as env vars. It has no
browser fallback, writes no Keychain item, and never opens the credentials
file.

Add an end-to-end shell check with a fake Brave cookie source and keychain.
The check fails before the wrapper exists and passes after implementation.
2026-11-28 15:46:40 -05:00

36 lines
2.2 KiB
Markdown

---
name: read-tweet
description: Use when the user asks to read, fetch, or show the content of an X (Twitter) tweet or thread by URL or ID. Triggers on x.com/twitter.com URLs or tweet IDs. Uses the local `bird` CLI to pull content via the browser cookie session.
---
# Read X/Twitter Tweet Content with bird
When the user asks to read, fetch, view, or summarize a tweet (or thread), use the local `bird` CLI instead of `webfetch`. It authenticates through the Brave cookie session and returns full tweet content and metadata.
## Commands
Use `$HOME/.pi/agent/bin/bird`, the Brave-only wrapper. It reads the X cookies from Brave and execs the installed bird. Use an absolute path because PATH can be sparse in non-interactive shells. Do not call `/opt/homebrew/bin/bird` directly, since that skips the wrapper and asks Keychain for Chrome Safe Storage.
- Single tweet: `$HOME/.pi/agent/bin/bird read <tweet-url-or-id> --json`
- Full thread/conversation: `$HOME/.pi/agent/bin/bird thread <tweet-url-or-id> --json`
- Replies to a tweet: `$HOME/.pi/agent/bin/bird replies <tweet-url-or-id> --json`
Prefer `--json` for parseable output (author, text, media, created_at, metrics). Drop `--json` only if the user wants pretty-printed terminal output.
## When to use
- User pastes an `x.com`/`twitter.com` URL and asks anything about it
- User references a tweet by numeric ID
- User asks for "the thread", "the replies", or "what does this tweet say"
## When NOT to use
- User asks to post, reply, like, bookmark, follow, or search tweets — use other subcommands through the same wrapper (see `$HOME/.pi/agent/bin/bird --help`)
- User asks about article content linked FROM a tweet — `bird` only returns tweet text/metadata, not outbound article bodies; fall back to `webfetch` on the linked URL
## Notes
- The wrapper reads `auth_token` and `ct0` from Brave only and passes them to bird as env vars. No paid dev account needed.
- If the wrapper cannot read Brave Safe Storage, approve the Keychain dialog and retry. Do not switch browsers or call the Homebrew binary directly.
- If a fetch fails with auth errors, tell the user to sign in to x.com in Brave and retry
- Quote tweets and retweets include the referenced tweet in the JSON payload