Skip to content

Commit 1b4e4a2

Browse files
lanfuliclaude
andcommitted
Sharpen SKILL.md triggering and tighten Buffett defaults
- Rewrite description to cover all four workflows (digest, analytics, Xiaohongshu, research map) with both English and Chinese trigger phrases so the skill matches more user intents. - Slim SKILL.md by ~24% (10KB → 7.6KB): extract the AI Analysis Framework into references/analysis-framework.md, dedupe sections that mirrored references/analytics.md and references/xhs-style.md. - Replace hardcoded /Users/vincentlan/... report paths with $FOLLOW_ALEABITO_REPORTS_DIR so the skill is portable. - Default every Buffett-style field (护城河, 赚钱能力, 客户替换风险, Buffett 式好公司, 当前结论) to unverified / insufficient evidence; escalation now requires cited evidence. A single tweet is explicitly not evidence for "strong" or "proven". Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent fd8e61d commit 1b4e4a2

3 files changed

Lines changed: 127 additions & 129 deletions

File tree

skills/follow-aleabito/SKILL.md

Lines changed: 61 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,126 @@
11
---
22
name: follow-aleabito
3-
description: Track Serenity / @aleabitoreddit on X, turn new posts into concise Chinese market-aware digests, and optionally deliver them through macOS iMessage. Use when the user asks to follow aleabitoreddit, AleaBito, Serenity, or wants daily Chinese updates/reminders from that X account.
3+
description: Track Serenity / @aleabitoreddit on X and turn the feed into (1) a beginner-friendly Chinese iMessage digest with first-principles + Buffett-style judgement, (2) cumulative 60-day ticker mention analytics CSVs for a website, (3) a Xiaohongshu writing brief, and (4) a durable private research map. Trigger on requests like "follow aleabitoreddit / AleaBito / Serenity", "daily Chinese updates from that X account", "60-day mention analytics", "ticker mention count", "写小红书 aleabito", "aleabito 研究地图 / research map", or any request for Chinese commentary derived from @aleabitoreddit posts.
44
---
55

66
# Follow AleaBito
77

88
## Purpose
99

10-
Track `@aleabitoreddit` on X and produce a Chinese digest for the user. The digest must be grounded only in fetched posts and must include source URLs.
10+
Track `@aleabitoreddit` on X and produce Chinese deliverables grounded only in fetched posts. Always include source URLs. Treat the content as market commentary, not investment advice.
1111

12-
This account discusses equities, AI infrastructure, semiconductors, neoclouds, and trading ideas. Treat the content as market commentary, not investment advice.
12+
This skill handles four workflows. Pick the one(s) the user asked for and read the matching reference file only when needed:
13+
14+
| User intent | Workflow | Section |
15+
| --- | --- | --- |
16+
| Daily Chinese update / iMessage digest | Digest | [Daily Digest](#daily-digest-workflow) |
17+
| 60-day mention CSVs, ticker leaderboard, website data | Analytics | [Mention Analytics](#cumulative-mention-analytics) + `references/analytics.md` |
18+
| Xiaohongshu post | Xiaohongshu | [Xiaohongshu](#xiaohongshu-workflow) + `references/xhs-style.md` |
19+
| Research map | Research map | [Research Map](#research-map-workflow) |
20+
21+
When producing any `AI 分析`, read `references/analysis-framework.md` first. **All Buffett-style fields default to `unverified`; escalation requires cited evidence.**
22+
23+
## Paths
24+
25+
Reports go under `$FOLLOW_ALEABITO_REPORTS_DIR`. If unset, default to `$HOME/Documents/aleabito-reports`. Treat all CSV / meta paths below as `$FOLLOW_ALEABITO_REPORTS_DIR/<filename>`.
1326

1427
## Data Sources
1528

16-
Use `scripts/fetch-updates.js` to fetch posts. It tries:
29+
Use `scripts/fetch-updates.js`. It tries:
1730

1831
1. X API v2 when `X_BEARER_TOKEN` exists in `~/.follow-aleabito/.env`.
1932
2. X public syndication fallback when no token is configured.
20-
3. Logged-in Chrome/X page fallback on macOS when anonymous sources return no current posts.
33+
3. Logged-in Chrome/X page fallback on macOS when anonymous sources return nothing.
2134

22-
The syndication fallback can miss the newest posts or truncate long posts. The Chrome fallback depends on the user being logged into X in Google Chrome and may open `https://x.com/aleabitoreddit` in the active Chrome tab. When Chrome shows `Show more` inside a post, expand it before extracting text so long posts and subscriber-visible posts are not summarized from previews. If the JSON output contains `warnings`, mention them briefly in the digest or setup guidance.
35+
Caveats: the syndication fallback can miss the newest posts or truncate long ones. The Chrome fallback may open `https://x.com/aleabitoreddit` in the active Chrome tab — expand any `Show more` before extracting. If the JSON output contains `warnings`, mention them briefly in the digest or setup guidance.
2336

2437
Never invent posts, prices, positions, or links. If no fetched post has a URL, do not include it.
2538

2639
## Daily Digest Workflow
2740

28-
Run:
29-
3041
```bash
3142
cd "${CODEX_HOME:-$HOME/.codex}/skills/follow-aleabito"
3243
node scripts/fetch-updates.js --include-replies --lookback-hours 36 --max-tweets 50 --output /tmp/follow-aleabito-updates.json
3344
node scripts/build-digest-brief.js --input /tmp/follow-aleabito-updates.json --output /tmp/follow-aleabito-brief.md
3445
```
3546

36-
Read `/tmp/follow-aleabito-brief.md` before writing the digest. The brief contains ticker counts, theme groups, selected high-signal replies, and original source links. Use the raw JSON only when the brief is insufficient.
47+
Read `/tmp/follow-aleabito-brief.md` (ticker counts, theme groups, high-signal replies, source links) before writing. Use the raw JSON only when the brief is insufficient.
3748

3849
If `tweets` is empty:
39-
- If `config.notifyWhenEmpty` is true, send a short Chinese note: `今天 @aleabitoreddit 没有抓到新的可发送动态。`
40-
- If false, stop without sending.
50+
- If `config.notifyWhenEmpty` is true, send `今天 @aleabitoreddit 没有抓到新的可发送动态。`
51+
- Otherwise stop without sending.
52+
53+
Digest structure (Chinese, iMessage-sized — signal over completeness):
4154

42-
If there are tweets, write a Chinese digest with:
43-
- Title line: `Serenity / @aleabitoreddit 今日动态`
55+
- Title: `Serenity / @aleabitoreddit 今日动态`
4456
- `今天她重点看什么`
4557
- 2-4 key takeaways grouped by theme.
46-
- For each included post or theme: `她的观点` -> `小白解释` -> `第一性原理` -> `Buffett 直接判断`.
47-
- Include mentioned tickers/themes, original URL, and created time.
48-
- A short caution line for market/trading content: `仅作信息跟踪,不构成投资建议。`
58+
- For each included post/theme: `她的观点` `小白解释` `第一性原理` `Buffett 直接判断`. Read `references/analysis-framework.md` for the judgement shape and default-unverified rules.
59+
- Mentioned tickers/themes, original URL, created time.
60+
- Footer: `仅作信息跟踪,不构成投资建议。`
4961

50-
Keep it concise enough for iMessage. Prefer signal over completeness.
51-
52-
Only after `send-imessage.js` returns `status: ok`, mark tweets as seen. If delivery fails, do not run `mark-seen.js`.
62+
Send via [iMessage](#imessage-delivery). Run `mark-seen.js` **only after** `send-imessage.js` returns `status: ok`.
5363

5464
## Cumulative Mention Analytics
5565

56-
Use `scripts/analyze-mentions.js` when the user asks for 60-day mention analytics, a website-readable CSV, ongoing tracking, or ticker mention counts.
57-
58-
This workflow is cumulative, not rolling:
59-
60-
- The first run uses 60 days only as the initial backfill seed.
61-
- Later runs fetch only new content with an overlap window and append by tweet id.
62-
- Existing rows are deduped by `tweet_id`, so overlap fetches do not double-count.
63-
- If the X API fails, keep the previous CSVs and write the failure to `.meta.json`.
66+
Trigger when the user asks for 60-day analytics, ticker mention counts, website-readable CSVs, or ongoing tracking. The workflow is cumulative, not rolling — the 60-day backfill is a seed; later runs only append new events.
6467

65-
Default local website files:
66-
67-
```text
68-
/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-mentions-events.csv
69-
/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-stock-mentions-cumulative.csv
70-
/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-stock-mentions-daily.csv
71-
/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-mentions.meta.json
72-
```
73-
74-
Initial backfill:
68+
Commands:
7569

7670
```bash
71+
# initial backfill (only run once unless the events CSV is missing/corrupted)
7772
node scripts/analyze-mentions.js --backfill-days 60 --include-replies --resume
78-
```
79-
80-
Daily incremental update:
8173

82-
```bash
74+
# daily incremental
8375
node scripts/analyze-mentions.js --incremental --include-replies --resume
76+
77+
# rebuild summary CSVs from existing events without hitting the API
78+
node scripts/analyze-mentions.js --rebuild-only --include-replies --resume
8479
```
8580

86-
Use `--max-pages <n>` for cost-controlled tests. Use `--rebuild-only` to recompute summary/daily CSVs from existing events without calling the X API. Use `--output-dir <dir>` to write reports somewhere else. The script reads `X_BEARER_TOKEN` from `~/.follow-aleabito/.env` and never writes secrets into CSV output.
81+
Outputs land in `$FOLLOW_ALEABITO_REPORTS_DIR`:
8782

88-
CSV roles:
83+
- `aleabito-mentions-events.csv` — event-level rows.
84+
- `aleabito-stock-mentions-cumulative.csv` — leaderboard for website home/search.
85+
- `aleabito-stock-mentions-daily.csv` — daily ticker trend.
86+
- `aleabito-mentions.meta.json` — last update, API status, rate-limit metadata.
8987

90-
- `aleabito-mentions-events.csv`: raw event-level rows for details pages and future re-aggregation.
91-
- `aleabito-stock-mentions-cumulative.csv`: cumulative ticker leaderboard for website home/search.
92-
- `aleabito-stock-mentions-daily.csv`: daily ticker trend rows for charts.
93-
- `aleabito-mentions.meta.json`: last update, API status, output paths, page count, and rate-limit metadata.
88+
For counting rules, API cost rules, and overlap-window guidance, read `references/analytics.md`.
9489

95-
## Xiaohongshu Workflow
90+
If the X API fails, keep the previous CSVs and write the failure to `.meta.json`. Never overwrite good data on failure.
9691

97-
Use `scripts/build-xhs-brief.js` when the user asks for a Xiaohongshu post based on the mention analytics.
92+
## Xiaohongshu Workflow
9893

99-
Run:
94+
Trigger when the user asks for a Xiaohongshu post derived from the mention analytics.
10095

10196
```bash
10297
node scripts/build-xhs-brief.js \
103-
--input "/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-stock-mentions-cumulative.csv" \
104-
--daily "/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-stock-mentions-daily.csv" \
98+
--input "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-stock-mentions-cumulative.csv" \
99+
--daily "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-stock-mentions-daily.csv" \
105100
--output /tmp/follow-aleabito-xhs-brief.md \
106101
--variants both
107102
```
108103

109-
Read the generated brief and write the final post in Chinese. Default to both a full version and an under-1000-Chinese-character version unless the user asks for only one.
110-
111-
For Xiaohongshu copy:
104+
Read the generated brief, then write in Chinese. Default to producing both a full version and an under-1000-Chinese-character version unless the user asks for only one.
112105

113-
- Make it beginner-friendly and concrete.
114-
- Explain the table before interpreting it.
115-
- Treat high mention count as a research-map signal, not a buy signal.
116-
- Apply first principles and Buffett direct answers in plain language.
117-
- Do not leave Buffett questions unanswered.
106+
Read `references/xhs-style.md` for writing rules, required structure, and the default-unverified Buffett shape.
118107

119108
## Research Map Workflow
120109

121-
Use `scripts/update-research-map.js` after cumulative analytics when the user wants a durable research map.
122-
123-
Run:
110+
Trigger when the user wants a durable research map after analytics.
124111

125112
```bash
126113
node scripts/update-research-map.js \
127-
--events "/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-mentions-events.csv" \
128-
--summary "/Users/vincentlan/Documents/us stock marketplace/reports/aleabito-stock-mentions-cumulative.csv" \
114+
--events "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-mentions-events.csv" \
115+
--summary "$FOLLOW_ALEABITO_REPORTS_DIR/aleabito-stock-mentions-cumulative.csv" \
129116
--output ~/.follow-aleabito/research-map.json
130117
```
131118

132-
The script also writes `~/.follow-aleabito/research-map.md`. Preserve existing manual notes and Buffett fields when refreshing the map. Do not invent financial facts in the deterministic script; if evidence is missing, keep fields as `unverified` or `research map`.
133-
134-
## AI Analysis Framework
135-
136-
When adding `AI 分析`, use both first-principles reasoning and the local `$buffett` skill if available at `${CODEX_HOME:-$HOME/.codex}/skills/buffett/SKILL.md`.
137-
138-
For daily digests, do not use the full Buffett output template unless the user asks for a deep dive on one company. Instead, read only the relevant Buffett references and compress the analysis into 1-3 paragraphs:
139-
140-
- Always apply first principles: value comes from future owner cash flows, durability of demand, supply bottlenecks, pricing power, capital intensity, and rule-of-law/property-rights stability.
141-
- Always use beginner-friendly wording first. Explain terms such as CPO, photonics, 800VDC, P/B, TAM, ASP, margin, and cash flow when they first appear.
142-
- For business quality or moat claims, read `$buffett/references/03-business-moat.md`.
143-
- For management, acquisitions, buybacks, dilution, or capital allocation, read `$buffett/references/04-management-governance.md` and `$buffett/references/06-valuation-capital.md`.
144-
- For China/regulatory/policy risk, leverage, value traps, or when to avoid/exit, read `$buffett/references/07-risk-behavior.md`.
145-
- For technology/semiconductor/AI infrastructure themes, read the technology chapter in `$buffett/references/08-industry-playbooks.md` when needed.
146-
147-
Do not merely ask Buffett-style questions. Answer them directly from available evidence:
148-
149-
- `护城河`: strong / medium / weak / unproven, with one plain-language reason.
150-
- `赚钱能力`: proven / improving / unproven, based on revenue, margin, cash flow, or lack of proof.
151-
- `客户替换风险`: low / medium / high, based on certification, switching cost, second-source risk, and customer concentration.
152-
- `Buffett 式好公司`: yes / not yet / no.
153-
- `当前结论`: research map / investable conclusion / insufficient evidence.
154-
155-
The analysis must distinguish:
156-
- `研究地图`: useful leads to investigate.
157-
- `可投资结论`: only valid after moat, financials, valuation, and margin-of-safety work.
158-
159-
Never turn Serenity's posts into direct buy/sell instructions. Say when the evidence is insufficient for a Buffett-style decision.
119+
Also writes `~/.follow-aleabito/research-map.md`. Preserve existing manual notes and Buffett fields when refreshing. If evidence is missing, keep fields as `unverified` or `research map` — the deterministic script must not invent financial facts.
160120

161121
## iMessage Delivery
162122

163-
The iMessage recipient lives in `~/.follow-aleabito/config.json`:
123+
Recipient lives in `~/.follow-aleabito/config.json`:
164124

165125
```json
166126
{
@@ -171,48 +131,27 @@ The iMessage recipient lives in `~/.follow-aleabito/config.json`:
171131
}
172132
```
173133

174-
Send the finished digest with:
175-
176134
```bash
177135
node scripts/send-imessage.js --file /tmp/follow-aleabito-digest.txt
136+
node scripts/mark-seen.js --file /tmp/follow-aleabito-updates.json # only after send succeeds
178137
```
179138

180-
After `send-imessage.js` succeeds, mark the tweets as seen:
181-
182-
```bash
183-
node scripts/mark-seen.js --file /tmp/follow-aleabito-updates.json
184-
```
185-
186-
If iMessage delivery fails because the recipient is missing, tell the user to run:
139+
If iMessage delivery fails because the recipient is missing, point the user to:
187140

188141
```bash
189142
node "${CODEX_HOME:-$HOME/.codex}/skills/follow-aleabito/scripts/setup-config.js" --recipient "<phone-or-apple-id>"
190143
```
191144

192-
## Setup
145+
On first run, the user must also grant Messages automation permission in System Settings → Privacy & Security → Automation.
193146

194-
Initialize or update config:
147+
## Setup
195148

196149
```bash
197150
node "${CODEX_HOME:-$HOME/.codex}/skills/follow-aleabito/scripts/setup-config.js" --recipient "<phone-or-apple-id>"
151+
cp ~/.follow-aleabito/.env.example ~/.follow-aleabito/.env # then set X_BEARER_TOKEN
152+
export FOLLOW_ALEABITO_REPORTS_DIR="$HOME/Documents/aleabito-reports" # or wherever the website reads from
198153
```
199154

200-
For the most reliable and latest X data, add an X API bearer token:
201-
202-
```bash
203-
cp ~/.follow-aleabito/.env.example ~/.follow-aleabito/.env
204-
```
205-
206-
Then edit `~/.follow-aleabito/.env` and set `X_BEARER_TOKEN`.
207-
208155
## Automation
209156

210-
For Codex Desktop recurring jobs, create a daily cron automation that:
211-
212-
1. Uses this skill.
213-
2. Runs `fetch-updates.js`.
214-
3. Writes the Chinese digest to `/tmp/follow-aleabito-digest.txt`.
215-
4. Runs `send-imessage.js`.
216-
5. Runs `mark-seen.js` only after successful send.
217-
218-
Recommended default time: 8:00 AM in the user's timezone unless they specify otherwise.
157+
For a daily cron, run in order: `fetch-updates.js` → write Chinese digest to `/tmp/follow-aleabito-digest.txt``send-imessage.js``mark-seen.js` only after success. Default recommended time: 8:00 AM in the user's timezone.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Follow AleaBito AI Analysis Framework
2+
3+
This file defines how to add `AI 分析` to digests, Xiaohongshu posts, and research map entries. Read this only when you actually need to produce analysis output.
4+
5+
## Scope
6+
7+
For daily digests, do not use the full Buffett output template unless the user asks for a deep dive on one company. Compress the analysis into 1-3 paragraphs and reuse the shape below.
8+
9+
## First Principles
10+
11+
Value comes from future owner cash flows. Always reason from:
12+
13+
- Durability of demand.
14+
- Supply bottlenecks.
15+
- Pricing power.
16+
- Capital intensity.
17+
- Rule-of-law / property-rights stability.
18+
19+
## Beginner-Friendly Wording
20+
21+
Define terms the first time they appear, including but not limited to: CPO, photonics, 800VDC, P/B, TAM, ASP, margin, cash flow, customer switching cost, second source, certification cycle.
22+
23+
## Buffett References
24+
25+
Use the local `$buffett` skill if it exists at `${CODEX_HOME:-$HOME/.codex}/skills/buffett/SKILL.md`. Read only the chapters you need:
26+
27+
- Business quality / moat claims → `$buffett/references/03-business-moat.md`.
28+
- Management, acquisitions, buybacks, dilution, capital allocation → `$buffett/references/04-management-governance.md` and `$buffett/references/06-valuation-capital.md`.
29+
- China / regulatory / policy risk, leverage, value traps, exit timing → `$buffett/references/07-risk-behavior.md`.
30+
- Technology / semiconductor / AI infrastructure themes → the technology chapter in `$buffett/references/08-industry-playbooks.md`.
31+
32+
If `$buffett` is not installed, proceed with first-principles reasoning only and mark Buffett fields as `unverified`.
33+
34+
## Required Output Shape
35+
36+
For each important ticker or theme:
37+
38+
1. `她的观点` — what Serenity said, grounded in the fetched post.
39+
2. `小白解释` — plain-language reframing.
40+
3. `第一性原理` — apply the first-principles list above.
41+
4. `Buffett 直接判断` — answer the fields below.
42+
43+
## Buffett Direct Judgement — Default Unverified
44+
45+
Every field starts at `unverified` / `insufficient evidence`. Escalate only when you can cite specific evidence from the fetched post, the Buffett references, or verified public financials. A single tweet is not evidence for "strong" or "proven".
46+
47+
- `护城河`: `unverified` by default. Escalate to `weak` / `medium` / `strong` only with a one-sentence reason rooted in evidence (certifications, switching cost, network effect, regulatory barrier, unique IP, scale economics).
48+
- `赚钱能力`: `unverified` by default. Escalate to `improving` or `proven` only when revenue, gross margin, operating margin, or cash flow numbers are cited.
49+
- `客户替换风险`: `unverified` by default. Escalate to `low` / `medium` / `high` only with reasons (certification cycle, switching cost, second-source availability, customer concentration).
50+
- `Buffett 式好公司`: `not yet` by default. `yes` requires moat + 赚钱能力 + reasonable capital allocation all rated above unverified. `no` requires explicit disqualifying evidence.
51+
- `当前结论`: `insufficient evidence` by default. `research map` is acceptable when there is a lead worth tracking. `investable conclusion` requires moat, financials, valuation, and margin-of-safety work — never from tweets alone.
52+
53+
Do not ask Buffett-style questions in the final output. Answer them, even if the honest answer is `unverified`.
54+
55+
## Hard Rules
56+
57+
- Never turn Serenity's posts into direct buy/sell instructions.
58+
- Distinguish `研究地图` (leads worth tracking) from `可投资结论` (only valid after moat, financials, valuation, and margin-of-safety work).
59+
- If evidence is missing, say so. Do not invent moat, margins, customer lists, or valuation multiples.

0 commit comments

Comments
 (0)