From fatfingererr-macro-skills
檢查聯準會持有證券的未攤銷折價(Unamortized Discounts)是否出現與特定歷史危機期間相似的走勢模板,並用多指標交叉驗證是否真的屬於「金融壓力升高」而非單純會計/利率效果。
npx claudepluginhub joshuarweaver/cascade-code-general-misc-1 --plugin fatfingererr-macro-skillsThis skill uses the workspace's default tool permissions.
<essential_principles>
examples/sample_output.jsonmanifest.jsonreferences/data-sources.mdreferences/input-schema.mdreferences/methodology.mdreferences/wudsho-mechanism.mdscripts/fetch_data.pyscripts/pattern_detector.pyscripts/visualize_pattern.pyscripts/visualize_pre_covid.pyskill.yamltemplates/output-json.mdtemplates/output-markdown.mdworkflows/execute-analysis.mdworkflows/historical-episodes.mdworkflows/visualize-analysis.mdCreates new Angular apps using Angular CLI with flags for routing, SSR, SCSS, prefixes, and AI config. Follows best practices for modern TypeScript/Angular development. Use when starting Angular projects.
Generates Angular code and provides architectural guidance for projects, components, services, reactivity with signals, forms, dependency injection, routing, SSR, ARIA accessibility, animations, Tailwind styling, testing, and CLI tooling.
Executes ctx7 CLI to fetch up-to-date library documentation, manage AI coding skills (install/search/generate/remove/suggest), and configure Context7 MCP. Useful for current API refs, skill handling, or agent setup.
<essential_principles>
**形狀比對 ≠ 事件預測**核心認知:把「肉眼類比」轉成可量化的「形狀比對」,但「像」不等於「會發生」:
輸出「pattern_similarity_score」只回答「像不像」,不回答「會不會發生」。
**壓力驗證才能升級風險判斷**把「形狀相似」與「壓力驗證」拆開:
反直覺檢查:
WUDSHO(Unamortized Discounts)成因:
重要:WUDSHO 變動可能反映:
社群常見的「圖形類比敘事」往往缺乏反證:
必須輸出的反證項目:
本技能使用 FRED 公開週資料:
必須揭露:
</essential_principles>
偵測聯準會未攤銷折價走勢是否與歷史危機期間相似:輸出:形狀相似度、壓力驗證分數、合成風險分數、反證分析、情境推演。
<quick_start>
最快的方式:執行完整分析
cd skills/detect-fed-unamortized-discount-pattern
pip install pandas numpy requests scipy matplotlib # 首次使用
python scripts/pattern_detector.py --quick
輸出:
output/pattern_analysis_YYYY-MM-DD.json - JSON 結果完整分析(指定參數):
python scripts/pattern_detector.py \
--target_series WUDSHO \
--baseline_windows "COVID_2020:2020-01-01:2020-06-30" \
--recent_window_days 120 \
--output result.json
Bloomberg 風格視覺化(輸出至專案根目錄 output/):
python scripts/visualize_pattern.py
使用現有分析結果生成圖表:
python scripts/visualize_pattern.py --json output/pattern_analysis_YYYY-MM-DD.json
輸出圖表:
output/fed_unamortized_discount_pattern_YYYY-MM-DD.png - 形狀比對與壓力儀表板output/fed_unamortized_discount_history_YYYY-MM-DD.png - 歷史走勢總覽</quick_start>
需要進行什麼操作?請選擇或直接提供分析參數。
| Response | Action | |-------------------------------|------------------------------------------------------| | 1, "快速", "quick", "check" | 執行 `python scripts/pattern_detector.py --quick` | | 2, "完整", "full", "analysis" | 閱讀 `workflows/execute-analysis.md` 並執行 | | 3, "視覺化", "chart", "圖表" | 執行 `python scripts/visualize_pattern.py -o output` | | 4, "歷史", "事件", "episodes" | 閱讀 `workflows/historical-episodes.md` 並執行 | | 5, "學習", "方法論", "why" | 閱讀 `references/methodology.md` | | 6, "自訂", "custom", 提供參數 | 閱讀 `workflows/execute-analysis.md` 並使用參數執行 |路由後,閱讀對應文件並執行。
<directory_structure>
detect-fed-unamortized-discount-pattern/
├── SKILL.md # 本文件(路由器)
├── skill.yaml # 前端展示元數據
├── manifest.json # 技能元數據
├── workflows/
│ ├── execute-analysis.md # 完整分析工作流
│ ├── visualize-analysis.md # 視覺化分析工作流
│ └── historical-episodes.md # 歷史事件對照工作流
├── references/
│ ├── methodology.md # 形狀比對與交叉驗證方法論
│ ├── data-sources.md # 資料來源與 FRED 系列代碼
│ ├── wudsho-mechanism.md # WUDSHO 指標機制說明
│ └── input-schema.md # 完整輸入參數定義
├── templates/
│ ├── output-json.md # JSON 輸出模板
│ └── output-markdown.md # Markdown 報告模板
├── scripts/
│ ├── pattern_detector.py # 主分析腳本
│ ├── visualize_pattern.py # 視覺化腳本
│ └── fetch_data.py # 資料抓取工具
└── examples/
└── sample_output.json # 範例輸出
</directory_structure>
<reference_index>
方法論: references/methodology.md
資料來源: references/data-sources.md
指標機制: references/wudsho-mechanism.md
輸入參數: references/input-schema.md
</reference_index>
<workflows_index>
| Workflow | Purpose | 使用時機 |
|---|---|---|
| execute-analysis.md | 完整形狀比對分析 | 需要完整報告時 |
| visualize-analysis.md | 視覺化分析 | 需要圖表時 |
| historical-episodes.md | 歷史事件深度分析 | 理解歷史類比與後續發展 |
| </workflows_index> |
<templates_index>
| Template | Purpose |
|---|---|
| output-json.md | JSON 輸出結構定義 |
| output-markdown.md | Markdown 報告模板 |
| </templates_index> |
<scripts_index>
| Script | Command | Purpose |
|---|---|---|
| pattern_detector.py | --quick | 快速檢查當前狀態 |
| pattern_detector.py | --output FILE | 完整分析 |
| visualize_pattern.py | (無參數) | Bloomberg 風格視覺化(輸出至專案根目錄 output/) |
| visualize_pattern.py | --json FILE | 使用現有 JSON 結果生成圖表 |
| fetch_data.py | --series WUDSHO | 抓取 FRED 資料 |
| </scripts_index> |
<input_schema_summary>
核心參數
| 參數 | 類型 | 預設值 | 說明 |
|---|---|---|---|
| target_series | string | WUDSHO | 目標 FRED 系列代碼 |
| baseline_windows | array[object] | [COVID] | 歷史參考事件窗口 |
| recent_window_days | int | 120 | 近期比對窗口長度 |
| resample_freq | string | W | 資料頻率 |
| normalize_method | string | zscore | 正規化方法 |
相似度參數
| 參數 | 類型 | 預設值 | 說明 |
|---|---|---|---|
| similarity_metrics | array[string] | [corr, dtw, shape_features] | 相似度指標 |
| alert_thresholds | object | {corr_min: 0.7, ...} | 觸發警報門檻 |
交叉驗證參數
| 參數 | 類型 | 預設值 | 說明 |
|---|---|---|---|
| confirmatory_indicators | array[object] | [信用利差...] | 交叉驗證指標清單 |
| lookahead_days | int | 60 | 前瞻期(情境敘事) |
完整參數定義見 references/input-schema.md。
</input_schema_summary>
<output_schema_summary>
{
"skill": "detect-fed-unamortized-discount-pattern",
"as_of_date": "2026-01-26",
"target_series": "WUDSHO",
"best_match": {
"baseline": "COVID_2020",
"segment_start": "2020-01-08",
"segment_end": "2020-06-17",
"corr": 0.91,
"dtw": 0.38,
"feature_sim": 0.82,
"pattern_similarity_score": 0.88
},
"stress_confirmation": {
"score": 0.22,
"details": [
{"name": "credit_spread", "signal": "neutral", "z": 0.4},
{"name": "equity_vol", "signal": "mild_risk_on", "z": -0.2},
{"name": "funding_stress_proxy", "signal": "neutral", "z": 0.1}
]
},
"composite_risk_score": 0.49,
"interpretation": {
"summary": "走勢形狀與 COVID 早期片段相似度高,但壓力驗證指標偏中性...",
"what_to_watch_next_60d": ["..."],
"rebuttal_to_claim": ["..."]
},
"caveats": [
"形狀相似不代表因果相同;該序列可能強烈受利率、持有期限結構與會計攤銷影響。",
"若缺乏壓力指標同步惡化,不應把圖形類比直接升級成『黑天鵝預言』。"
]
}
完整輸出結構見 templates/output-json.md。
</output_schema_summary>
<success_criteria> 執行成功時應產出:
視覺化輸出(使用 visualize_pattern.py,Bloomberg 風格):
fed_unamortized_discount_pattern_YYYY-MM-DD.png)
fed_unamortized_discount_history_YYYY-MM-DD.png)