Agent skill

Macro Regime Detector

by tradermonty in tradermonty/claude-trading-skills

Detect structural macro regime transitions (1-2 year horizon) using cross-asset ratio analysis.

MITAuto-check passedBusiness, Finance & HR

Install Macro Regime Detector

skills CLI
$ npx skills add tradermonty/claude-trading-skills --skill macro-regime-detector -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tradermonty/claude-trading-skills macro-regime-detector --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tradermonty/claude-trading-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/macro-regime-detector .claude/skills/macro-regime-detector && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
macro-regime-detector
GitHub stars
3k
Used in
1 other repo
Token cost
~1.2k tokens
SKILL.md length
442 words
Files
32 (incl. scripts, references)
Skills in repo
74
Repo updated
First seen
Licence
MIT

At a glance

Detect structural macro regime transitions (1-2 year horizon) using cross-asset ratio analysis.

  • Works in 4 steps: Load reference documents for methodology… → Execute the main analysis script → Read the generated Markdown report and… → …
  • Asks about macro regime
  • SKILL.md covers When to Use, Workflow, Prerequisites and 6 Components, plus 5 more sections
  • Runs Python scripts from its folder; calls python3 and uv; needs FMP_API_KEY

What it does

Macro Regime Detector is an agent skill from tradermonty/claude-trading-skills. Detect structural macro regime transitions (1-2 year horizon) using cross-asset ratio analysis. Analyze RSP/SPY concentration, yield curve, credit conditions, size factor, equity-bond relationship, and sector rotation to identify regime shifts between Concentration, Broadening, Contraction, Inflationary, and Transitional states. Run when user asks about macro regime, market regime change, structural rotation, or long-term market positioning.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 34 other files, including scripts and reference files (for example `references/historical_regimes.md`, `references/indicator_interpretation_guide.md` and `references/regime_detection_methodology.md`).

It sits in Business, Finance & HR, covering Financial analysis, Positioning and messaging and Stock and market analysis. It works with yfinance. The repository describes itself as: Claude Code skills for equity investors and traders — market analysis, technical charting, economic calendars, screeners, and trading strategy development. The licence is MIT.

When your agent uses it

  • Asks about macro regime
  • Market regime change
  • Structural rotation
  • Long-term market positioning

Example prompts

  • “/macro-regime-detector”

Requirements

  • Python 3
  • A credential in FMP_API_KEY

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Load reference documents for methodology context
  2. Execute the main analysis script
  3. Read the generated Markdown report and present findings to user.
  4. Provide additional context using references/historical_regimes.md when user asks about historical parallels.

What it can do on your machine

Read from SKILL.md and the folder at commit eab8d5c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 13 files in scripts/ (Python, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • FMP_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Macro Regime Detector loads about 1.2k tokens when it runs, and up to ~5.4k if it reads all its reference files. Until then it costs about 117 tokens; SKILL.md has 442 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~117
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from tradermonty/claude-trading-skills at commit eab8d5c, republished under its MIT licence (© tradermonty). 442 words, ~1,210 tokens.

Download SKILL.mdSave it as .claude/skills/macro-regime-detector/SKILL.md (or your agent's skills folder). This skill also uses 31 other files; get the full folder from GitHub.
name
macro-regime-detector
description
Detect structural macro regime transitions (1-2 year horizon) using cross-asset ratio analysis. Analyze RSP/SPY concentration, yield curve, credit conditions, size factor, equity-bond relationship, and sector rotation to identify regime shifts between Concentration, Broadening, Contraction, Inflationary, and Transitional states. Run when user asks about macro regime, market regime change, structural rotation, or long-term market positioning.

Macro 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

  1. Load reference documents for methodology context:

    • references/regime_detection_methodology.md
    • references/indicator_interpretation_guide.md
  2. Execute the main analysis script:

    bash
    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.

  3. Read the generated Markdown report and present findings to user.

  4. Provide additional context using references/historical_regimes.md when user asks about historical parallels.

Prerequisites

  • Python dependencies (required): install requirements.txt, including yfinance and requests
  • FMP API Key (optional): set FMP_API_KEY or pass --api-key to 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
Show full SKILL.md (198 more words)Show less

6 Components

#ComponentRatio/DataWeightWhat It Detects
1Market ConcentrationRSP/SPY25%Mega-cap concentration vs market broadening
2Yield Curve10Y-2Y spread20%Interest rate cycle transitions
3Credit ConditionsHYG/LQD15%Credit cycle risk appetite
4Size FactorIWM/SPY15%Small vs large cap rotation
5Equity-BondSPY/TLT + correlation15%Stock-bond relationship regime
6Sector RotationXLY/XLP10%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 use
  • macro_regime_YYYY-MM-DD_HHMMSS.md — Human-readable report with:
    1. Current Regime Assessment
    2. Transition Signal Dashboard
    3. Component Details
    4. Regime Classification Evidence
    5. Portfolio Posture Recommendations

Relationship to Other Skills

AspectMacro Regime DetectorMarket Top DetectorMarket Breadth Analyzer
Time Horizon1-2 years (structural)2-8 weeks (tactical)Current snapshot
Data GranularityMonthly (6M/12M SMA)Daily (25 business days)Daily CSV
Detection TargetRegime transitions10-20% correctionsBreadth health score
API Calls~10~330 (Free CSV)

Script Arguments

bash
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 interpretation
  • references/indicator_interpretation_guide.md — Guide for interpreting cross-asset ratios
  • references/historical_regimes.md — Historical regime examples for context

© tradermonty, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 31 other files (scripts, references) in skills/macro-regime-detector of tradermonty/claude-trading-skills.

  • SKILL.md
  • references/historical_regimes.md
  • references/indicator_interpretation_guide.md
  • references/regime_detection_methodology.md
  • requirements.txt
  • 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
  • scripts/tests
  • … and 14 more

Open the folder on GitHubat commit eab8d5c

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in tradermonty/claude-trading-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Macro Regime Detector next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Macro Regime Detector compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Macro Regime Detector this skilltradermonty/claude-trading-skills3k1 repos~1.2kAutomated safety check: PassMIT
Earnings Recaphimself65/finance-skills3.4k—~1.7kAutomated safety check: PassMIT
Stock AnalysisCoWork-OS/CoWork-OS477—~685Automated safety check: PassMIT
Stock Explorerfreestylefly/wesight946—~525Automated safety check: PassMIT
Yfinance Datahimself65/finance-skills3.4k—~1.3kAutomated safety check: PassMIT
Fin Earnings Recapcriptogus/agent-evolve-network288—~898Automated safety check: PassMIT

Similar skills

  • Earnings Recap

    himself65/finance-skills

    Analyze a company's most recent (or a specified past) earnings report from Yahoo Finance data (yfinance): actual vs estimated EPS, surprise size, revenue and margin trends, and the stock's price…

    3.4k GitHub stars~1.7k tokensUpdated 6 days ago
    Business, Finance & HRAuto-check passed
  • Stock Analysis

    CoWork-OS/CoWork-OS

    Analyze stocks, ETFs, and crypto using Yahoo Finance and Alpha Vantage.

    477 GitHub stars~685 tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Stock Explorer

    freestylefly/wesight

    A Yahoo Finance (yfinance) powered financial analysis tool. An agent skill from freestylefly/wesight.

    946 GitHub stars~525 tokensUpdated 9 days ago
    Business, Finance & HRAuto-check passed
  • Yfinance Data

    himself65/finance-skills

    Fetch financial and market data with the yfinance Python library (Yahoo Finance).

    3.4k GitHub stars~1.3k tokensUpdated 6 days ago
    Business, Finance & HRAuto-check passed
  • Fin Earnings Recap

    criptogus/agent-evolve-network

    Build a post-earnings recap for a stock using yfinance — headline result vs estimates, quarterly financial trends, stock price reaction, and what changed.

    288 GitHub stars~898 tokensUpdated 2 days ago
    Business, Finance & HRAuto-check passed
  • Fin Yfinance Data

    criptogus/agent-evolve-network

    Fetch market and fundamental data via the yfinance Python library — quotes, OHLC history, financial statements, holders, dividends, options, and more.

    288 GitHub stars~806 tokensUpdated 2 days ago
    Business, Finance & HRAuto-check passed

More from tradermonty/claude-trading-skills

All 74 skills in this repo
  • Technical Analyst

    tradermonty/claude-trading-skills

    This skill should be used when analyzing weekly price charts for stocks, stock indices, cryptocurrencies, or forex pairs.

    3k GitHub starsUsed in 4 repos~4.6k tokens
    Auto-check passed
  • Theme Detector

    tradermonty/claude-trading-skills

    Detect and analyze trending market themes across sectors. An agent skill from tradermonty/claude-trading-skills.

    3k GitHub starsUsed in 2 repos~4.9k tokens
    Auto-check passed
  • Trader Memory Core

    tradermonty/claude-trading-skills

    Track investment theses across their lifecycle — from screening idea to closed position with postmortem.

    3k GitHub starsUsed in 2 repos~4.3k tokens
    Auto-check passed
  • Edge Strategy Reviewer

    tradermonty/claude-trading-skills

    Critically review strategy drafts from edge-strategy-designer for edge plausibility, overfitting risk, sample size adequacy, and execution realism.

    3k GitHub starsUsed in 1 repo~988 tokens
    Auto-check passed
  • Sector Analyst

    tradermonty/claude-trading-skills

    This skill should be used when analyzing sector rotation patterns and market cycle positioning.

    3k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Stanley Druckenmiller Investment

    tradermonty/claude-trading-skills

    Druckenmiller Strategy Synthesizer - Integrates 8 upstream skill outputs (Market Breadth, Uptrend Analysis, Market Top, Macro Regime, FTD Detector, VCP Screener, Theme Detector, CANSLIM Screener)…

    3k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed

Works with

Questions about Macro Regime Detector

What does Macro Regime Detector do?

Detect structural macro regime transitions (1-2 year horizon) using cross-asset ratio analysis. Macro Regime Detector is an agent skill from tradermonty/claude-trading-skills. Detect structural macro regime transitions (1-2 year horizon) using cross-asset ratio analysis.

When should I use Macro Regime Detector?

Macro Regime Detector fits situations like: asks about macro regime; market regime change; structural rotation; long-term market positioning.

How do I install Macro Regime Detector in Claude Code?

Run `npx skills add tradermonty/claude-trading-skills --skill macro-regime-detector -a claude-code`. Or copy the skill folder (skills/macro-regime-detector in tradermonty/claude-trading-skills) into .claude/skills/macro-regime-detector in your project. Claude Code loads it when a task matches its description.

How do I install Macro Regime Detector in Codex?

Run `npx skills add tradermonty/claude-trading-skills --skill macro-regime-detector -a codex`. Or copy the skill folder (skills/macro-regime-detector in tradermonty/claude-trading-skills) into .agents/skills/macro-regime-detector in your project. Codex loads it when a task matches its description.

Can I use Macro Regime Detector in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tradermonty/claude-trading-skills --skill macro-regime-detector -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/macro-regime-detector, .gemini/skills/macro-regime-detector, .github/skills/macro-regime-detector and .opencode/skills/macro-regime-detector in your project.

What does Macro Regime Detector need to run?

Going by SKILL.md and its folder, Macro Regime Detector needs Python for the scripts in its folder, the command-line tools its instructions call (python3 and uv) and credentials named FMP_API_KEY. Our summary lists: Python 3; A credential in FMP_API_KEY.

Does Macro Regime Detector access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Macro Regime Detector safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Macro Regime Detector use?

Macro Regime Detector is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Macro Regime Detector use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.1k tokens, read only when the agent opens those files.

What are the alternatives to Macro Regime Detector?

Skills that share tags, products or a category with Macro Regime Detector: Earnings Recap (himself65/finance-skills, 3.4k stars), Stock Analysis (CoWork-OS/CoWork-OS, 477 stars), Stock Explorer (freestylefly/wesight, 946 stars) and Yfinance Data (himself65/finance-skills, 3.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Macro Regime Detector?

tradermonty (a GitHub user) maintains it in tradermonty/claude-trading-skills, which has 2,977 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on October 9, 2026.

Source: tradermonty/claude-trading-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.