macro-regime-detector
by @finskills
Classify the current macroeconomic regime across six states using GDP, CPI, Fed Funds rate, yield curve, and credit spread data from the Finskills API.
clawhub install finskills-macro-regime-detectorπ About This Skill
name: Macro Regime Detector version: 1.0.2 description: "Classify the current macroeconomic regime across six states using GDP, CPI, Fed Funds rate, yield curve, and credit spread data from the Finskills API." author: finskills metadata: openclaw: requires: env: - FINSKILLS_API_KEY primaryEnv: FINSKILLS_API_KEY homepage: https://github.com/finskills/macro-regime-detector
Macro Regime Detector
Identify the current US macroeconomic regime by synthesizing real-time treasury yields, GDP growth, inflation, interest rates, and commodity price signals from the Finskills API. Output a regime classification with an evidence-based rationale and asset allocation implications.
Setup
API Key required β Register at https://finskills.net to get your free key.
Header: X-API-Key:
> Get your API key: Register at https://finskills.net β free tier available, Pro plan unlocks real-time quotes, history, and financials.
When to Activate This Skill
Activate when the user:
Macro Regime Framework
This skill classifies the US economy into one of six regimes:
| Regime | GDP Growth | Inflation | Rate Direction | Risk Assets | |--------|-----------|-----------|---------------|-------------| | Goldilocks | Expanding | Moderate (2β3%) | Stable/Falling | Risk-On β | | Reflation | Expanding | Rising (3β5%) | Rising | Cyclicals β | | Overheating | Strong | High (>5%) | Rising fast | Commodities β | | Stagflation | Slowing | High (>4%) | Elevated | Hard Assets β | | Slowdown | Decelerating | Falling | Stable | Defensives β | | Recession | Contracting | Low/Deflating | Falling | Cash/Bonds β |
Data Retrieval β Finskills API Calls
Make the following calls (all free-tier endpoints):
1. US Treasury Rates (Yield Curve)
GET https://finskills.net/v1/free/macro/treasury-rates
Extract: 3m, 6m, 1y, 2y, 5y, 10y, 30y yields
Compute: 2y10y spread (primary inversion signal), 3m10y spread (recession predictor)2. GDP Growth
GET https://finskills.net/v1/free/macro/gdp/US
Extract: latest GDP growth rate (QoQ annualized), trend direction (3-quarter comparison)3. Inflation
GET https://finskills.net/v1/macro/inflation
Extract: CPI YoY, core CPI YoY, PCE YoY, trend (accelerating/stable/decelerating)4. Interest Rates (Fed Policy)
GET https://finskills.net/v1/macro/interest-rates
Extract: Federal Funds Rate (current), last 6 rate decisions, trend (hiking/cutting/pausing)5. Key Economic Indicators (FRED via free endpoint)
GET https://finskills.net/v1/free/macro/indicator/UNRATE
Extract: US unemployment rate (latest, 3-month trend)GET https://finskills.net/v1/free/macro/indicator/INDPRO
Extract: Industrial Production Index (latest YoY%)6. Commodity Price Signals
GET https://finskills.net/v1/free/commodity/prices
Extract: Gold (safe haven demand), WTI Crude (inflation/demand signal), Copper (growth proxy)Analysis Workflow
Step 1 β Yield Curve Classification
Using treasury rates data:
| Signal | Threshold | Interpretation | |--------|-----------|----------------| | 2y10y spread | > +50 bps | Normal β growth expected | | 2y10y spread | -25 to +50 bps | Flat β transition phase | | 2y10y spread | < -25 bps | Inverted β οΈ β recession risk elevated | | 3m10y spread | < 0 bps | Classic recession predictor (12β18 month lead) |
Note the steepening/flattening trend direction (compare to 3 months ago if data allows).
Step 2 β Growth Assessment
| GDP Signal | Label | |-----------|-------| | > 3% annualized | Strong expansion | | 1β3% annualized | Moderate expansion | | 0β1% annualized | Stagnation | | < 0% (1 quarter) | Contraction risk | | < 0% (2 quarters) | Technical recession |
Cross-check with: Industrial Production YoY, Unemployment trend.
Step 3 β Inflation Regime
| CPI YoY | PCE YoY | Label | |---------|---------|-------| | < 2% | < 2% | Deflationary/below-target | | 2β3% | 2β2.5% | Target range (Goldilocks) | | 3β5% | 2.5β4% | Above-target, manageable | | > 5% | > 4% | High inflation |
Classify trend: Rising / Stable / Falling (compare last 3 readings).
Step 4 β Fed Policy Stance
| Rate Trend | Description | |-----------|-------------| | 3+ consecutive hikes | Tightening cycle | | Hold after hikes | Pause (peak rates) | | First cut after hikes | Pivot (easing begins) | | 3+ consecutive cuts | Easing cycle | | Hold at low rates | Accommodative |
Step 5 β Commodity Cross-Check
Step 6 β Regime Classification
Score each indicator and use this decision matrix:
IF GDP_expanding AND inflation_2-4% AND rates_stable: β GOLDILOCKS
IF GDP_expanding AND inflation_rising AND rates_rising: β REFLATION/OVERHEATING
IF GDP_slowing AND inflation_high AND rates_elevated: β STAGFLATION
IF GDP_slowing AND inflation_falling AND rates_cutting: β SLOWDOWN
IF GDP_contracting AND yield_curve_inverted: β RECESSION
Assign confidence: HIGH (3+ signals aligned), MEDIUM (2 signals), LOW (mixed signals).
Step 7 β Asset Allocation Implications
For each regime, output the relative preference for major asset classes:
| Asset Class | Goldilocks | Reflation | Stagflation | Slowdown | Recession | |-------------|-----------|-----------|-------------|----------|-----------| | US Equities | β OW | β OW | β UW | βοΈ N | β UW | | Growth Tech | β OW | βοΈ N | β UW | βοΈ N | β UW | | Energy/Materials | βοΈ N | β OW | β OW | β UW | β UW | | Defensives | β UW | β UW | β OW | β OW | β OW | | REITs | β OW | β UW | β UW | βοΈ N | β UW | | Long Bonds | β UW | β UW | β UW | β OW | β OW | | TIPS/I-Bonds | βοΈ N | β OW | β OW | β UW | β UW | | Gold | β UW | βοΈ N | β OW | β OW | β OW | | Cash | β UW | βοΈ N | β OW | β OW | β OW |
OW = Overweight | N = Neutral | UW = Underweight
Output Format
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β US MACRO REGIME REPORT β {DATE} β
ββββββββββββββββββββββββββββββββββββββββββββββββββββποΈ REGIME CLASSIFICATION: {REGIME NAME}
Confidence: {HIGH / MEDIUM / LOW}
Trend: {Deepening / Stable / Transitioning}
π MACRO DASHBOARD
Treasury Yields:
3M: {%} | 2Y: {%} | 5Y: {%} | 10Y: {%} | 30Y: {%}
2Yβ10Y Spread: {bps} ({normal/flat/inverted})
3Mβ10Y Spread: {bps}
Growth:
GDP Growth: {%} annualized ({direction})
Industrial Prod: {%} YoY
Unemployment: {%} ({trend})
Inflation:
CPI YoY: {%}
Core CPI YoY: {%}
PCE YoY: {%}
Trend: {Rising / Stable / Falling}
Fed Policy:
Fed Funds Rate: {%}
Policy Stance: {Tightening / Pause / Pivoting / Easing}
Last Decision: {hike/cut/hold} ({date})
Commodity Signals:
WTI Crude: ${price} ({weekly change}%)
Gold: ${price} ({weekly change}%)
Copper: ${price} ({weekly change}%)
Interpretation: {one-line signal}
π― ASSET ALLOCATION IMPLICATIONS
Overweight: {asset classes}
Neutral: {asset classes}
Underweight: {asset classes}
π REGIME NARRATIVE
{3β4 sentences describing the current macro environment, key risks,
and what conditions would trigger a regime shift}
β οΈ WATCH β REGIME SHIFT TRIGGERS
Bull shift if: {conditions}
Bear shift if: {conditions}
Limitations
βοΈ Configuration
API Key required β Register at https://finskills.net to get your free key.
Header: X-API-Key:
> Get your API key: Register at https://finskills.net β free tier available, Pro plan unlocks real-time quotes, history, and financials.