Skip to content

Commit fd8e61d

Browse files
committed
Improve public README guidance
1 parent 7bb96c2 commit fd8e61d

1 file changed

Lines changed: 143 additions & 33 deletions

File tree

README.md

Lines changed: 143 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
# follow-aleabito-skill
22

3-
Codex skill for tracking Serenity / `@aleabitoreddit` on X, translating new posts into Chinese, adding first-principles and Buffett-style investment analysis, and optionally delivering the digest through macOS iMessage.
3+
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.
44

5-
## What It Does
5+
This project is for personal research tracking. It does not provide investment advice.
66

7-
- Fetches posts from `@aleabitoreddit`.
7+
## Features
8+
9+
- Fetches posts, quotes, and optional replies from `@aleabitoreddit`.
810
- Uses X API v2 when `X_BEARER_TOKEN` is configured.
9-
- Falls back to public X syndication.
10-
- On macOS, can fall back to the user's logged-in Google Chrome/X page for newer or subscriber-visible posts.
11-
- Produces Chinese digests with source links.
12-
- Adds AI analysis that separates research leads from investable conclusions.
13-
- Sends the final digest via iMessage using macOS Messages automation.
11+
- Falls back to public X syndication when no API token is available.
12+
- On macOS, can fall back to the user's logged-in Chrome/X page for newer or subscriber-visible posts.
13+
- Builds beginner-friendly Chinese digest briefs with source links.
14+
- Adds a required analysis shape: her view, beginner explanation, first principles, and direct Buffett-style answers.
15+
- Sends finished digests through macOS Messages/iMessage.
16+
- Maintains cumulative mention analytics CSVs for websites or dashboards.
17+
- Generates Xiaohongshu writing briefs and a private research map.
18+
19+
## Requirements
20+
21+
- Codex with local skills enabled.
22+
- Node.js 18 or newer.
23+
- Optional: an X API bearer token for reliable fetches.
24+
- Optional on macOS: Google Chrome logged into X for Chrome fallback.
25+
- Optional on macOS: Messages automation permission for iMessage delivery.
1426

1527
## Install
1628

@@ -29,33 +41,44 @@ cp -R /tmp/buffett-skills/skills/buffett "${CODEX_HOME:-$HOME/.codex}/skills/buf
2941

3042
## Configure
3143

44+
Create or update the local config:
45+
3246
```bash
33-
node "${CODEX_HOME:-$HOME/.codex}/skills/follow-aleabito/scripts/setup-config.js" --recipient "<phone-or-apple-id>"
47+
node "${CODEX_HOME:-$HOME/.codex}/skills/follow-aleabito/scripts/setup-config.js" \
48+
--recipient "<phone-or-apple-id>"
3449
```
3550

36-
For more reliable X data, add an X API bearer token:
51+
For reliable X API fetches, create `~/.follow-aleabito/.env`:
3752

3853
```bash
3954
cp "$HOME/.follow-aleabito/.env.example" "$HOME/.follow-aleabito/.env"
4055
```
4156

42-
Then set:
57+
Then edit it:
4358

4459
```bash
4560
X_BEARER_TOKEN=...
4661
```
4762

48-
## Run
63+
Do not commit `~/.follow-aleabito/.env`, iMessage recipients, analytics state, or generated private reports.
64+
65+
## Daily Digest
4966

50-
Daily digest:
67+
Fetch recent posts, quotes, and high-signal replies:
5168

5269
```bash
5370
cd "${CODEX_HOME:-$HOME/.codex}/skills/follow-aleabito"
54-
node scripts/fetch-updates.js --include-replies --lookback-hours 36 --max-tweets 50 --output /tmp/follow-aleabito-updates.json
55-
node scripts/build-digest-brief.js --input /tmp/follow-aleabito-updates.json --output /tmp/follow-aleabito-brief.md
71+
node scripts/fetch-updates.js \
72+
--include-replies \
73+
--lookback-hours 36 \
74+
--max-tweets 50 \
75+
--output /tmp/follow-aleabito-updates.json
76+
node scripts/build-digest-brief.js \
77+
--input /tmp/follow-aleabito-updates.json \
78+
--output /tmp/follow-aleabito-brief.md
5679
```
5780

58-
Then ask Codex to use `$follow-aleabito` to read `/tmp/follow-aleabito-brief.md`, write a beginner-friendly Chinese digest with first-principles and Buffett-style direct answers, and send it by iMessage.
81+
Then ask Codex to use `$follow-aleabito` to read `/tmp/follow-aleabito-brief.md`, write the Chinese digest, and send it by iMessage.
5982

6083
Only mark tweets as seen after iMessage succeeds:
6184

@@ -66,55 +89,142 @@ node scripts/mark-seen.js --file /tmp/follow-aleabito-updates.json
6689

6790
## Cumulative Mention Analytics
6891

69-
Build the initial cumulative dataset from the last 60 days:
92+
The 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`.
93+
94+
Set a website/report output directory:
95+
96+
```bash
97+
export FOLLOW_ALEABITO_REPORTS_DIR="$HOME/Documents/us stock marketplace/reports"
98+
mkdir -p "$FOLLOW_ALEABITO_REPORTS_DIR"
99+
```
100+
101+
Initial backfill:
70102

71103
```bash
72104
cd "${CODEX_HOME:-$HOME/.codex}/skills/follow-aleabito"
73105
node scripts/analyze-mentions.js --backfill-days 60 --include-replies --resume
74106
```
75107

76-
Then keep appending new posts/replies/quotes:
108+
Daily incremental update:
77109

78110
```bash
79111
node scripts/analyze-mentions.js --incremental --include-replies --resume
80112
```
81113

82-
By default, on Vincent's local machine this writes website-readable files to:
114+
Cost-controlled test run:
115+
116+
```bash
117+
node scripts/analyze-mentions.js \
118+
--backfill-days 2 \
119+
--include-replies \
120+
--resume \
121+
--max-pages 1 \
122+
--output-dir /tmp/aleabito-test \
123+
--state /tmp/aleabito-test/state.json
124+
```
125+
126+
Rebuild summary files from existing events without calling the X API:
127+
128+
```bash
129+
node scripts/analyze-mentions.js --rebuild-only --include-replies --resume
130+
```
131+
132+
Generated files:
83133

84134
```text
85-
/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-mentions-events.csv
86-
/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-stock-mentions-cumulative.csv
87-
/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-stock-mentions-daily.csv
88-
/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-mentions.meta.json
135+
aleabito-mentions-events.csv
136+
aleabito-stock-mentions-cumulative.csv
137+
aleabito-stock-mentions-daily.csv
138+
aleabito-mentions.meta.json
89139
```
90140

91-
For another machine or website, set `FOLLOW_ALEABITO_REPORTS_DIR` or pass `--output-dir`.
141+
Suggested website usage:
142+
143+
- Home/search leaderboard: `aleabito-stock-mentions-cumulative.csv`
144+
- Trend charts: `aleabito-stock-mentions-daily.csv`
145+
- Detail pages and source links: `aleabito-mentions-events.csv`
146+
- Last update/API status: `aleabito-mentions.meta.json`
147+
148+
## CSV Schemas
92149

93-
## Xiaohongshu + Research Map
150+
`aleabito-mentions-events.csv`
151+
152+
```csv
153+
tweet_id,created_at,kind,text,tickers,source_url,conversation_id,referenced_tweet_id
154+
```
155+
156+
`aleabito-stock-mentions-cumulative.csv`
157+
158+
```csv
159+
rank,ticker,mentioned_posts,raw_occurrences,post_mentions,quote_mentions,reply_mentions,first_seen,last_seen,names,primary_theme,research_priority,example_url
160+
```
161+
162+
`aleabito-stock-mentions-daily.csv`
163+
164+
```csv
165+
date,ticker,mentioned_posts,raw_occurrences,post_mentions,quote_mentions,reply_mentions
166+
```
167+
168+
Counting rules:
169+
170+
- `mentioned_posts` counts unique events that mention a ticker.
171+
- `raw_occurrences` counts cashtag occurrences inside event text.
172+
- Replies are included when `--include-replies` is used.
173+
- Retweets are excluded.
174+
- `primary_theme` and `research_priority` are deterministic research labels, not investment ratings.
175+
176+
## Xiaohongshu Brief
94177

95178
Generate a Xiaohongshu writing brief from the cumulative CSV:
96179

97180
```bash
98181
node scripts/build-xhs-brief.js \
99-
--input "/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-stock-mentions-cumulative.csv" \
100-
--daily "/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-stock-mentions-daily.csv" \
182+
--input "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-stock-mentions-cumulative.csv" \
183+
--daily "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-stock-mentions-daily.csv" \
101184
--output /tmp/follow-aleabito-xhs-brief.md \
102185
--variants both
103186
```
104187

188+
The 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.
189+
190+
## Research Map
191+
105192
Update the private research map:
106193

107194
```bash
108195
node scripts/update-research-map.js \
109-
--events "/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-mentions-events.csv" \
110-
--summary "/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-stock-mentions-cumulative.csv" \
111-
--output ~/.follow-aleabito/research-map.json
196+
--events "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-mentions-events.csv" \
197+
--summary "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-stock-mentions-cumulative.csv" \
198+
--output "$HOME/.follow-aleabito/research-map.json"
199+
```
200+
201+
This also writes:
202+
203+
```text
204+
~/.follow-aleabito/research-map.md
205+
```
206+
207+
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.
208+
209+
## Automation
210+
211+
For a daily website data refresh, run:
212+
213+
```bash
214+
cd "${CODEX_HOME:-$HOME/.codex}/skills/follow-aleabito"
215+
node scripts/analyze-mentions.js --incremental --include-replies --resume
216+
node scripts/update-research-map.js \
217+
--events "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-mentions-events.csv" \
218+
--summary "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-stock-mentions-cumulative.csv" \
219+
--output "$HOME/.follow-aleabito/research-map.json"
112220
```
113221

222+
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.
223+
114224
## Notes
115225

116226
- The Chrome fallback requires macOS, Google Chrome, and a logged-in X session.
117227
- iMessage delivery requires macOS Messages automation permission.
118-
- API tokens, iMessage recipients, analytics cache, and private research maps should stay outside the public repo.
119-
- This is for information tracking and research. It is not investment advice.
120-
- This project is not affiliated with X, Serenity, or Warren Buffett.
228+
- X API results and public syndication results may differ, especially for long posts and subscriber-visible content.
229+
- This is for information tracking and research, not investment advice.
230+
- This project is not affiliated with X, Serenity, Warren Buffett, or the Buffett skills project.

0 commit comments

Comments
 (0)