Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add fatfingererr/macro-skills --skill forecast-sector-relative-return-from-yield-spreadgit clone --depth 1 https://github.com/fatfingererr/macro-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/fatfingererr/macro-skills/forecast-sector-relative-return-from-yield-spread)<a href="https://agentmods.dev/skills/fatfingererr/macro-skills/forecast-sector-relative-return-from-yield-spread"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/forecast-sector-relative-return-from-yield-spread/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/fatfingererr/macro-skills/forecast-sector-relative-return-from-yield-spread"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/forecast-sector-relative-return-from-yield-spread.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00075 | $0.04057 |
| Opus 5 | $0.00037 | $0.02028 |
| Sonnet 5 | $0.00015 | $0.00811 |
| Haiku 4.5 | $0.00007 | $0.00406 |
Grade A, and why
forecast-sector-relative-return-from-yield-spread scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 368 lines — stays where its author put it; the contents beside it link to each section on GitHub.
<essential_principles>
美國公債利差(Yield Spread)作為領先指標:
spread_t = short_yield_t - long_yield_t
= US02Y_t - US10Y_t
spread 越高:短端相對更高(曲線更倒掛/更緊) spread 越低(或從負回到 0、轉正):曲線「回正/變陡」
此 spread 被認為領先反映:
- 經濟週期預期(倒掛 → 衰退預期)
- 風險偏好轉換(曲線變陡 → 風險偏好回升)
相對強弱比率(Ratio):
ratio_t = risk_asset_t / defensive_asset_t
= QQQ_t / XLV_t
ratio 上升:成長股(Nasdaq)相對更強 ratio 下降:防禦股(Healthcare)相對更強(XLV 跑贏)
預測目標為「未來 H 個月的對數相對報酬」:
future_rel_return = log(ratio(t+H) / ratio(t))
正值 → Nasdaq 跑贏,負值 → XLV 跑贏
圖表的時間對齊邏輯:
- 把 spread 往前平移 lead_months 個月
- 目標是檢查:spread(t) 是否能解釋 ratio(t + H)
工程化寫法:
X = spread(t)
Y = future_rel_return(t, H) = log(ratio(t+H) / ratio(t))
然後做相關性/迴歸/交叉相關掃描來找「最佳領先期」。
避免直接用 ratio 水平做迴歸(有趨勢/非平穩問題),改用對數報酬。
需回答三件事:
-
是否真的存在穩定領先關係?
- 掃描多個 lead(6, 12, 18, 24, 30 個月)
- 看哪個 lead 下 corr(spread, future_rel_return) 最穩、顯著
- 跨子樣本驗證(前半段 vs 後半段)
-
目前情境對應的預測方向
- 最近 spread 水準、變化率
- 模型預測 E[future_rel_return]
- 分位數區間(如 80% 信心區間)
-
把預測翻譯成直覺語句
- 由 future_rel_return 轉回百分比:
exp(future_rel_return) - 1 - 「未來 24 個月 XLV 相對 QQQ 勝率 X%、中位數報酬 Y%」
- 由 future_rel_return 轉回百分比:
- 頻率選擇:週頻(weekly)降低雜訊,建議 1wk
- 平滑視窗:可選 13 週或 26 週移動平均
- 回測長度:至少涵蓋 1-2 次完整景氣循環(如 2007-present)
殖利率來源:FRED(DGS2, DGS10) 資產價格來源:Yahoo Finance(QQQ, XLV)
</essential_principles>
- 數據整合:取得殖利率(FRED)與資產價格(yfinance)
- 利差計算:計算 spread = short_yield - long_yield
- 相對報酬計算:計算 future_rel_return = log(ratio(t+H) / ratio(t))
- 領先關係驗證:掃描多個 lead 找最佳相關性與穩定性
- 情境預測:基於當前 spread 產出未來相對報酬預測區間
- 輸出報告:驗證結論、預測方向、風險提示
輸出:領先關係驗證、當前預測、區間估計、歷史類比、風險提示。
<quick_start>
最快的方式:執行預設情境分析
cd skills/forecast-sector-relative-return-from-yield-spread
pip install pandas numpy yfinance matplotlib statsmodels requests # 首次使用
python scripts/spread_forecaster.py --quick
完整分析(含領先掃描與穩定性驗證)
python scripts/spread_forecaster.py \
--risk-ticker QQQ \
--defensive-ticker XLV \
--lead-months 24 \
--lookback-years 12 \
--output result.json
生成 Bloomberg 風格視覺化圖表
python scripts/plot_bloomberg_style.py --quick --output output/yield_spread_forecast_$(date +%Y-%m-%d).png
完整版圖表(自訂參數)
python scripts/plot_bloomberg_style.py \
--lookback-years 18 \
--lead-months 24 \
--risk-ticker QQQ \
--defensive-ticker XLV \
--output output/yield_spread_analysis.png
輸出範例:
{
"skill": "forecast_sector_relative_return_from_yield_spread",
"signal_name": "US02Y_minus_US10Y_leads_QQQ_over_XLV",
"lead_months": 24,
"current_spread": -0.35,
"model": {
"type": "lagged_regression",
"alpha": 0.02,
"beta": -0.45,
"corr_x_y": -0.32
},
"forecast": {
"future_24m_relative_return_pct": -0.077,
"interval_pct_80": [-0.22, 0.04],
"interpretation": "若此關係維持,未來24個月QQQ相對XLV期望報酬為-7.7%,XLV較可能跑贏。"
}
}
</quick_start>
- 快速分析 - 使用預設參數(QQQ/XLV, 24 個月領先)計算當前預測
- 完整分析 - 自訂參數進行領先關係驗證與情境預測
- 領先掃描 - 掃描多個領先期(6-30 個月)找最佳相關性
- 視覺化圖表 - 生成利差與相對報酬對齊圖
- 穩定性驗證 - 檢查領先關係在不同子樣本的一致性
- 方法論學習 - 了解領先關係邏輯與計算方式
請選擇或直接提供分析參數。
What ships with it
14 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- examples/sample-output.json 3.3 KB
- manifest.json 2.7 KB
- methodology.md 3.0 KB
- references/data-sources.md 9.9 KB
- references/input-schema.md 5.5 KB
- references/method.md 6.8 KB
- scripts/plot_bloomberg_style.py 24 KB runs code
- scripts/spread_forecaster.py 23 KB runs code
- scripts/spread_plotter.py 12 KB runs code
- skill.yaml 23 KB
- templates/output-json.md 6.0 KB
- templates/output-markdown.md 6.7 KB
- workflows/analyze.md 6.4 KB
- workflows/data-research.md 6.3 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 368 lines · 75 tokens per session scan A 097dd0591a1a
forecast-sector-relative-return-from-yield-spread is a skill published in the GitHub repository fatfingererr/macro-skills (3 stars, last pushed 7mo ago), licensed MIT. It adds 75 tokens to every session and 4,057 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
sector-rotation
An analysis framework for comparing industries in the Chinese A-share stock market, using business conditions, price momentum, valuation, and money flows. It produces rankings and higher- or lower-allocation suggestions.
strategy-pivot-designer
Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.
twitter-reader
Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…
chenhao-limit-up
A framework for judging Chinese A-share stocks that have reached the daily price-rise limit, using market mood, sector leadership, and trading momentum.
furusato
A Japanese hometown-tax donation manager for furusato nozei, a system where donations to municipalities can qualify for an income-tax or local-tax deduction. It reads donation receipts, stores donation records, and calculates deduction limits.
reading-receipt
An image-reading workflow for extracting structured information from receipts, invoices, and hometown-tax donation certificates. It can first extract text from PDFs and otherwise read their images.