<essential_principles>
<principle name="cass_freight_index">
**CASS Freight Index is the most authoritative freight indicator**
The CASS Freight Index is compiled by Cass Information Systems, tracking freight shipments and expenditures in North America:
| Indicator | Description | Purpose |
|---|
| Shipments Index | Shipment Volume Index | Measures the strength of real economic demand |
| Expenditures Index | Freight Expenditure Index | Measures logistics cost pressure |
| Shipments YoY | Shipment YoY Growth Rate | Detects cycle turning points (core analysis indicator) |
| Expenditures YoY | Expenditure YoY Growth Rate | Verifies cost pass-through |
Data Source: MacroMicro (scraped via Highcharts)
</principle>
<principle name="freight_leads_inflation">
**Freight volume is a leading indicator of inflation**
Core Logic:
- Freight volume ≈ strength of real economic demand
- Decline in shipments → weakening end demand → reduced pricing power
- Historically, the CASS indicator has a lead time of approximately 4-6 months over CPI
The key signal is not monthly changes, but "cycle turning points":
- Turned negative YoY
- Reached a new cycle low
</principle>
<principle name="signal_interpretation">
**Signal Interpretation: Inflation Easing, Not Deflation**
When a CASS cycle turning point is detected:
- Conclusion is "inflation pressure is easing" rather than "deflation"
- Belongs to the inflation easing / disinflation regime
- Supports market expectations of interest rate cuts or policy shifts
This is cross-cycle relationship identification: "Logistics demand momentum → Inflation direction"
</principle>
<principle name="multi_indicator">
**Cross-Validation with Multiple Indicators**
It is recommended to observe the four CASS indicators simultaneously:
- Shipments YoY (primary): Demand-side signal
- Expenditures YoY: Cost-side signal
- Shipments Index: Absolute level
- Expenditures Index: Freight cost pressure
The signal is more reliable when both Shipments and Expenditures turn negative YoY.
</principle>
</essential_principles>
<objective>
Detect cycle turning points of the CASS Freight Index to determine whether inflation is slowing down.
Output three levels of signals:
- Freight Status: Status and cycle position of each CASS indicator
- Lead Alignment: Lead alignment analysis with CPI YoY
- Signal Assessment: Inflation easing signal judgment and confidence level
</objective>
<quick_start>
Fastest Method: Use Chrome CDP to Fetch Data
Step 1: Install Dependencies
bash
pip install requests websocket-client pandas numpy
Step 2: Launch Chrome Debugging Mode
bash
# 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 execute
bash
cd scripts
python fetch_cass_freight.py --cdp
Step 4: Execute Inflation Signal Analysis
bash
python freight_inflation_detector.py --quick
Step 5: Generate Visualization Chart
bash
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 Example:
json
{
"signal": "inflation_easing",
"confidence": "high",
"freight_yoy": -7.46,
"cycle_status": "negative",
"indicator": "shipments_yoy",
"macro_implication": "Inflation pressure is slowing down, and the downside risk of CPI will rise in the future"
}
- Visualization Chart:
output/freight_cpi_2026-01-23.png
Alternative Method (Selenium):
bash
pip install selenium webdriver-manager
python scripts/fetch_cass_freight.py --selenium --no-headless
</quick_start>
<intake>
What analysis do you need?
- Quick Check - View the latest CASS indicators and leading inflation signals
- Full Analysis - Execute complete cycle turning point detection and lead analysis
- Methodology Learning - Understand the leading relationship between CASS indicators and inflation
Please select or provide analysis parameters directly.
</intake>
<routing>
| Response | Action |
|------------------------------|-------------------------------------------------------------|
| 1, "快速", "quick", "check" | Execute `python scripts/freight_inflation_detector.py --quick` |
| 2, "完整", "full", "analyze" | Read `workflows/analyze.md` and execute |
| 3, "學習", "方法論", "why" | Read `references/methodology.md` |
| Provide parameters (e.g., date range) | Read `workflows/analyze.md` and execute with parameters |
After routing, read the corresponding document and execute.
</routing>
<directory_structure>
detect-freight-led-inflation-turn/
├── SKILL.md # This document (router)
├── skill.yaml # Frontend display metadata
├── manifest.json # Skill metadata
├── workflows/
│ ├── analyze.md # Full analysis workflow
│ └── quick-check.md # Quick check workflow
├── references/
│ ├── data-sources.md # CASS data sources and scraping instructions
│ ├── methodology.md # Leading relationship methodology analysis
│ └── historical-episodes.md # Historical case comparisons
├── templates/
│ ├── output-json.md # JSON output template
│ └── output-markdown.md # Markdown report template
├── scripts/
│ ├── fetch_cass_freight.py # MacroMicro CASS scraper
│ ├── fetch_via_cdp.py # Chrome CDP scraping module
│ ├── freight_inflation_detector.py # Main analysis script
│ └── visualize_freight_cpi.py # CASS vs CPI leading relationship visualization
└── examples/
└── sample_output.json # Sample output
</directory_structure>
<reference_index>
Methodology: references/methodology.md
- Leading relationship between CASS Freight Index and CPI
- Cycle turning point detection logic
- Signal strength evaluation criteria
Data Sources: references/data-sources.md
- MacroMicro Highcharts scraping instructions
- Definitions of the four CASS indicators
- Caching strategy and update frequency
Historical Cases: references/historical-episodes.md
- Before and after the 2008 financial crisis
- During the 2020 pandemic
- The 2022 inflation peak period
</reference_index>
<workflows_index>
| Workflow | Purpose | Usage Scenario |
|---|
| analyze.md | Complete cycle turning point analysis | When in-depth analysis is required |
| 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 | | Scrape via CDP (recommended) |
| fetch_cass_freight.py | | Scrape via Selenium (alternative) |
| freight_inflation_detector.py | | 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 CASS vs CPI leading relationship chart |
| </scripts_index> | | |
<visualization>
Visualization Output: CASS vs CPI Leading Relationship Comparison Chart
Core Features (refer to Bloomberg/Refinitiv style):
- CASS 6M Forward: Shift the CASS Freight Index forward by 6 months to intuitively display the leading relationship
- Dual-Axis Comparison: CPI YoY (blue line on left axis) vs CASS Shipments YoY (gray line on right axis)
- Recession Interval Marking: NBER official recession periods marked with light shading
- Bloomberg Dark Style: Dark blue background, high-contrast color scheme
Quick Plotting:
bash
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/reaches a new low ahead, while CPI (blue line) remains high → Inflation easing signal
- When CASS and CPI trends are synchronized → Leading relationship temporarily invalid, interpretation requires caution
</visualization>
<input_schema>
<parameter name="start_date" required="true">
**Type**: string (ISO YYYY-MM-DD)
**Description**: Analysis start date
**Example**: "2010-01-01"
</parameter>
<parameter name="end_date" required="false" default="today">
**Type**: string (ISO YYYY-MM-DD)
**Description**: Analysis end date
</parameter>
<parameter name="indicator" required="false" default="shipments_yoy">
**Type**: string
**Options**: `shipments_index` | `expenditures_index` | `shipments_yoy` | `expenditures_yoy`
**Description**: CASS indicator selection
- `shipments_yoy`: Shipment YoY growth rate (recommended, core analysis indicator)
- `expenditures_yoy`: Expenditure YoY growth rate
- `shipments_index`: Shipment volume index
- `expenditures_index`: Freight expenditure index
</parameter>
<parameter name="lead_months" required="false" default="6">
**Type**: integer
**Description**: Number of months the indicator leads CPI
**Range**: 3-12
</parameter>
<parameter name="yoy_threshold" required="false" default="0.0">
**Type**: float
**Description**: YoY warning threshold (e.g., 0 means turning negative)
</parameter>
</input_schema>
<output_schema>
Refer to the complete structure definition in
.
Summary:
json
{
"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": "Inflation pressure is slowing down, and the downside risk of CPI will rise in the future",
"all_indicators": {
"shipments_index": {...},
"expenditures_index": {...},
"shipments_yoy": {...},
"expenditures_yoy": {...}
}
}
</output_schema>
<success_criteria>
When the analysis is successful, it should produce: