Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

macro-regime-detector

Skill by tradermonty

Detects structural macro regime transitions over a 1-2 year horizon using cross-asset ratios such as RSP/SPY, HYG/LQD and the yield curve. Built for users who ask about macro regimes, structural rotation or long-term market positioning.

  • Score 91
  • 8.8k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install macro-regime-detector

Built from the published package, never by AI.

git clone --depth 1 https://github.com/tradermonty/claude-trading-skills /tmp/claude-trading-skills && mkdir -p ~/.claude/skills && cp -r /tmp/claude-trading-skills/skills/macro-regime-detector ~/.claude/skills/macro-regime-detector

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install macro-regime-detector in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

Macro Regime Detector is an agent skill that detects structural macro regime transitions over a 1-2 year horizon. It uses monthly cross-asset ratio analysis across six components: RSP/SPY market concentration, the 10Y-2Y yield curve, HYG/LQD credit conditions, IWM/SPY size factor, the equity-bond relationship, and XLY/XLP sector rotation.

The script fetches 600 days of data for nine ETFs. It uses FMP first when a key is set, with yfinance as a fallback. It classifies the market as Concentration, Broadening, Contraction, Inflationary or Transitional, then writes JSON and Markdown reports with portfolio posture recommendations. It is aimed at users who ask about macro regimes, structural rotation or long-term positioning.

Written from the project's SKILL.md and checked against it.

What it can do

  • Market concentrationTracks RSP/SPY ratio to measure mega-cap concentration versus broadening (25% weight).
  • Yield curveAnalyzes the 10Y-2Y spread to detect interest rate cycle transitions (20% weight).
  • Credit conditionsUses HYG/LQD to gauge credit cycle risk appetite (15% weight).
  • Size factorCompares IWM/SPY to show small versus large cap rotation (15% weight).
  • Equity-bond relationshipUses SPY/TLT and correlation to detect stock-bond regime shifts (15% weight).
  • Sector rotationUses XLY/XLP to show cyclical versus defensive appetite (10% weight).
  • Regime classificationClassifies the market as Concentration, Broadening, Contraction, Inflationary or Transitional.
  • Report outputWrites timestamped JSON and Markdown reports with portfolio posture recommendations.

What you need

  • Python with the packages in requirements.txt, including yfinance and requests
  • Optional FMP API key set as FMP_API_KEY or passed with --api-key

Try asking

  • What macro regime is the market in right now?
  • Is there a structural rotation from concentration to broadening?
  • Run a macro regime check and summarize the long-term positioning.

Good to know

  • Designed for 1-2 year structural shifts, not short-term timing.
  • Without an FMP key, the yield curve falls back to SHY/TLT.
  • The FMP free tier may not serve every ETF, so yfinance is used for those.
  • If no component has usable data, no report is written and the run exits non-zero.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/macro-regime-detector/SKILL.md, skills/macro-regime-detector/scripts/calculators/__init__.py, skills/macro-regime-detector/scripts/calculators/concentration_calculator.py, skills/macro-regime-detector/scripts/calculators/credit_conditions_calculator.py, skills/macro-regime-detector/scripts/calculators/equity_bond_calculator.py, skills/macro-regime-detector/scripts/calculators/sector_rotation_calculator.py, skills/macro-regime-detector/scripts/calculators/size_factor_calculator.py, skills/macro-regime-detector/scripts/calculators/utils.py, skills/macro-regime-detector/scripts/calculators/yield_curve_calculator.py. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md5 KB
  • references/historical_regimes.md5 KB
  • references/indicator_interpretation_guide.md6 KB
  • references/regime_detection_methodology.md7 KB
  • requirements.txt33 B
Show all 32 files
  • scripts/calculators/__init__.py49 B
  • scripts/calculators/concentration_calculator.py6 KB
  • scripts/calculators/credit_conditions_calculator.py4 KB
  • scripts/calculators/equity_bond_calculator.py7 KB
  • scripts/calculators/sector_rotation_calculator.py4 KB
  • scripts/calculators/size_factor_calculator.py4 KB
  • scripts/calculators/utils.py14 KB
  • scripts/calculators/yield_curve_calculator.py11 KB
  • scripts/fmp_client.py18 KB
  • scripts/macro_regime_detector.py12 KB
  • scripts/report_generator.py20 KB
  • scripts/scorer.py20 KB
  • scripts/tests/conftest.py314 B
  • scripts/tests/test_concentration.py3 KB
  • scripts/tests/test_credit_conditions.py2 KB
  • scripts/tests/test_equity_bond.py3 KB
  • scripts/tests/test_fmp_client.py10 KB
  • scripts/tests/test_helpers.py3 KB
  • scripts/tests/test_main_cli.py5 KB
  • scripts/tests/test_packaged_deps.py4 KB
  • scripts/tests/test_price_bar_gaps.py2 KB
  • scripts/tests/test_report_generator.py12 KB
  • scripts/tests/test_scorer.py23 KB
  • scripts/tests/test_sector_rotation.py3 KB
  • scripts/tests/test_size_factor.py2 KB

And 2 more files on GitHub.

Alternatives to macro-regime-detector

All alternatives →

Compare with meme-rush, okx-market or saas-metrics-coach

macro-regime-detector: common questions

What does the macro regime detector measure?

It measures cross-asset ratios such as RSP/SPY, the 10Y-2Y yield curve, HYG/LQD, IWM/SPY, SPY/TLT and XLY/XLP. These are combined into a weighted view of structural regime shifts.

What regimes can it report?

It classifies the market as Concentration, Broadening, Contraction, Inflationary or Transitional. Transitional is used when multiple signals exist but no clear pattern forms.

Does it need a paid data key?

No. It runs in yfinance-only mode without an FMP key. An FMP key is optional and is tried first for ETF history and Treasury rates.

How do I install macro-regime-detector?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is macro-regime-detector free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is macro-regime-detector safe to use?

It scores 91 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to macro-regime-detector?

Similar skills: meme-rush, okx-market, saas-metrics-coach, sec-edgar.

macro-regime-detector Install

Add to stack

Loading.