detect-fed-unamortized-discount-pattern

detect-fed-unamortized-discount-pattern is a skill for Claude Code, Codex from fatfingererr/macro-skills. It costs 86 tokens per session (3,946 once invoked), scanned A, original, MIT.

A financial-data analysis tool that compares the shape of the Federal Reserve’s unamortized bond discounts with patterns from past crises. It checks other indicators, such as credit spreads and volatility, to see whether the similarity may reflect financial stress or only interest-rate and accounting effects.

In plain words
What is it for?
Comparing current FRED weekly data with historical crisis periods, scoring pattern similarity, checking supporting and opposing indicators, and documenting alternative explanations.
Why use it?
A chart can look like a past crisis without signaling that the same event will happen again. This separates visual similarity from evidence that market stress is actually increasing.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Comparing current FRED weekly data with historical crisis periods, scoring pattern similarity, checking supporting and opposing indicators, and documenting alternative explanations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fatfingererr/macro-skills/detect-fed-unamortized-discount-pattern
Install

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.

Any agent
npx skills add fatfingererr/macro-skills --skill detect-fed-unamortized-discount-pattern
Clone the repo
git clone --depth 1 https://github.com/fatfingererr/macro-skills

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin detect-fed-unamortized-discount-pattern/plugin install detect-fed-unamortized-discount-pattern after adding the marketplace above.

Wrote 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.

agentmods badge for detect-fed-unamortized-discount-pattern

README.md
[![agentmods](https://agentmods.dev/badge/skills/fatfingererr/macro-skills/detect-fed-unamortized-discount-pattern/github.svg)](https://agentmods.dev/skills/fatfingererr/macro-skills/detect-fed-unamortized-discount-pattern)
Your own site
<a href="https://agentmods.dev/skills/fatfingererr/macro-skills/detect-fed-unamortized-discount-pattern"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/detect-fed-unamortized-discount-pattern/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.

agentmods 80×15 button for detect-fed-unamortized-discount-pattern

Your own site · 80×15
<a href="https://agentmods.dev/skills/fatfingererr/macro-skills/detect-fed-unamortized-discount-pattern"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/detect-fed-unamortized-discount-pattern.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,946 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00086 $0.03946
Opus 5 $0.00043 $0.01973
Sonnet 5 $0.00017 $0.00789
Haiku 4.5 $0.00009 $0.00395

Measured 11d ago against content hash 428e7a91186a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

detect-fed-unamortized-discount-pattern 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 11d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/fetch_data.py, scripts/pattern_detector.py, scripts/visualize_pattern.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/detect-fed-unamortized-discount-pattern/SKILL.md · 322 lines

How it starts

The opening of the file, as written. The whole thing — 322 lines — stays where its author put it; the contents beside it link to each section on GitHub.

<essential_principles>

核心認知:把「肉眼類比」轉成可量化的「形狀比對」,但「像」不等於「會發生」:

  • 相關係數 (corr):近期窗口 vs. 基準窗口的線性形狀相似
  • 動態時間校正 (DTW):允許「快一點/慢一點」但形狀相似
  • 形狀特徵 (shape_features):趨勢斜率、拐點結構、波動擴張

輸出「pattern_similarity_score」只回答「像不像」,不回答「會不會發生」。

把「形狀相似」與「壓力驗證」拆開:

  1. pattern_similarity_score:只測量形狀相似度
  2. stress_confirmation_score:測量交叉驗證指標是否同步惡化
  3. composite_risk_score:加權合成,但必須附上「哪些指標支持/反對」

反直覺檢查

  • 若相似度很高,但交叉驗證指標沒有壓力訊號 → 可能只是利率/持有結構/會計攤銷造成的圖形相似
  • 若相似度中等,但多數壓力指標同步惡化 → 反而要提高警覺

WUDSHO(Unamortized Discounts)成因

  • 聯準會購買債券時,若買入價低於面值,差額計為「未攤銷折價」
  • 利率上升期:市價下跌 → 購入債券折價增加 → WUDSHO 上升
  • 利率下降期:市價上升 → 購入債券溢價增加 → WUDSHO 下降

重要:WUDSHO 變動可能反映:

  1. 利率環境變化(最常見)
  2. 持有債券久期結構
  3. 會計攤銷時程
  4. 真正的金融壓力(需交叉驗證才能確認)

社群常見的「圖形類比敘事」往往缺乏反證:

  • ❌「這條線複製 COVID,60 天內黑天鵝」→ 只有類比,沒有驗證
  • ✅ 本技能輸出:「形狀相似度 0.88,但信用利差中性、股市波動偏低 → 不支持系統性壓力假說」

必須輸出的反證項目:

  1. 「形狀相似」的替代解釋(利率效果、會計效果)
  2. 「壓力指標」的現況(支持/反對風險假說)
  3. 「歷史後續」的條件分布(不是預測)

本技能使用 FRED 公開週資料:

  • WUDSHO: Fed 持有證券的未攤銷折價
  • 交叉驗證指標:信用利差、波動率、短端利差等

必須揭露

  • FRED 週資料可能有 T+1 ~ T+3 延遲
  • 部分指標(如窗口工具用量)需要替代代理
  • 形狀比對結果受 resample 頻率影響

</essential_principles>

  1. 取得目標序列:從 FRED 取得 WUDSHO(或指定序列)的週資料
  2. 窗口比對:將近期窗口與歷史基準窗口(如 COVID 2020)做形狀比對
  3. 相似度計算:使用相關係數、DTW、形狀特徵等多種方法
  4. 交叉驗證:檢查信用利差、波動率、流動性指標是否同步惡化
  5. 風險分數合成:輸出可量化的風險分數與反證分析
  6. 情境敘事:描述歷史類比後續發展(非預測)

輸出:形狀相似度、壓力驗證分數、合成風險分數、反證分析、情境推演。

<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>

  1. 快速檢查(推薦) - 查看目前的形狀相似度與壓力分數
  2. 完整分析 - 執行完整的形狀比對與交叉驗證
  3. 視覺化分析 - 生成形狀比對圖表
  4. 歷史事件對照 - 深入了解歷史基準窗口的後續發展
  5. 方法論學習 - 了解形狀比對與交叉驗證的邏輯
  6. 自訂參數 - 指定序列、窗口、門檻等參數

請選擇或直接提供分析參數。

路由後,閱讀對應文件並執行。

<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>

Read the full file on GitHub · 322 lines

Changes

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.

  1. 11d ago First seen · 322 lines · 86 tokens per session scan A 428e7a91186a

Subscribe to this mod's changes

detect-fed-unamortized-discount-pattern is a skill published in the GitHub repository fatfingererr/macro-skills (3 stars, last pushed 7mo ago), licensed MIT. It adds 86 tokens to every session and 3,946 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.

Related

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.

HKUDS/Vibe-Trading · 39 tokens

strategy-pivot-designer

Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.

tradermonty/claude-trading-skills · 28 tokens

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…

himself65/finance-skills · 161 tokens

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.

questflowai/investorskills · 44 tokens

trading-risk-gate

Unified pre-trade safety gate: Ruin check (Law #1), ergodicity audit, and win-rate dominance validation. Absorbs: ergodicity-check, law-of-ruin, win-rate-dominance.

winstonkoh87/Athena-Public · 53 tokens

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.

kazukinagata/shinkoku · 102 tokens