Codex skill for tracking Serenity / @aleabitoreddit on X, turning new posts into Chinese digests, adding first-principles and Buffett-style investment analysis, and optionally sending the digest through macOS iMessage.
This project is for personal research tracking. It does not provide investment advice.
Live dashboard: https://lanfuli.github.io/follow-aleabito-skill/
- Fetches posts, quotes, and optional replies from
@aleabitoreddit. - Uses X API v2 when
X_BEARER_TOKENis configured. - Falls back to public X syndication when no API token is available.
- On macOS, can fall back to the user's logged-in Chrome/X page for newer or subscriber-visible posts.
- Builds beginner-friendly Chinese digest briefs with source links.
- Adds a required analysis shape: her view, beginner explanation, first principles, and direct Buffett-style answers.
- Sends finished digests through macOS Messages/iMessage.
- Maintains cumulative mention analytics CSVs for websites or dashboards.
- Generates Xiaohongshu writing briefs and a private research map.
- Codex with local skills enabled.
- Node.js 18 or newer.
- Optional: an X API bearer token for reliable fetches.
- Optional on macOS: Google Chrome logged into X for Chrome fallback.
- Optional on macOS: Messages automation permission for iMessage delivery.
git clone https://github.com/lanfuli/follow-aleabito-skill.git
mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills"
cp -R follow-aleabito-skill/skills/follow-aleabito "${CODEX_HOME:-$HOME/.codex}/skills/follow-aleabito"Optional but recommended for the Buffett analysis layer:
git clone https://github.com/agi-now/buffett-skills.git /tmp/buffett-skills
cp -R /tmp/buffett-skills/skills/buffett "${CODEX_HOME:-$HOME/.codex}/skills/buffett"Create or update the local config:
node "${CODEX_HOME:-$HOME/.codex}/skills/follow-aleabito/scripts/setup-config.js" \
--recipient "<phone-or-apple-id>"For reliable X API fetches, create ~/.follow-aleabito/.env:
cp "$HOME/.follow-aleabito/.env.example" "$HOME/.follow-aleabito/.env"Then edit it:
X_BEARER_TOKEN=...Do not commit ~/.follow-aleabito/.env, iMessage recipients, analytics state, or generated private reports.
Fetch recent posts, quotes, and high-signal replies:
cd "${CODEX_HOME:-$HOME/.codex}/skills/follow-aleabito"
node scripts/fetch-updates.js \
--include-replies \
--lookback-hours 36 \
--max-tweets 50 \
--output /tmp/follow-aleabito-updates.json
node scripts/build-digest-brief.js \
--input /tmp/follow-aleabito-updates.json \
--output /tmp/follow-aleabito-brief.mdThen ask Codex to use $follow-aleabito to read /tmp/follow-aleabito-brief.md, write the Chinese digest, and send it by iMessage.
Only mark tweets as seen after iMessage succeeds:
node scripts/send-imessage.js --file /tmp/follow-aleabito-digest.txt
node scripts/mark-seen.js --file /tmp/follow-aleabito-updates.jsonThe analytics workflow is cumulative, not rolling. The first 60-day run seeds the dataset. Later runs append only new posts/replies/quotes and dedupe by tweet_id.
Set a website/report output directory:
export FOLLOW_ALEABITO_REPORTS_DIR="$HOME/Documents/us stock marketplace/reports"
mkdir -p "$FOLLOW_ALEABITO_REPORTS_DIR"Initial backfill:
cd "${CODEX_HOME:-$HOME/.codex}/skills/follow-aleabito"
node scripts/analyze-mentions.js --backfill-days 60 --include-replies --resumeDaily incremental update:
node scripts/analyze-mentions.js --incremental --include-replies --resumeCost-controlled test run:
node scripts/analyze-mentions.js \
--backfill-days 2 \
--include-replies \
--resume \
--max-pages 1 \
--output-dir /tmp/aleabito-test \
--state /tmp/aleabito-test/state.jsonRebuild summary files from existing events without calling the X API:
node scripts/analyze-mentions.js --rebuild-only --include-replies --resumeGenerated files:
aleabito-mentions-events.csv
aleabito-stock-mentions-cumulative.csv
aleabito-stock-mentions-daily.csv
aleabito-mentions.meta.json
Suggested website usage:
- Home/search leaderboard:
aleabito-stock-mentions-cumulative.csv - Trend charts:
aleabito-stock-mentions-daily.csv - Detail pages and source links:
aleabito-mentions-events.csv - Last update/API status:
aleabito-mentions.meta.json
A self-contained, interactive 60-day research dashboard is built from the cumulative analytics. It maps attention, mention structure (posts vs. replies vs. quotes), recent momentum, and research priority across the tracked tickers, with linked price trends.
- Live: https://lanfuli.github.io/follow-aleabito-skill/
- Source:
reports/aleabito-60d-dashboard.html(fully self-contained, no external dependencies)
Rebuild it after updating the analytics data:
node scripts/build-aleabito-dashboard.js --no-prices # offline, reuse cached prices
node scripts/build-aleabito-dashboard.js # refresh prices from Yahoo (needs network)Preview locally:
node scripts/preview-server.js # then open http://localhost:8753Published vs. private: this repo includes the dashboard and the aggregate analytics it rebuilds from (mention CSVs, aleabito-research-map.json, aleabito-price-cache.json). Personal daily analysis notes (reports/*-analysis.md) and raw fetch dumps (reports/*-api.*) are kept out of the repo via .gitignore. The dashboard is a research map only, not investment advice.
aleabito-mentions-events.csv
tweet_id,created_at,kind,text,tickers,source_url,conversation_id,referenced_tweet_idaleabito-stock-mentions-cumulative.csv
rank,ticker,mentioned_posts,raw_occurrences,post_mentions,quote_mentions,reply_mentions,first_seen,last_seen,names,primary_theme,research_priority,example_urlaleabito-stock-mentions-daily.csv
date,ticker,mentioned_posts,raw_occurrences,post_mentions,quote_mentions,reply_mentionsCounting rules:
mentioned_postscounts unique events that mention a ticker.raw_occurrencescounts cashtag occurrences inside event text.- Replies are included when
--include-repliesis used. - Retweets are excluded.
primary_themeandresearch_priorityare deterministic research labels, not investment ratings.
Generate a Xiaohongshu writing brief from the cumulative CSV:
node scripts/build-xhs-brief.js \
--input "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-stock-mentions-cumulative.csv" \
--daily "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-stock-mentions-daily.csv" \
--output /tmp/follow-aleabito-xhs-brief.md \
--variants bothThe brief is not meant to be pasted blindly. It gives Codex the data table, recent activity, theme groups, and required writing constraints so Codex can produce a polished Xiaohongshu post.
Update the private research map:
node scripts/update-research-map.js \
--events "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-mentions-events.csv" \
--summary "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-stock-mentions-cumulative.csv" \
--output "$HOME/.follow-aleabito/research-map.json"This also writes:
~/.follow-aleabito/research-map.md
The deterministic script does not invent financial facts. Missing moat, profitability, customer-risk, or Buffett-style conclusions stay marked as unverified or research map until separate research is done.
For a daily website data refresh, run:
cd "${CODEX_HOME:-$HOME/.codex}/skills/follow-aleabito"
node scripts/analyze-mentions.js --incremental --include-replies --resume
node scripts/update-research-map.js \
--events "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-mentions-events.csv" \
--summary "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-stock-mentions-cumulative.csv" \
--output "$HOME/.follow-aleabito/research-map.json"For a digest automation, send iMessage only after the digest file is generated, and run mark-seen.js only after send-imessage.js returns success.
- The Chrome fallback requires macOS, Google Chrome, and a logged-in X session.
- iMessage delivery requires macOS Messages automation permission.
- X API results and public syndication results may differ, especially for long posts and subscriber-visible content.
- This is for information tracking and research, not investment advice.
- This project is not affiliated with X, Serenity, Warren Buffett, or the Buffett skills project.