
Macro Regime Detector
FreeIdentify long-term macro regime transitions for strategic positioning.
Free · Opens the source repo
What Macro Regime Detector does
The Macro Regime Detector skill is designed to analyze macroeconomic conditions and detect structural regime transitions over a 1-2 year horizon. By leveraging cross-asset ratio analysis, this skill assesses various indicators, including market concentration, yield curve dynamics, credit conditions, and sector rotations. It provides insights into whether the market is in a state of concentration, broadening, contraction, inflationary pressures, or transitional phases. This information is crucial for investors and portfolio managers looking to make informed long-term decisions based on macroeconomic trends.
To operate, the skill utilizes a combination of historical data and real-time indicators. It fetches data for multiple ETFs and applies a structured methodology to identify regime shifts. The analysis is conducted using Python scripts that require specific dependencies to be installed. Users can execute the skill by running a straightforward command that initiates the data retrieval process and generates a comprehensive report detailing the current macro regime and transition signals.
The output includes both structured data for programmatic access and a human-readable Markdown report. This report not only summarizes the current regime assessment but also provides a dashboard of transition signals, component details, and recommendations for portfolio positioning. Additionally, users can reference historical regimes to understand past market behaviors in similar contexts. This skill is particularly useful for those who need to assess long-term market positioning based on macroeconomic indicators and trends.
When to use it
Use this skill when you need to understand current macro regimes or anticipate market transitions based on key economic indicators.
When not to use it
This skill is not suitable for short-term trading decisions or for users seeking daily market snapshots.
What you can build with it
Understanding Market Regimes
When analyzing the current state of the market, this skill helps identify whether it is in a concentration or broadening phase.
Long-term Portfolio Strategy
Use the skill to inform strategic portfolio positioning based on macroeconomic indicators and regime shifts.
Historical Context Analysis
When a user seeks to understand how current conditions compare to historical regimes, the skill provides relevant insights.
How to install Macro Regime Detector
View source1. Install with the skills CLI
npx skills add tradermonty/claude-trading-skills/macro-regime-detector --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by tradermontyMacro Regime Detector
Detect structural macro regime transitions using monthly-frequency cross-asset ratio analysis. This skill identifies 1-2 year regime shifts that inform strategic portfolio positioning.
When to Use
- User asks about current macro regime or regime transitions
- User wants to understand structural market rotations (concentration vs broadening)
- User asks about long-term positioning based on yield curve, credit, or cross-asset signals
- User references RSP/SPY ratio, IWM/SPY, HYG/LQD, or other cross-asset ratios
- User wants to assess whether a regime change is underway
Workflow
-
Load reference documents for methodology context:
references/regime_detection_methodology.mdreferences/indicator_interpretation_guide.md
-
Execute the main analysis script:
python3 -m pip install -r skills/macro-regime-detector/requirements.txt uv run python3 skills/macro-regime-detector/scripts/macro_regime_detector.py --output-dir reports/This fetches 600 days of data for 9 ETFs. With an FMP key, the client tries FMP first and fetches Treasury rates (~10 API calls total), then falls back to yfinance for unavailable ETF history. Without an FMP key, it runs in yfinance-only mode and uses SHY/TLT as the yield-curve fallback.
The detector fails closed and writes no report when none of its six components has usable data. Do not treat a missing report or non-zero exit as a valid low-transition regime.
-
Read the generated Markdown report and present findings to user.
-
Provide additional context using
references/historical_regimes.mdwhen user asks about historical parallels.
Prerequisites
- Python dependencies (required): install
requirements.txt, including yfinance and requests - FMP API Key (optional): set
FMP_API_KEYor pass--api-keyto use FMP and Treasury data before the yfinance/SHY-TLT fallbacks - The FMP free tier may not serve every ETF; unavailable symbols automatically use yfinance
6 Components
| # | Component | Ratio/Data | Weight | What It Detects |
|---|---|---|---|---|
| 1 | Market Concentration | RSP/SPY | 25% | Mega-cap concentration vs market broadening |
| 2 | Yield Curve | 10Y-2Y spread | 20% | Interest rate cycle transitions |
| 3 | Credit Conditions | HYG/LQD | 15% | Credit cycle risk appetite |
| 4 | Size Factor | IWM/SPY | 15% | Small vs large cap rotation |
| 5 | Equity-Bond | SPY/TLT + correlation | 15% | Stock-bond relationship regime |
| 6 | Sector Rotation | XLY/XLP | 10% | Cyclical vs defensive appetite |
5 Regime Classifications
- Concentration: Mega-cap leadership, narrow market
- Broadening: Expanding participation, small-cap/value rotation
- Contraction: Credit tightening, defensive rotation, risk-off
- Inflationary: Positive stock-bond correlation, traditional hedging fails
- Transitional: Multiple signals but unclear pattern
Output
macro_regime_YYYY-MM-DD_HHMMSS.json— Structured data for programmatic usemacro_regime_YYYY-MM-DD_HHMMSS.md— Human-readable report with:- Current Regime Assessment
- Transition Signal Dashboard
- Component Details
- Regime Classification Evidence
- Portfolio Posture Recommendations
Relationship to Other Skills
| Aspect | Macro Regime Detector | Market Top Detector | Market Breadth Analyzer |
|---|---|---|---|
| Time Horizon | 1-2 years (structural) | 2-8 weeks (tactical) | Current snapshot |
| Data Granularity | Monthly (6M/12M SMA) | Daily (25 business days) | Daily CSV |
| Detection Target | Regime transitions | 10-20% corrections | Breadth health score |
| API Calls | ~10 | ~33 | 0 (Free CSV) |
Script Arguments
python3 macro_regime_detector.py [options]
Options:
--api-key KEY FMP API key (default: $FMP_API_KEY)
--output-dir DIR Output directory (default: current directory)
--days N Days of history to fetch (default: 600)
Resources
references/regime_detection_methodology.md— Detection methodology and signal interpretationreferences/indicator_interpretation_guide.md— Guide for interpreting cross-asset ratiosreferences/historical_regimes.md— Historical regime examples for context
Frequently asked questions about Macro Regime Detector
Similar skills
Initiating Coverage
Create institutional-quality equity research reports.
Financial Tear Sheet Generator
Create professional company profiles with live data.
Pitch Deck Population
Effortlessly fill pitch deck templates with data.
Tax Season Organizer
Streamline your tax prep for accountants.
Month End Prep
Streamline your month-end close process with ease.
Funding Digest
Summarize funding rounds in a single slide.
