SuperAPI AI Directory

detect-freight-led-inflation-turn

General & other

View repository

Updated 10-16 05:08

About this skill

<essential_principles>

The CASS Freight Index is compiled by Cass Information Systems and tracks freight shipments and expenditures in North America:

Indicator Description Purpose
Shipments Index Shipments Index Measures the strength of real economic demand
Expenditures Index Freight Expenditures Index Measures logistics cost pressure
Shipments YoY Shipments YoY growth rate Detects cyclical turning points (primary analytical indicator)
Expenditures YoY Expenditures YoY growth rate Verifies cost pass-through

Data source: MacroMicro (scraped via Highcharts)

Core logic:

  • Freight volume ≈ real economic demand strength
  • Declining shipments → weakening end demand → declining pricing power
  • Historically, the CASS indicators have a lead of about 4-6 months over CPI

The key signal is not a single-month change, but a "cyclical turning point":

  • YoY growth rate turned negative
  • New cycle low

When a CASS cyclical turning point is detected:

  • The conclusion is "inflationary pressure easing" rather than "deflation"
  • It belongs to an inflation easing / disinflation regime
  • Supports market expectations for rate cuts or a policy shift

This is cross-cycle relationship identification: "logistics demand momentum → inflation direction"

It is recommended to observe all four CASS indicators simultaneously:

  1. Shipments YoY(primary): demand-side signal
  2. Expenditures YoY: cost-side signal
  3. Shipments Index: absolute level
  4. Expenditures Index: freight cost pressure

When Shipments and Expenditures both turn negative, the signal is more reliable.

</essential_principles>

Output three layers of signals:

  1. Freight Status: status and cycle position of each CASS indicator
  2. Lead Alignment: leading alignment analysis with CPI YoY
  3. Signal Assessment: inflation easing signal determination and confidence level

<quick_start>

The fastest way: use Chrome CDP to scrape data

Step 1: Install dependencies

pip install requests websocket-client pandas numpy

Step 2: Start Chrome in debug mode

# Windows
"C:\Program Files\Google\Chrome\Application\chrome.exe" ^
  --remote-debugging-port=9222 ^
  --remote-allow-origins=* ^
  --user-data-dir="%USERPROFILE%\.chrome-debug-profile" ^
  "https://www.macromicro.me/charts/46877/cass-freight-index"

Step 3: Wait for the page to fully load (chart displayed), then run

cd scripts
python fetch_cass_freight.py --cdp

Step 4: Run inflation signal analysis

python freight_inflation_detector.py --quick

Step 5: Generate visualization charts

python visualize_freight_cpi.py \
  --cache cache/cass_freight_cdp.json \
  --output ../../output/freight_cpi_$(date +%Y-%m-%d).png \
  --start 1995-01-01

Output examples:

  • JSON analysis results:
{
  "signal": "inflation_easing",
  "confidence": "high",
  "freight_yoy": -7.46,
  "cycle_status": "negative",
  "indicator": "shipments_yoy",
  "macro_implication": "通膨壓力正在放緩,未來 CPI 下行風險上升"
}
  • Visualization charts:output/freight_cpi_2026-01-23.png

Alternative method (Selenium):

pip install selenium webdriver-manager
python scripts/fetch_cass_freight.py --selenium --no-headless

</quick_start>

  1. Quick check - View the latest CASS indicators and inflation leading signals
  2. Full analysis - Run complete cyclical turning point detection and lead analysis
  3. Methodology learning - Understand the leading relationship between CASS indicators and inflation

Please choose or directly provide analysis parameters.

After routing, read the corresponding document and execute.

<directory_structure>

detect-freight-led-inflation-turn/
├── SKILL.md                           # 本文件(路由器)
├── skill.yaml                         # 前端展示元數據
├── manifest.json                      # 技能元資料
├── workflows/
│   ├── analyze.md                     # 完整分析工作流
│   └── quick-check.md                 # 快速檢查工作流
├── references/
│   ├── data-sources.md                # CASS 數據來源與爬蟲說明
│   ├── methodology.md                 # 領先性方法論解析
│   └── historical-episodes.md         # 歷史案例對照
├── templates/
│   ├── output-json.md                 # JSON 輸出模板
│   └── output-markdown.md             # Markdown 報告模板
├── scripts/
│   ├── fetch_cass_freight.py          # MacroMicro CASS 爬蟲
│   ├── fetch_via_cdp.py               # Chrome CDP 爬蟲模組
│   ├── freight_inflation_detector.py  # 主分析腳本
│   └── visualize_freight_cpi.py       # CASS vs CPI 領先性視覺化
└── examples/
    └── sample_output.json             # 範例輸出

</directory_structure>

<reference_index>

Methodology: references/methodology.md

  • The leading relationship between the CASS Freight Index and CPI
  • Cyclical turning point detection logic
  • Signal strength evaluation criteria

Data sources: references/data-sources.md

  • MacroMicro Highcharts scraper documentation
  • Definitions of the four CASS indicators
  • Caching strategy and update frequency

Historical Cases: references/historical-episodes.md

  • Around the 2008 Financial Crisis
  • During the 2020 Pandemic
  • The 2022 Inflation Peak

</reference_index>

<workflows_index>

Workflow Purpose When to Use
analyze.md Full-Cycle Turning Point Analysis When in-depth analysis is needed
quick-check.md Quick Signal Check Daily monitoring or quick answers
</workflows_index>

<templates_index>

Template Purpose
output-json.md JSON Output Structure Definition
output-markdown.md Markdown Report Template
</templates_index>

<scripts_index>

Script Command Purpose
fetch_cass_freight.py --cdp Scrape using CDP (recommended)
fetch_cass_freight.py --selenium --no-headless Scrape using Selenium (alternative)
freight_inflation_detector.py --quick Quick check of the latest signals
freight_inflation_detector.py --start DATE --indicator X Full analysis
visualize_freight_cpi.py --lead-months 6 --start DATE Plot the CASS vs CPI leading chart
</scripts_index>

Visualization Output: CASS vs CPI Leading Relationship Comparison Chart

Core features (in the style of Bloomberg/Refinitiv):

  1. CASS 6M Forward: Shift the CASS Freight Index forward by 6 months to visually demonstrate the leading relationship
  2. Dual-Axis Comparison: CPI YoY (left axis, blue line) vs CASS Shipments YoY (right axis, gray line)
  3. Recession Period Markers: NBER official recession periods are indicated with light-colored shading
  4. Bloomberg Dark Style: Dark blue background, high-contrast color scheme

Quick Plot:

cd scripts
python visualize_freight_cpi.py \
  --cache cache/cass_freight_cdp.json \
  --output ../../output/freight_cpi_YYYY-MM-DD.png \
  --start 1995-01-01 \
  --lead-months 6

Output Path:output/freight_cpi_YYYY-MM-DD.png(root directory)

Chart Interpretation:

  • When CASS (gray line) turns negative/hits a new low first while CPI (blue line) remains high → signal of inflation easing
  • When CASS and CPI move in sync → the leading relationship temporarily fails, requiring cautious interpretation

<input_schema>

</input_schema>

<output_schema> See templates/output-json.md for the complete structure definition.

Summary:

{
  "signal": "inflation_easing | inflation_rising | neutral",
  "confidence": "high | medium | low",
  "freight_yoy": -2.9,
  "cycle_status": "new_cycle_low | negative | positive",
  "indicator": "shipments_yoy",
  "macro_implication": "通膨壓力正在放緩,未來 CPI 下行風險上升",
  "all_indicators": {
    "shipments_index": {...},
    "expenditures_index": {...},
    "shipments_yoy": {...},
    "expenditures_yoy": {...}
  }
}

</output_schema>

<success_criteria> A successful analysis should produce:

  • The latest values of the four CASS indicators
  • The YoY and cycle status of the selected indicators
  • Verification of leading alignment with CPI
  • Inflation easing signals and confidence levels
  • CASS vs CPI Leading Relationship Comparison Chart(output/freight_cpi_YYYY-MM-DD.png)
  • Actionable macroeconomic interpretation
  • Clearly noted data limitations and assumptions </success_criteria>