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 detect-us-equity-valuation-percentile-extremegit 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/detect-us-equity-valuation-percentile-extreme)<a href="https://agentmods.dev/skills/fatfingererr/macro-skills/detect-us-equity-valuation-percentile-extreme"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/detect-us-equity-valuation-percentile-extreme/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/detect-us-equity-valuation-percentile-extreme"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/detect-us-equity-valuation-percentile-extreme.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.00084 | $0.03492 |
| Opus 5 | $0.00042 | $0.01746 |
| Sonnet 5 | $0.00017 | $0.00698 |
| Haiku 4.5 | $0.00008 | $0.00349 |
Grade A, and why
detect-us-equity-valuation-percentile-extreme 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 — 305 lines — stays where its author put it; the contents beside it link to each section on GitHub.
<essential_principles>
將不同單位的估值指標(PE、PB、CAPE 等)統一成「0-100 的歷史分位數」:
- 分位數 = 100 × (歷史中 ≤ 當前值的樣本數 / 總樣本數)
- 例:CAPE 位於歷史第 98 分位 → 過去 130 年只有 2% 的時間比現在更貴
- 統一單位後,可跨指標合成「綜合估值分位數」
合成公式:composite_percentile = 加權平均(各指標分位數)
支援三種合成方式:
| 方式 | 公式 | 適用場景 |
|---|---|---|
| mean | 算術平均 | 各指標同等重要 |
| median | 中位數 | 抵抗單一指標異常拉升 |
| trimmed_mean | 去極端平均 | 穩健估計 |
重要:各指標可能有不同歷史長度,預設使用「各自歷史」計算分位數再合成。
if composite_percentile >= extreme_threshold (預設 95):
→ 判定「歷史極端高估」
→ 觸發風險解讀流程
歷史類比事件識別:
- 找出合成分位數超過門檻的峰值
- 用
episode_min_gap_days去重(預設 10 年內只保留最高點) - 輸出:1929、1965、1999、2021、當前...
「估值極端高」≠「明天崩盤」,但歷史特徵是:
- 風險分布不對稱:下跌尾巴變厚
- 未來中期報酬壓縮:估值均值回歸壓低長期報酬上限
- 波動先升後跌:事件後 6-12 月波動率通常上升
輸出事後統計:
- 未來 180/365/1095 天報酬分布
- 最大回撤中位數與尾部風險
- 波動率變化機率
本 skill 使用公開替代資料,非彭博原始數據:
- Shiller CAPE: Robert Shiller 公開資料集(可回溯至 1871 年)
- 市值/GDP: FRED 公開數據(可回溯至 1950 年代)
- PE/PB/PS: 公開金融資料(歷史較短,約 30-50 年)
必須揭露:
- 各指標可得期間不同
- 合成分位數為「近似重建」,非精確複製
</essential_principles>
- 收集估值指標:從公開數據源取得 PE、CAPE、PB、PS、市值/GDP 等
- 計算分位數:將各指標轉換為歷史分位數(0-100)
- 合成總分:加權平均(或中位數)得到綜合估值分位數
- 判定極端:若總分 ≥ 門檻(預設 95),觸發極端高估警報
- 歷史類比:找出歷史上的類似事件(1929、1965、1999 等)
- 事後統計:計算這些事件後的報酬、回撤、波動變化
輸出:當前狀態、各指標分位數、歷史類比事件、風險解讀。
<quick_start>
最快的方式:執行視覺化分析
cd skills/detect-us-equity-valuation-percentile-extreme
pip install pandas numpy yfinance requests matplotlib openpyxl xlrd # 首次使用
python scripts/visualize_valuation.py -o output
輸出:
output/us_valuation_percentile_YYYY-MM-DD.png- 歷史走勢圖(類似 @ekwufinance 風格)output/us_valuation_breakdown_YYYY-MM-DD.png- 各指標分位數分解圖output/us_valuation_analysis_YYYY-MM-DD.json- JSON 結果
圖表特色:
- 多指標合成分位數的歷史走勢(非單一時間點)
- 歷史峰值標記:1929、1965、1999、2021
- S&P 500 指數疊加(對數刻度)
- 當前「新高」標註
快速檢查(純 JSON):
python scripts/valuation_percentile.py --quick
完整分析:
python scripts/valuation_percentile.py \
--as_of_date 2026-01-21 \
--universe "^GSPC" \
--metrics "cape,mktcap_to_gdp,trailing_pe,pb" \
--output result.json
</quick_start>
- 視覺化分析(推薦) - 生成歷史走勢圖表,標記歷史峰值
- 快速檢查 - 查看目前的估值分位數與極端狀態
- 完整分析 - 執行完整的歷史分位數分析與風險解讀
- 歷史類比 - 深入分析歷史極端高估事件與事後表現
- 方法論學習 - 了解估值分位數模型的邏輯
- 自訂參數 - 指定估值指標、門檻、合成方式等
請選擇或直接提供分析參數。
路由後,閱讀對應文件並執行。
<directory_structure>
detect-us-equity-valuation-percentile-extreme/
├── SKILL.md # 本文件(路由器)
├── skill.yaml # 前端展示元數據
├── manifest.json # 技能元數據
├── workflows/
│ ├── execute-analysis.md # 完整分析工作流
│ ├── visualize-analysis.md # 視覺化分析工作流
│ └── historical-episodes.md # 歷史類比分析工作流
├── references/
│ ├── methodology.md # 估值分位數方法論
│ ├── data-sources.md # 資料來源與代碼
│ ├── valuation-metrics.md # 估值指標定義
│ └── input-schema.md # 完整輸入參數定義
├── templates/
│ ├── output-json.md # JSON 輸出模板
│ └── output-markdown.md # Markdown 報告模板
├── scripts/
│ ├── valuation_percentile.py # 主分析腳本
│ ├── visualize_valuation.py # 視覺化腳本(歷史走勢圖)
│ └── fetch_valuation_data.py # 資料抓取工具
└── examples/
└── sample_output.json # 範例輸出
</directory_structure>
What ships with it
15 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.6 KB
- manifest.json 4.9 KB
- references/data-sources.md 7.7 KB
- references/input-schema.md 6.5 KB
- references/methodology.md 8.3 KB
- references/valuation-metrics.md 6.7 KB
- scripts/fetch_valuation_data.py 11 KB runs code
- scripts/valuation_percentile.py 22 KB runs code
- scripts/visualize_valuation.py 25 KB runs code
- skill.yaml 13 KB
- templates/output-json.md 7.0 KB
- templates/output-markdown.md 7.1 KB
- workflows/execute-analysis.md 4.3 KB
- workflows/historical-episodes.md 6.4 KB
- workflows/visualize-analysis.md 2.8 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 · 305 lines · 84 tokens per session scan A 229a982bcab8
detect-us-equity-valuation-percentile-extreme is a skill published in the GitHub repository fatfingererr/macro-skills (3 stars, last pushed 7mo ago), licensed MIT. It adds 84 tokens to every session and 3,492 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.