$npx -y skills add kansoku-trade/kansoku --skill fredUS/global macro time series from St. Louis Fed FRED — CPI, GDP, Fed funds, yields, M2, DXY, etc.
| 1 | # fred |
| 2 | |
| 3 | > Response language: match user input (zh-CN / zh-TW / en). |
| 4 | |
| 5 | ## When to use |
| 6 | |
| 7 | Trigger phrases: |
| 8 | |
| 9 | - CPI / core CPI / PCE / PPI / inflation / 通胀 / 核心通胀 |
| 10 | - GDP / 国内生产总值 |
| 11 | - unemployment / 失业率 / U-3 / U-6 / nonfarm / 非农 |
| 12 | - Fed funds / 联储利率 / SOFR |
| 13 | - 2Y / 10Y yield / yield curve / 美债利率 / 收益率曲线 |
| 14 | - M1 / M2 / 货币供应 |
| 15 | - DXY / 美元指数 / USD index |
| 16 | - VIX / 10Y breakeven / 通胀预期 |
| 17 | - WTI / Brent / 油价 / gold |
| 18 | - consumer sentiment / 消费者信心 / housing starts / retail sales |
| 19 | |
| 20 | ## Workflow |
| 21 | |
| 22 | 1. Resolve user phrasing to a FRED series ID — first via `aliases.json` (curated), then `search.py` if no alias matches. |
| 23 | 2. Run `series.py <SERIES_ID|alias>` for observations + metadata. |
| 24 | 3. Synthesise NL reply with units, frequency, and last update date; cite "Source: St. Louis Fed (FRED)". |
| 25 | |
| 26 | Environment is auto-loaded on script import from `.env` at project root (or `~/.config/market-intel/env` as fallback) — no manual `source` needed. |
| 27 | |
| 28 | ## CLI examples |
| 29 | |
| 30 | ```bash |
| 31 | # Latest 60 monthly CPI observations |
| 32 | python3 .claude/skills/fred/scripts/series.py CPI |
| 33 | |
| 34 | # 2Y Treasury yield, last 30 daily observations |
| 35 | python3 .claude/skills/fred/scripts/series.py "2Y yield" --limit 30 |
| 36 | |
| 37 | # 10-year breakeven inflation, custom window, ascending |
| 38 | python3 .claude/skills/fred/scripts/series.py T10YIE --start 2024-01-01 --order asc |
| 39 | |
| 40 | # Discover series IDs |
| 41 | python3 .claude/skills/fred/scripts/search.py "consumer price index" --limit 10 |
| 42 | |
| 43 | # Bypass cache |
| 44 | python3 .claude/skills/fred/scripts/series.py CPI --fresh |
| 45 | ``` |
| 46 | |
| 47 | ## Output shape |
| 48 | |
| 49 | ```json |
| 50 | { |
| 51 | "ok": true, |
| 52 | "data": [{"date": "2026-04-01", "value": 314.2}, ...], |
| 53 | "meta": { |
| 54 | "series_id": "CPIAUCSL", |
| 55 | "title": "Consumer Price Index for All Urban Consumers: All Items", |
| 56 | "units": "Index 1982-1984=100", |
| 57 | "frequency": "Monthly", |
| 58 | "seasonal_adjustment": "SA", |
| 59 | "last_updated": "2026-05-13 07:36:01-05", |
| 60 | "count_returned": 60, |
| 61 | "alias_resolved": "CPI" |
| 62 | } |
| 63 | } |
| 64 | ``` |
| 65 | |
| 66 | ## Available aliases |
| 67 | |
| 68 | See `aliases.json` for the curated CN/EN → series ID map. Common ones: |
| 69 | |
| 70 | | Alias | Series ID | |
| 71 | | ------------------------ | --------- | |
| 72 | | CPI | CPIAUCSL | |
| 73 | | core CPI / 核心 CPI | CPILFESL | |
| 74 | | PCE | PCEPI | |
| 75 | | GDP | GDPC1 | |
| 76 | | unemployment / 失业率 | UNRATE | |
| 77 | | nonfarm / 非农 | PAYEMS | |
| 78 | | Fed funds / 联储利率 | DFF | |
| 79 | | 10Y yield / 美债 10 年 | DGS10 | |
| 80 | | yield curve | T10Y2Y | |
| 81 | | DXY / 美元指数 | DTWEXBGS | |
| 82 | | M2 | M2SL | |
| 83 | | VIX | VIXCLS | |
| 84 | | 10Y breakeven / 通胀预期 | T10YIE | |
| 85 | |
| 86 | If the user's phrase isn't in the map, fall back to `search.py "<query>"` and pick the highest-popularity non-discontinued result. |
| 87 | |
| 88 | ## Error handling |
| 89 | |
| 90 | | Exit code | Meaning | LLM action | |
| 91 | | --------- | ---------------------- | ------------------------------------------------------------------------------------------------------------- | |
| 92 | | 0 | Success | Parse `data`, narrate. | |
| 93 | | 2 | Missing `FRED_API_KEY` | Tell user to register at https://fred.stlouisfed.org/docs/api/api_key.html and add to `.env` at project root. | |
| 94 | | 3 | HTTP 4xx or non-JSON | Surface error from `hint`. | |
| 95 | | 4 | Network | Suggest retry. | |
| 96 | |
| 97 | ## Known limitations |
| 98 | |
| 99 | - Daily series may have weekend/holiday gaps (FRED returns NaN as `.`; we normalise to `null`). |
| 100 | - "Discontinued" series filtered by default in `search.py` — use `--include-discontinued` to override. |
| 101 | - Series metadata cache TTL 24 h; observation cache TTL 1 h. Use `--fresh` for the latest. |
| 102 | |
| 103 | ## Related skills |
| 104 | |
| 105 | - `longbridge-quote` for live equity quotes. |
| 106 | - `gdelt` for narrative / sentiment context. |
| 107 | - `sec-edgar` for individual-company filings. |