Skip to content
SkillScript-led1,052 tokens in use

Macro Regime Detector

Scores six cross-asset ratios to classify the one-to-two-year macro regime as Concentration, Broadening, Contraction, Inflationary or Transitional.

7,427 stars on the repository MIT Licensetradermonty/claude-trading-skills · skills/macro-regime-detector

Skill label

measured from its files

What installing Macro Regime Detector costs

94tokens idle
1,052tokens in use
5,179tokens, up to

Idle is what sits in context while the skill is installed. In use is its instructions, loaded when it runs. Up to adds the files its instructions link. Counts are approximate, made offline with cl100k_base.

Model dependence Script-led

Script-ledMixedModel-led

Most of this skill is scripts, so it behaves much the same whichever model runs it.

This describes the skill's structure, how much of it is scripts. It does not say how well it works. Scripts: scripts/calculators/__init__.py, scripts/calculators/concentration_calculator.py, scripts/calculators/credit_conditions_calculator.py, scripts/calculators/equity_bond_calculator.py, scripts/calculators/sector_rotation_calculator.py, scripts/calculators/size_factor_calculator.py, scripts/calculators/utils.py, scripts/calculators/yield_curve_calculator.py, scripts/fmp_client.py, scripts/macro_regime_detector.py, scripts/report_generator.py, scripts/scorer.py.

Touches

shelldetectednetworkdetectedwrites filesdetectedcredentialsdetected

Declared tags come from the skill's frontmatter; detected ones from its scripts, its code blocks and the commands it names in inline code. This is detected, not audited.

How it scores

Quality

How well the skill is written, counted from its own files: its frontmatter, its steps, examples, stated output and constraints, its size and whether every file it ships is one it names.How we score it →
Good
  • Frontmatter12/15
  • Structure23/25
  • Examples12/15
  • Output10/15
  • Size15/15
  • Resources4/15

Security

Starts at 100 and loses points for each thing in the skill's files that a reader should look at first.How we score it →
Good
  • Reaches the network−10

    does this on the machine, and the frontmatter does not say so

    SKILL.md, line 26
  • Runs shell commands−5

    does this on the machine, and the frontmatter does not say so

    SKILL.md, line 26
  • Reads credentials−15

    does this on the machine, and the frontmatter does not say so

    SKILL.md, line 92
  • Writes files−8

    does this on the machine, and the frontmatter does not say so

    scripts/macro_regime_detector.py, line 317

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Good
  • Development activity100
  • Maintenance52
  • Community68
  • Maturity36
  • Momentum40

Macro Regime Detector pulls about 600 days of price history for nine ETFs and Treasury rates, then scores six components: RSP/SPY concentration, the 10Y-2Y yield curve, HYG/LQD credit conditions, IWM/SPY size factor, the stock-bond relationship and XLY/XLP sector rotation.

It labels the current structural regime and writes a JSON and a Markdown report. It uses Financial Modeling Prep data when a key is set and yfinance otherwise. It describes market structure and gives no investment advice.

What You Get

  • A current regime label from five classes
  • A transition signal dashboard across six weighted components
  • Component details and the evidence behind the classification
  • JSON and Markdown reports named with the run timestamp
  • Reference notes on methodology, indicator interpretation and historical regimes

Common Use Cases

  • Asking whether market leadership is concentrated or broadening
  • Checking the yield curve and credit ratios for signs of a regime change
  • Comparing the structural view with tactical top and breadth tools
  • Looking up historical regimes that resemble the current reading

What Makes It Unique

It works on a structural horizon of one to two years with monthly data, where the related market top and breadth skills work on weeks or a daily snapshot. It fails closed: if none of the six components has usable data, no report is written and a missing report is never to be read as a calm regime. It also runs without any paid key by falling back to yfinance.

Under The Hood

Claude installs the Python requirements with pip and runs macro_regime_detector.py through the shell, with uv. The script fetches ETF price history and Treasury rates from the Financial Modeling Prep web API when a key is available in FMP_API_KEY or on the command line, and falls back to yfinance, which also reaches the web. It computes the six components locally and writes JSON and Markdown reports into the output folder. Reference documents on methodology and history are loaded when needed.

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers