一键导入
briefing
Daily portfolio briefing with 3 tiers: /briefing (quick ~1min), /briefing full (~3min), /briefing deep (~5min). Replaces daily-briefing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Daily portfolio briefing with 3 tiers: /briefing (quick ~1min), /briefing full (~3min), /briefing deep (~5min). Replaces daily-briefing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Fetch live brokerage positions and generate a comprehensive portfolio report with sector allocation, P&L analysis, options summary, and risk assessment. Use when user asks for portfolio review.
Analyze a stock ticker with fundamentals, technicals, analyst ratings, and investment thesis. Usage - /stock-analysis TICKER or /stock-analysis TICKER1 TICKER2 for comparison.
強制 first-principles 機率分布 + EV 計算。用於檢查當前組合在指定時間窗的預期報酬,禁止用 default bell shape 或質性語言。Usage - /ev-check [30d|7d|14d] [optional scenario theme]
Calculate and compare options strategies (sell put, covered call, LEAPS, naked call) for a given ticker. Usage - /options-strategy TICKER STRATEGY
Daily portfolio briefing with 3 tiers: /briefing (quick ~1min), /briefing full (~3min), /briefing deep (~5min). Replaces daily-briefing.
強制 first-principles 機率分布 + EV 計算。用於檢查當前組合在指定時間窗的預期報酬,禁止用 default bell shape 或質性語言。Usage - /ev-check [30d|7d|14d] [optional scenario theme]
| name | briefing |
| description | Daily portfolio briefing with 3 tiers: /briefing (quick ~1min), /briefing full (~3min), /briefing deep (~5min). Replaces daily-briefing. |
| user_invocable | true |
| model | claude-opus-4-8 |
三層結構的每日投資組合簡報,取代原 /daily-briefing。
/briefing → Quick(~1 分鐘)/briefing full → Quick + Full(~3 分鐘)/briefing deep → Quick + Full + Deep(~5 分鐘)/briefing telegram → Telegram Push Tier(~2-3 分鐘)— 盤中推送專用,不跑 Phase 1-3任何 tier 加上 --send 會在 tier 執行完後:
briefing-out/YYYY-MM-DD-full.md(Write tool)briefing-out/YYYY-MM-DD-telegram.txt(Write tool)python3 tools/send_briefing.py YYYY-MM-DD(Bash tool)推送至 Telegram + Email
generate_html.py,push HTML 到 reports repo,並在 Telegram 訊息末加上網頁連結briefing telegram 沒有 --send 時:只寫 briefing-out/ 兩個檔案,不發送。
若需手動生成 HTML(不發送):python3 tools/generate_html.py briefing YYYY-MM-DD [--push]
/briefing(quick)→ Sonnet 4.6(純彙整;session 已長則先 /compact)/briefing telegram → Sonnet 4.6(每日 launchd 自動推送,成本敏感,固定 Sonnet;週五 --codex 另走 gpt-5.5)/briefing full → Opus 4.8(中等綜合 + Verdict;Phase 2 subagent 已外包 Haiku)/briefing deep → Opus 4.8(深度合成 + Codex 整合 + 機率/EV)切換方式:/model sonnet、/model opus 或 /model fable 後執行 skill。
執行 CLAUDE.md 的 Step 0 統一規範(0a → 0b → 0c → 0d → 0e)。
plan.md + feedback/*.md(必做)get_account_position 取即時持倉讀 cache(不打 API,所有數據由 tools/fetch_macro.py 預載到 briefing-out/cache/macro-snapshot.json):
Read briefing-out/cache/macro-snapshot.json
判定:
status == "ok" 或 "partial" 且 cache mtime < 36h → 使用,在 Quick Take 區前顯示 1 行:
📊 Macro: Fed {fed_funds}% | 2s10s {value} ({regime}) | HY OAS {value} ({regime}, pct {pct_1y}%) | VIX {value} ({regime}) | regime: {regime_tag}
status == "skipped"(FRED key 缺失)→ 顯示 ⚠️ Macro snapshot unavailable (FRED_API_KEY not set) 並跳過⚠️ Macro snapshot stale ({mtime_hours}h old) 仍使用但標記將 5 個 series + regime_tag 內容餵給 Step 0e 與後續呼叫的 probability-honesty-checker agent(其 Step 1i 必須收到此資料)。
讀 cache(由 tools/earnings_history.py 預載):
Read briefing-out/cache/earnings-history.json
Read briefing-out/cache/earnings-dates.json
判定:
status == "ok" → 使用,後續 Section 4.5 與 Telegram tier earnings 區直接引用status == "skipped" / mtime stale → 標記 ⚠️ Earnings cache stale 但仍使用最後一份這兩份資料用於:
Trailing 8Q beat / avg surprise 欄位📅 Earnings This Week 加 beat rate 標註probability-honesty-checker Step 1d「Base rate」備選來源(EODHD fundamentals-snapshot 為首選)讀 cache(由 tools/fetch_fundamentals.py 預載,TTL 24h):
Read briefing-out/cache/fundamentals-snapshot.json
判定:
status == "ok" 且 mtime < 30h → 使用,供估值區塊、probability-honesty-checker 1d/1h 使用status == "skipped" / mtime > 30h / 缺失 → 標記 ⚠️ Fundamentals cache stale/missing;Deep tier 強制派 subagent 刷新,Quick/Telegram 標旗但繼續EODHD 資料缺口處理(必守):
highlights.pe_ratio == 0.0 或 peg_ratio == 0.0 → 丟棄該三錨點錨,標 (anchor unavailable),不進 Fair PE 計算avg_surprise_pct 對低基期股(EPS estimate ≤$0.10)可能失真 → beat 次數可信,avg% 在機率計算中標 (unreliable-low-base) 並拉寬區間Cache-miss fallback / Deep 強制刷新:
Agent(subagent_type="data-collector",
prompt: "對以下全部持倉(TICKER.US 格式)呼叫 mcp__eodhd-mcp__get_fundamentals_snapshot 與
mcp__eodhd-mcp__get_earnings_history,回傳 dict {ticker: {snapshot:{...}, base_rate:{...}}},
不分析不合成。")
Deep tier 每次必跑(強制刷新);Quick/Full 僅在 cache miss 時派。
這份 cache 用於:
probability-honesty-checker Step 1d(beat base-rate 首選來源)與 Step 1h(quarterly growth → fundamental intact X/Y)fair_value_before/after 重算從同一 cache 取三錨點輸入讀 cache(由 tools/fetch_news.py 預載,TTL 6h):
Read briefing-out/cache/news-articles.json
判定:
status == "ok" 且 mtime < 8h 且 "content" in fields_available → 使用,P3 信號擷取(Deep tier §9.5)可讀 bodystatus == "ok" 但 "content" not in fields_available → 有限使用(只有 headline+sentiment,P3 只能做 headline 掃描,標 ⚠️ news body 不可用)status == "skipped" / mtime > 8h / 缺失 → 標記 ⚠️ News cache stale/missing,Quick/Full/Telegram 略過 P3 信號擷取,Deep tier 繼續(P3 降級為僅 SEC/逐字稿)帳本 = research/thesis-ledger.json,工具 = tools/thesis_ledger.py(去重/碰撞/到期/過期/統計全在程式層,Claude 不手改 JSON)。
1. 取得今日到期清單(同時自動 expire sweep):
python3 tools/thesis_ledger.py due
回傳 {due:[...], expired:[...]}。expired 是工具自動把「逾期 >30 天未驗收」轉掉的,當作無結果。
2. 對每筆 due thesis 驗收:
trigger.metric → 知道要抓什麼(財報營收/ASP/毛利率、板塊 ETF、價格…)earnings_history.py cache / technical 等)抓實際數字thesis + falsification 判定 passed / failed / partialreschedule 把觸發日往後推、維持 pending,絕不猜 verdict:
python3 tools/thesis_ledger.py reschedule --id <id> --to YYYY-MM-DD --reason "財報未出"
resolve 帶結構化旗標:
pe_ratio × fwd_eps 各情境) → fair_value_after;price_impact_pct = (after−before)/beforefair_value_after 下修impact_decomp = "thesis +X%(基本面)/multiple −Z%(re-rate)=net −W%"python3 tools/thesis_ledger.py resolve --id <id> --verdict passed|failed|partial \
--actual "實際數字" --note "判讀" --next-action "由此推出的操作" \
--fair-value-before <float> --fair-value-after <float> \
--price-impact-pct <float> --impact-decomp "thesis +X%/multiple −Z%=net −W%"
fair_value_before/after 取自 Step 0.65 fundamentals cache 的三錨點計算;全部選填,有數就帶。3. 讀 research/naked-call-watchlist.md(若存在):
Read research/naked-call-watchlist.md
用 macro-snapshot.json(10Y UST、VIX)+ get_batch_indicators 2 日技術確認,評估其 3 閘門狀態:
🔒 LOCKED: G1/G2/G3 [狀態])🎯 樂透閘門達標:{ticker} 可評估進場,加入 Key Alerts actionable 與 Telegram T5/T6--send / launchd 路徑用 Write 追加今日欄位到 watchlist;互動 quick/full/deep 僅輸出提議行,不 Write4. 輸出「📋 thesis 驗收」區塊(接在 Key Alerts 後 / Quick Take 前):
## 📋 thesis 驗收
| thesis | 命題 | 實際 | verdict | 公允價 before→after | 價格影響 | → actionable |
|--------|------|------|---------|---------------------|---------|-------------|
| MU:memory-cycle | DRAM 漲價毛利率>40% | ASP +8%、毛利率42% | ✅ passed | $320→$370 | +15.6% | HOLD,加碼門檻 $XXX |
(無到期項則略過此區塊;「公允價 before→after」和「價格影響」欄只在 resolve 時填,reschedule 留空)
⏳ 逾期未驗收已歸檔:[expired 清單,若有]
驗收結果直接餵 actionable:passed → 強化/HOLD/加碼(含新公允價上修幅度);failed → 汰弱/減碼(含公允價下修多少);partial → 分解 thesis vs multiple 成分後決定操作。resolve --next-action 寫的就是下一步行動,併入 Key Alerts / 行動項。
若 Step 0b 偵測到倉位變化,輸出差異表:
## ⚡ 倉位變動(vs 上次快照 YYYY-MM-DD)
| 類型 | 操作 | 標的 | 變化 | 計畫對應 |
無變動則顯示「倉位無變化」。
日期: YYYY-MM-DD
組合市值: $XXX,XXX (日變動: +/- $X,XXX / +/- X.XX%)
總損益: +/- $X,XXX (+/- X.XX%)
持倉: XX 檔股票 + XX 個選擇權合約
全持倉依日漲跌%排序:
| 標的 | 股數 | 現價 | 日漲跌% | 市值 | 總損益% |
+2% 或 -2% 標記。
4a. 無現股標的價格確認:
比對選擇權持倉的 underlying ticker vs 現股持倉。若 underlying 沒有對應現股(如 CRWD、DDOG、GOOGL、LRCX、TSLA、TEAM),
使用 mcp__technical-mcp__get_batch_indicators 或 mcp__yfinance-advanced__get_stock_info 取得該標的目前現股價格。
在 Options Status 表格中加入「標的現價」和「距 Strike %」欄位,方便判斷 ITM/OTM 狀態。
4b. Options 總覽表:
| 合約 | 方向 | 到期日 | 剩餘天數 | 標的現價 | 距Strike% | 損益% | 狀態 |
⚠️ 標記剩餘 <14 天的合約。
為何必要: 持倉 ticker 在 ±48h 內若有財報,technical signal(trend / momentum / RSI)會被 earnings reaction 主導,不是結構性訊號。直接套「弱勢持續 → 減碼」會在 fundamental beat 後賣在低點(PLTR 5/5 案例)。
資料來源:Step 0.6 已預載 briefing-out/cache/earnings-dates.json + earnings-history.json,直接從 cache 取,不再呼叫 MCP(若 cache 缺失或 ticker 不在,才 fallback mcp__fmp-mcp__getEarningsCalendar)。
執行步驟:
從 cache 列出未來 7 天內、或過去 48h 內有財報的持倉 ticker
對 earnings window(±48h)內的 ticker,在 Step 5 Technical Snapshot 表格的「標的」欄位前綴 ⚠️
對 earnings window 內的 ticker:
輸出格式(必須含 base rate):
| 標的 | 日期 | 時機 | 距 earnings | Trailing 8Q beat | Avg surprise % | 狀態 |
|------|------|------|------------|-----------------|---------------|------|
| NVDA | 2026-05-20 | AMC | 2d | 8/8 (100%) | +6.3% | 🔴 window 內 |
| AVGO | 2026-06-03 | AMC | 16d | 7/8 (87.5%) | +3.4% | 觀察中 |
Trailing 8Q beat 與 Avg surprise % 從 earnings-history.json 的 beat_count/total 與 avg_surprise_pct 直接讀。
若 cache status ≠ "ok" 或 ticker 不在 cache → 該欄填 (unavailable),並在輸出末尾加註 ⚠️ N tickers 缺 earnings cache(請手動 python3 tools/earnings_history.py --force)
詳見
feedback/earnings-reaction-window.md與feedback/weak-signal-root-cause.md
使用 mcp__technical-mcp__get_batch_indicators 取得全持倉技術指標。
欄位順序(依決策權重排列):
| 標的 | 現價 | 趨勢 | MACD | 量能比 | 動能分 | RSI |
複合訊號標記規則(必須多指標同時觸發 + 無 earnings window):
| 標記 | 觸發條件 |
|---|---|
| 🔴 拋物線警示 | strong_uptrend + RSI > 75 + volume_ratio < 0.8(創高但量縮,背離) |
| 🔴 弱勢持續 | downtrend + momentum_score < -30(不是機會,是落刀) |
| ⚠️ 動能背離 | uptrend + momentum_score 轉負 OR death_cross(趨勢未破但動能轉弱) |
| 🚀 強勢確認 | golden_cross + strong_uptrend + volume_ratio > 1.2 |
| 🟡 留意 | RSI > 70 但無以上複合條件 → 只標數字,不加警示標籤 |
| ⚠️ earnings window | 過去/未來 48h 有財報 → 以上規則一律不套用,標記 wait N+1d |
根因分類規則(看到弱勢/強勢訊號必做):
對任一 weak_down / strong_down / momentum < -20 訊號,先回答根因再行動:
只有 (a) 才執行「汰弱留強」減碼。詳見 feedback/weak-signal-root-cause.md
只在觸發時顯示(無則跳過整個 section):
🔒 強制:機率分布必須呼叫 probability-honesty-checker agent
寫出機率分布 / EV 之前必須執行:
Agent(
subagent_type: "probability-honesty-checker",
description: "Briefing quick take EV check",
prompt: """
計算當前組合 7 日 horizon 機率分布與 EV。
## Step 1 九項輸入(已備齊):
1a. RSI 分布: [從 Section 5 Technical Snapshot 摘出,每 bucket 檔數 + % of port]
1b. 距 52w 高: [從 get_stock_info 摘出,中位數/最大/最小]
1c. 已實現波動: 過去 5d/2d 累積,最大單日
1d. Binary catalysts (window 7d): [從 Section 4.5 Earnings Calendar Check 摘出,
**必須含 trailing 8Q beat rate + avg surprise %**。
資料來源優先順序:
(1) fundamentals-snapshot.json → tickers.TICKER.base_rate(EODHD,首選)
(2) earnings-history.json → tickers.TICKER(yfinance,備選)
格式:「N/8 beat, +X.X% avg」。⚠️ 低基期股(AMD/CRDO/ONTO 等 avg_surprise_unreliable=true)→ 只用 beat N/8,avg% 標 (unreliable-low-base) 不進 Step 3。cache 缺 → (unavailable)]
1e. 集中度: top 1 / top 5 / 最大板塊(從 Section 1 倉位 + B 板塊配置)
1f. 板塊輪動曝險: leading 持倉 % / lagging 持倉 %(從 sector rotation)
1g. Sentiment: 7d/30d 對比(如 quick tier 無 sentiment 數據則標 N/A)
1h. Thesis 健康度: 持倉 fundamental 是否 intact
1i. Macro state: [從 Step 0.5 載入的 macro-snapshot.json 完整貼入:
fed_funds + 30d change / yield_2s10s + regime / hy_oas + regime + pct_1y /
vix + regime / cpi_yoy + trend / regime_tag]
## 額外 context:
[plan.md 摘要 + 最近 N 天事件]
請執行你的 6 步流程並回傳完整輸出 + 精簡結論。
"""
)
收到 agent 結果後 verbatim 顯示精簡結論(含 EV 數字)。不可手動改機率或寫質性結論。
第一性檢查(Quick Take 前必填):
### 第一性檢查(市場主題)
- **核心 thesis:** [1 句可驗證命題]
- **證偽條件:** [2-3 個 falsifiable]
- **機率分布:** [由 probability-honesty-checker agent 算出,引用其精簡輸出]
- 樂觀 X% / 基準 X% / 悲觀 X%
- EV (7d) = X.XX%
2-3 句總結(明確 conditional 在 thesis 機率):
💰 估值快訊(Quick tier 僅一行,cache 算):
💰 估值:{最被低估標的} vs 公允價 −X%(三錨點中位) | {最被高估標的} vs 公允價 +X% | 今日 thesis 影響:{ticker} {verdict}→ $FV_before→$FV_after(±X%) | 自建分歧最大:{ticker} A4 vs A3 {±X%}
規則:
self_valuation.own_target_price vs A3 wall_street_target 計算 A4vsA3 = (own_target − A3_target)/A3_target;取 ≥3% 持倉中絕對分歧最大者;confidence==unavailable 的 ticker 跳過;整段在所有 ≥3% ticker 都是 unavailable 時省略禁止偷懶(直接由 agent self-audit 攔截,主 skill 絕不可寫):
第一性檢查產出後 → 登錄 Thesis Ledger(收尾步驟):
只登錄有明確時間/事件觸發點的 thesis(當日核心市場 thesis + 行動項裡帶「請在財報後/N 日後檢視」的個股 micro thesis);沒有觸發點的泛泛評論不登錄。
每筆登錄前先看既有,避免 slug 飄移:
python3 tools/thesis_ledger.py list --ticker <T>
python3 tools/thesis_ledger.py add --ticker <T> --slug <slug> \
--thesis "<可驗證命題>" --falsification "<證偽點1>" "<證偽點2>" \
--trigger-type event|date --trigger-date YYYY-MM-DD \
[--event earnings] [--metric "到期要比的指標"] --source briefing --ev "<EV snapshot>"
supersede--ticker MARKET/briefing full 或 /briefing deep 時執行)資料來源: Step 0.65 fundamentals-snapshot.json(cache-first;Deep tier 強制已刷新)
執行範圍:
三錨點 Fair PE 計算規則(每檔必守):
| 錨點 | 來源欄位 | 規則 |
|---|---|---|
| A1(市場隱含) | highlights.pe_ratio | == null / 0.0 → 丟棄,標 (N/A) |
| A2(成長合理) | highlights.peg_ratio × (quarterly_revenue_growth_yoy × 4 或 fwdEPS_growth%);AI 龍頭(NVDA/AVGO/CRWD/AMD)目標 PEG 1.5,其餘 1.0 | == null / 0.0 → 丟棄 |
| A3(分析師隱含) | highlights.wall_street_target ÷ fwdEPS。fwdEPS 來源優先序: ① snapshot.forward_estimates.curr_fy.eps_avg(EODHD 真實賣方共識,當前 FY)→ ② forward_estimates.next_fy.eps_avg(次年 FY)→ ③ 保底 eps_ttm × (1 + growth%) 近似。cache 已在 self_valuation.a3_fwdeps_source 標來源(consensus_curr_fy/consensus_next_fy/approx),直接讀勿重推 | 任一缺 → 丟棄 |
情境指派規則(可重複):
⚠️ 單錨低信心情境 FwdEPS:
forward_estimates.curr_fy.eps_avg;缺則 next_fy;再缺才用 eps_ttm×(1+growth) 近似)forward_estimates.{curr_fy,next_fy} 另帶 eps_revision_30d_pct 與 revisions_up_30d / down_30d——共識 30 日內上修(up≫down 或 pct>0)= guidance 偏正領先訊號,可在備註或 P3 訊號推導引用(非估值輸入)Full tier 輸出表(每持倉一行):
| 標的 | 現價 | A1 PE | A2 PEG錨 | A3 PT錨 | Fair PE(基/牛/熊) | FwdEPS | 公允價(基/牛/熊) | A4自建目標 | A4vsA3分歧% | 現價/公允基% | 備註 |
|------|------|-------|---------|---------|-----------------|--------|----------------|----------|------------|------------|------|
| MU | $XXX | 40.8 | 35.2 | 44.1 | 40.8/55.1/28.6 | $9.2 | $375/507/263 | $987 ⚠️低信心 | +33% | −8% | beat 8/8 |
| CRWD | $XXX | N/A | 62.1 | 71.3 | 66.7/89.1/46.7 | $3.8 | $253/339/177 | (self-val N/A) | — | +5% | A1 anchor N/A |
欄位說明:
⚠️ 大幅偏離;若 abs > 50% → 標 ⚠️⚠️ 異常大偏離,錨點可能失效self_valuation.own_target_price(cache 已算,不重算);confidence=="unavailable" → 標 (self-val N/A);confidence=="low" → 標 ⚠️低信心(A4目標 − A3 wall_street_target) / A3 wall_street_target;A4 不進 median(A1,A2,A3),不進 EV(與 DCF 同為 sanity/divergence flag)DCF 交叉檢核(Deep tier 每檔追加一行):
mcp__fmp-mcp__getDCFValuation(ticker)
DCF 交叉: $XXX (vs 基準公允 $XXX, 差 ±X%) [⚠️ 乖離>30% → 錨點存疑]DCF 不可用 (FMP free tier) 靜默略過資料缺口標準處理(不得猜測):
A1: N/A (CRWD 已知缺口)A2: N/A(CRDO 已知缺口)A3: N/A(fwdEPS unavailable),不輸出公允價使用 Agent 子代理(subagent_type: "data-collector")取 top 5 持倉的情緒數據:
get_sentiment_trend(ticker format: "TICKER.US")| 標的 | 7日情緒 | 30日情緒 | 趨勢 | 備註 |
情緒 < -0.3 的標的額外調用 get_news_sentiment 顯示負面新聞。
目的: 從 news body + SEC 8-K + 宏觀 calendar 抽已量化陳述,推導可驗證 thesis 候選,補上財報間隙的高頻 thesis-health 信號。
反幻覺門檻(必守): 每個 signal 必須附 raw_quote(≤120 字逐字引用);無 quote → 無 signal;只有 narrative → 明寫「無可量化信號(only narrative news)」,不捏造數字。
資料管道優先順序(可靠度由高到低):
mcp__sec-edgar-mcp__analyze_8k)→ confidence: high;僅針對 ≥3% 持倉在過去 14 天有新 8-K 者mcp__fmp-mcp__getEarningsTranscript 最新一份,取 capex/ASP/wafer/utilization 句)→ confidence: high;僅財報後 30 天內news-articles.json,需 "content" in fields_available)→ confidence: medium(一般新聞常缺晶圓級細節)macro-snapshot.json regime_tag + get_economic_calendar(high_impact_only=True))→ 宏觀主題 thesis 輸入訊號 record shape(Claude 輸出,不寫 JSON 到 cache):
metric: wafer_starts / capex / ASP_QoQ / segment_revenue / utilization / Fed_rate / CPI
value: "+8% QoQ"(逐字含單位)
direction: up | down | flat
ticker/theme, source_url_or_desc, source_type: news|sec_8k|transcript|macro, date
confidence: high | medium | low
raw_quote: "<逐字引用,≤120 字>" ← 無此欄 = 不成立
訊號 → thesis 轉換(Step 0e 紀律): signal 需轉成 1 句可驗證命題 + 2-3 量化證偽點 + 觸發點才算完整 thesis:
SIGNAL: MU 投片量 +8% QoQ (source: EODHD/Reuters, conf medium)
→ THESIS: "MU 投片量 +8% QoQ 預示 FY27 bit 出貨 YoY >25% 且 DRAM ASP 不跌破 −5% QoQ"
→ FALSIFY: ["下季 bit shipment YoY <25%","DRAM ASP QoQ <−5%","guide 下修 >10%"]
→ TRIGGER: event, <next_earnings from earnings-dates.json>, metric="bit shipment YoY + DRAM ASP QoQ"
Thesis 登錄規則: 僅 confidence ∈ {high, medium} 且有明確前瞻 trigger → 登錄 ledger(--source signal-inference,--ev 存 signal provenance);confidence=low 只在 briefing 文字呈現,不入 ledger;exit-code-2 碰撞 → 改 slug 或 supersede。
python3 tools/thesis_ledger.py list --ticker <T> # check existing first
python3 tools/thesis_ledger.py add --ticker <T> --slug <slug> \
--thesis "..." --falsification "..." "..." \
--trigger-type event|date --trigger-date YYYY-MM-DD \
--event earnings --metric "..." \
--source signal-inference \
--ev "signal: <metric> <value>, <source>, conf=<confidence>"
誠實退化(必守): 若此 tier 的 ≥3% 持倉全部回傳「只有 narrative,無量化數字」→ 整段輸出:
§9.5 訊號擷取:本期無可量化信號(只有 narrative news,無 SEC 8-K / 逐字稿量化句)
不輸出任何推測數字,不改寫 qualitative 為 quantitative。
mcp__fmp-mcp__getBiggestGainers + getBiggestLosersmcp__polymarket-mcp__search_markets 搜尋與持倉板塊相關事件目的: 從市場掃出至多 3 個適合短 DTE OTM Call 樂透的候選(per memory feedback:樂透用近期 OTM Call 不用 LEAPS,避免 vega 干擾凸性)。
篩選步驟(重用 Section 10 movers + active list 數據,不額外抓取):
getBiggestGainers + getMostActiveStocks輸出格式(限 1-3 筆,無符合則輸出「⏳ 本次無符合凸性條件的樂透機會」):
| Ticker | 題材 / Binary 催化 | 建議結構 | 預估成本 | 凸性備註 |
|---|
規則:
完整進度表:
| # | 計畫操作 | 狀態 | 觸發條件 | 當前數據 | 備註 |
|---|---|---|---|---|---|
| 1 | 加碼 NVDA | ⏳ 待觸發 | RSI<35 | RSI=42 | 接近 |
| 2 | DDOG BCS | ✅ 已完成 | — | — | 3/5 建倉 |
/briefing deep 時執行)同時派出 3 組 Agent 子代理(全部 subagent_type: "data-collector",自動使用 Haiku 4.5):
get_insider_transactions(90d)+ get_recent_filings(30d)get_stock_info + get_financial_statement — 基本面摘要getStockPeers(top 3)+ getBiggestGainers / getBiggestLosers若 Agent tool 不可用,依序呼叫亦可。
對 Key Alerts 中標記異常的股票(跌>5%、虧>15%),執行 stock-analysis 級別的分析:
目的: 顯示「公司目標/thesis 有無達成」,讓用戶一眼看出哪些論點正在驗證、哪些可能破裂,不 resolve(只讀取、對照、標狀態)。
資料來源:
thesis_ledger.py list --status pending(取得所有待驗收 thesis)Scorecard 邏輯(每筆 pending thesis 做一行):
對每筆 pending thesis,取其 trigger.metric 欄位(或從 thesis 命題推斷),與 fundamentals cache 的實際指標對照,判定當前狀態:
| 狀態 | 標記 | 條件 |
|---|---|---|
| 進行中 / 符合目標 | ✅ on-track | 核心指標與 thesis 方向一致(例:quarterly_revenue_growth_yoy > 0 且加速) |
| 待財報驗收 | ⏳ 待 event | trigger_type=event 且 trigger_date 尚未到(不能從 cache 判斷,等財報) |
| 有風險 / 指標轉弱 | ⚠️ at-risk | quarterly growth decel 連 2Q 或 guide 下修方向;技術面 death_cross |
| 已接近證偽條件 | 🔴 warning | falsification 條件中有 1+ 個已出現(精確比對 thesis 列的證偽點) |
| 無法判定 | ❓ unknown | cache 缺相關指標,無法自動比對 |
輸出格式:
### 14.5 📋 Thesis 目標達成度
| ticker | thesis slug | 核心命題(摘要)| 到期/觸發 | cache 指標現況 | 狀態 |
|--------|------------|----------------|---------|--------------|------|
| MU | memory-cycle-asm | DRAM ASP持續上漲 + 毛利>40% | 2026-06-15 財報 | revenue growth +21% YoY;PE 40.8 | ⏳ 待 event |
| NVDA | datacenter-demand | DC revenue連4Q加速 | 2026-05-28 財報 | revenue growth +78% YoY | ✅ on-track |
| CIEN | margin-recovery | 毛利率50%以上連2Q | 2026-06-10 財報 | beat 1/8(⚠️最弱)| 🔴 warning |
附加:thesis 到期日程(未來 30 天)
📅 近期 thesis 到期:
6/10 MU:memory-cycle(財報前) → 屆時需抓實際 ASP + 毛利率驗收
6/15 AVGO:ai-revenue-accl(財報後) → AI revenue YoY + guide 驗收
規則:
resolve 或 add,那是 Step 0.7 的工作)portfolio-review 式的計畫執行進度表:
/briefing telegram)目的: 每日盤中推送至 Telegram + Email 的精簡決策摘要。不跑 Phase 1-3 的完整分析,只抓推送所需的 7 個資料點,直接產出 emoji 純文字格式。
Sonnet 4.6(資料抓取為主,無深度合成需要)
同標準規範(0a-0e):讀 plan.md + feedback/*.md → get_account_position → journal 確認。
T1. Earnings Window(next 7 days)
改從 cache 讀: Step 0.6 已預載 briefing-out/cache/earnings-dates.json + earnings-history.json,直接 Read 兩份 JSON。
列出所有持倉 ticker 的:
next_date, timing)earnings-history.json)若 cache status ≠ "ok" → fallback mcp__fmp-mcp__getEarningsCalendar,並加註 ⚠️ earnings cache unavailable。
T2. Sentiment Pulse + Fundamentals Cache 預讀(平行 Agent) 派出 data-collector subagent,取所有持倉的 EODHD 7d sentiment_trend(格式:TICKER.US):
Agent(subagent_type="data-collector"):
呼叫 mcp__eodhd-mcp__get_sentiment_trend 對每個 ticker
回傳 dict: {ticker: {score: float, trend: str}}
分類:score 7日變動 > +0.1 → 改善;< -0.1 → 轉弱;急降(從 > +0.3 → < +0.1)→ ⚠️ 注意
同時讀取(不額外 MCP round-trip):
briefing-out/cache/fundamentals-snapshot.json(Step 0.65 已預載)→ 供下方 T2.5 💰 計算
T2.5 💰 估值 & Thesis Pulse(cache 算,signal-only)
資料:fundamentals-snapshot.json + Step 0.7 resolve 結果
計算邏輯(同 Section 8.5 三錨點精簡版):
現價/基準公允價 比值(基準公允 = median錨 × fwdEPS)省略整段的條件(全部滿足則 T8a/T8b 不輸出此段):
|現價/公允基 − 1| > 10%,AND→ signal-only:無訊號不推送(比照現有「無 alert 則略過整個 section」慣例)
T3. News & Catalysts(past 24h)
mcp__yfinance-advanced__get_yahoo_finance_news 取 top 5 持倉的新聞,各取 1-2 篇 24h 內最重要的。篩選標準:有具體事件(財報、合約、產品發布、監管)優先,無實質 catalyst 跳過。最多 3 條進入 Telegram 輸出。
T4. Sector Rotation
mcp__technical-mcp__get_sector_rotation() → 取全 sector ETF 相對 SPY 的 leading / improving / weakening / lagging 分類。只顯示各分類各 1-2 個代表 sector。
T5. Alerts(閾值觸發) 根據 T1 + T2 + Step 0b 持倉數據生成 alerts(無則跳過整個 section):
get_stock_info)→ 標記「逼近 52w 低」T6. 今日 / 明日待辦
從 plan.md 的策略佇列 + 觀察清單(⏳ 待評估)+ Step 0e 第一性分析,生成:
• {action}({trigger / catalyst})T7. Quick Take(第一性) 2 行以內,情緒/敘事走向。不講 RSI/MACD。句子格式:
T8a. 完整 Markdown → briefing-out/YYYY-MM-DD-full.md
使用 Write tool 寫入,格式:
# Briefing Telegram YYYY-MM-DD
## Earnings Window
...
## Sentiment Pulse
...
## News & Catalysts
...
## 💰 估值 & Thesis(signal-only,無訊號則省略整段)
### 估值偏離
- 最被低估:{ticker} 現價 $X vs 公允基準 $X(−X%,三錨點中位);A1 PE={X}/A2 PEG錨={X}/A3 PT錨={X}
- 最被高估:{ticker} 現價 $X vs 公允基準 $X(+X%)
(|偏離| < 10% 則省略該行)
### 今日 Thesis 驗收影響
- {ticker}:{slug} → {verdict} | 公允價 $FV_before → $FV_after(±X%) | 影響:{impact_decomp}
(無今日 resolve 則省略此小節)
## Sector Rotation
...
## Alerts
...
## 今日待辦
...
## 明日待辦
...
## Quick Take
...
T8b. Telegram 純文字 → briefing-out/YYYY-MM-DD-telegram.txt
使用 Write tool 寫入,格式嚴格遵守(純文字 + emoji,無 markdown,無表格,無 bold/italic/link):
📊 M/D HH:MM(發送時間,本地時區)
📰 News & Catalysts
• {ticker}: {一句話} ({source})
(無 catalyst 則略過整個 section)
📅 Earnings This Week
• {ticker} {M/D} {盤前/盤後} ({beat_count}/{total} beat, +{avg_surprise}%) — {focus 重點}
(Trailing beat rate 從 earnings-history.json 讀;cache 缺則省略括弧)
📊 Sentiment Pulse (EODHD 7d)
📈 改善: {ticker} +{delta}, {ticker} +{delta}
📉 轉弱: {ticker} -{delta}
⚠️ 注意: {ticker} {一句說明}
(無變化的 ticker 不列出)
💰 估值 & Thesis
📉 最低估: {ticker} vs 公允價 −X%(三錨點中位)
📈 最高估: {ticker} vs 公允價 +X%
📋 今日 thesis: {ticker} {verdict} 公允價 $FV_before→$FV_after(±X%)
(整段省略條件:無 >10% 偏離 且 今日無 thesis resolve)
🔄 Sector Rotation
💪 leading: {sector}, {sector}
📈 improving: {sector}
📉 weakening: {sector}
💀 lagging: {sector}
🚨 Alerts
• {alert}
(無 alert 則略過整個 section)
🎯 今日待辦
• {action}({trigger})
📋 明日待辦
• {action}({catalyst})
⚡ Quick Take
{第一行:今日情緒/敘事方向}
{第二行:本週核心注意事項}
格式規則:
**、_、[text](url) 等 markdown 語法briefing-out/ 目錄不存在時先用 Bash mkdir -p briefing-out 建立寫完 briefing-out/YYYY-MM-DD-full.md 後,先寫 tier 標記再生成 HTML:
# 1. 寫 tier 標記(讓 generate_html.py 知道這次是哪個 tier)
echo "<tier>" > briefing-out/YYYY-MM-DD-tier.txt
# <tier> 填入:quick | telegram | full | deep
# 2. 生成 HTML + push(tier gate 自動判斷:只有升級才推)
python3 tools/generate_html.py briefing YYYY-MM-DD --push
# 成功時印出網頁連結;若網站已有更高 tier 則跳過 push(本地 HTML 仍更新)
Tier 升級規則: quick(1) < telegram(2) < full(3) < deep(4)
寫完兩個檔案後,若 arguments 含 --send:
python3 tools/send_briefing.py YYYY-MM-DD
send_briefing.py 會自動:
tools/generate_html.py briefing YYYY-MM-DD --push(best-effort,失敗不擋發送)成功時輸出「✅ Telegram 已發送 / Email 已寄出」,失敗時輸出錯誤訊息(sender 自帶 retry + error notification)。
full 或 deep 層)僅當 arguments 含 --codex 或 --2nd 時執行。Quick 層完全跳過本 Phase。
三個子 block 依序執行(可並行派 Agent):
核心原則:Codex 不看 Claude 的 Phase 1–3 結論(不給 Quick Take / Key Alerts / 建議),只給 raw 持倉變動 + 市場數據,讓它獨立評估今日 priorities。Claude 與 Codex 兩個獨立輸出並排比較。
🔴 Prompt 中性化要求(詳見 feedback/codex-prompt-neutrality.md):
raw data 區只能放 fact 數值,不能放 derived label:
| ❌ 不能寫 | ✅ 改寫為 |
|---|---|
MU strong_uptrend / 49 / 量縮 | MU $635.80 (+10.30%) / RSI 81.7 / vol_ratio 0.49 / 6w range $XXX-$XXX |
PLTR weak_downtrend / momentum -24 | PLTR $138.30 (-5.29%) / RSI 46.2 / 6w range $122-$146 / Q1 earnings 5/4(昨日) |
BE 拋物線警示 | BE $291 (+0.9%) / RSI 77.6 / 5d 區間 $275-$303 |
禁止的 label: strong_uptrend / weak_downtrend / consolidation / overbought / oversold / 拋物線 / 打底 / 弱勢持續 / 強勢確認 / momentum_score(這已是 -100~+100 derived score,改寫成「X 個交易日累計漲跌 X%」)。
讓 Codex 自己跑 indicator interpretation,從 raw 數值推導結論。
呼叫 Codex(用 CLAUDE.md「Codex 呼叫方式」的 codex exec CLI;勿用 codex:codex-rescue subagent / /codex:rescue,會卡 superpowers preamble),prompt 首行加強制 no-tool 指令,模板:
我是一名美股投資人,使用 Level 2 options + Spread 的 margin 帳戶。
請對今日 briefing,**完全獨立**評估 — 不要看任何先前結論。
**Raw data(只給 fact 數值,無 derived label):**
帳戶:總值 $XXX / 現金 $XXX / 今日帳戶變動 +X.XX%
**今日 movers(價格 + % + 量能比 + 6 週區間):**
- [ticker] $XXX (+/-X.XX%) / RSI XX.X / vol_ratio X.XX / 6w range $XXX-$XXX
- ...
**Earnings Window 標記(過去/未來 48h 有財報的 ticker):**
- [ticker] — 財報日 X/X([已過 X 天 / 還剩 X 天])
**主要持倉技術面(fact only):**
- [ticker]:價 $XXX / RSI XX / MACD line/signal/histogram / vs SMA20 X% / vs SMA50 X%
- ...
**板塊輪動(vs SPY 3mo,純數值):**
- SMH +X.XX% / 1w +X.XX% / RSI XX.X
- ...
**待執行/觀察的計畫項目**(從 plan.md 摘出 ⏳,不寫評語):
- ...
**近期重大事件(fact):** 財報日列表、FOMC、產業催化
**投資風格:** AI/半導體主軸、汰弱留強、信念持倉 [TSLA/MU/AVGO]
**請輸出(獨立判斷):**
1. **今日組合 thesis**(1 句:今日是「進攻」「防守」「觀望」?理由?)
2. **3 個今日最重要的訊號**(具體 — 自己解讀 raw data,不依賴 Claude 標籤)
3. **未來 5 個交易日機率分布(組合表現):**
| 情境 | 機率 | 條件 | 預期 % |
|------|------|------|--------|
| 樂觀 | XX% | [...] | +X% |
| 基準 | XX% | [...] | ±X% |
| 悲觀 | XX% | [...] | -X% |
4. **3 個 actionable 建議**(含口數 / 觸發條件)— 對 earnings window 內的 ticker 預設「等 settle」
5. **Verdict**(1 句):今日整體該做什麼?
**規則:**
- 機率分布必須 sum 到 100%
- 不假設 Claude 已說過什麼
- 保持獨立判斷
- earnings window 內的 ticker 不直接套「汰弱留強」
請以繁體中文回覆,控制在 700 字內。
--effort high --fresh
呼叫 Codex(用 CLAUDE.md「Codex 呼叫方式」的 codex exec CLI):
我目前的美股持倉(含市值占比):
[插入 Step 0b get_account_position 取得的持倉表]
我的投資風格:
- 主軸:AI/半導體、高成長科技;汰弱留強,集中持倉
- 信念持倉(不換):TSLA, MU, AVGO 多年期 thesis
- 板塊偏好:[從 plan.md 摘出 3-5 行板塊目標]
請以獨立分析師視角:
1. 掃描今日市場有哪些當紅題材/個股,是我目前持倉沒覆蓋到的
2. 對每個候選列出:題材、代表 ticker、為何此刻有機會、建議切入方式(現股/Spread/LEAPS)
3. 要追這些新機會,最該砍掉哪一檔現有持倉?為什麼?
4. 提供 2-3 個具體 actionable 建議(含目標 entry zone)
請以繁體中文回覆。輸出限 600 字。
Step 1 — Claude 預先收集數據:
mcp__technical-mcp__get_sector_rotation() → 全板塊 ETF 相對強度 vs SPY(leading / improving / weakening / lagging)mcp__technical-mcp__get_batch_indicators(tickers=[所有持倉]) → 個股動能分數 + 趨勢Step 2 — 呼叫 Codex(用 CLAUDE.md「Codex 呼叫方式」的 codex exec CLI):
我的美股持倉(含市值占比 + 板塊歸屬):
[持倉表]
當前板塊輪動數據(vs SPY):
[get_sector_rotation 完整輸出]
當前個股動能:
[get_batch_indicators 摘要]
請以輪動專家視角:
1. 板塊輪動:哪些板塊 leading,哪些 weakening?我的持倉是否站在 leading 板塊?
2. 個股輪動:在我已持有的板塊內,有更強的 leader 我沒拿到?有持倉已被同板塊其他名字超越?
3. 資金流向:從 weakening 輪到 leading 的訊號是否明確?建議調倉路徑
4. 具體建議:3 條 actionable 輪動操作(從哪檔減 → 加到哪檔,附理由)
請以繁體中文回覆。輸出限 700 字。
## 🤖 Codex 第二意見
### B1. 獨立第一性分析(Codex 獨立輸出)
**Codex 今日 thesis:** [...]
**Codex 列的 3 個重要訊號:** [...]
**Codex 機率分布:**
| 情境 | 機率 | 條件 | 預期 % |
|------|------|------|--------|
| ... |
**Codex 3 個建議:** [...]
**Codex Verdict:** [...]
#### 並排比較:Claude vs Codex(獨立輸出)
| 維度 | Claude | Codex | 一致性 |
|------|--------|-------|--------|
| 今日 thesis | [Claude] | [Codex] | 同 / 異 |
| 機率分布偏向 | 偏多 / 中性 / 偏空 | 偏多 / 中性 / 偏空 | — |
| 主要建議 | [Claude] | [Codex] | 同 / 異 |
| Verdict | [Claude] | [Codex] | 同 / 異 |
**真實共識:** [1-2 條]
**真實分歧:** [1-3 條]
### 機會掃描(vs 現有持倉)
[B2 Codex 完整回覆]
### 輪動分析(板塊 + 個股)
[B3 Codex 完整回覆]
---
**值得追蹤的新機會:** [從 B2 挑 1-2 個 Claude 也認同的]
**輪動 actionable:** [從 B3 挑 1-2 條 Claude 也認同的調倉操作]
--codex-adversarial(opt-in 壓力測試)僅當 arguments 含 --codex-adversarial 時,追加對立面審查段落(攻擊 Claude 結論、找 bug)。預設 --codex 不執行。
若 Codex 失敗 → 輸出
⚠️ Codex 不可用:[error],跳過第二意見,繼續正常輸出。
briefing-out/ 的兩個檔案briefing-out/ 已加入 .gitignore(個人化數據,不 commit)python3 tools/send_briefing.py YYYY-MM-DD 或 python3 tools/send_briefing.py latest