sector-rotation

sector-rotation is a skill for Claude Code, Codex from JansenAnalytics/claudex. It costs 48 tokens per session (882 once invoked), scanned A, original, MIT.

A market-analysis tool that compares stock-market sectors using exchange-traded funds, which are funds that track baskets of assets.

In plain words
What is it for?
Use it to collect sector price data, calculate relative strength against the S&P 500, build heatmaps, identify leaders, and track market-cycle phases.
Why use it?
It helps show which sectors are leading or weakening and whether money is moving toward defensive or growth-oriented areas.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/collect.py --db data/sectors.db.

Good fit Use it to collect sector price data, calculate relative strength against the S&P 500, build heatmaps, identify leaders, and track market-cycle phases.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/JansenAnalytics/claudex
agentmods
npx agentmods add skills/jansenanalytics/claudex/sector-rotation

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sector-rotation

README.md
[![agentmods](https://agentmods.dev/badge/skills/jansenanalytics/claudex/sector-rotation.svg)](https://agentmods.dev/skills/jansenanalytics/claudex/sector-rotation)
Your own site
<a href="https://agentmods.dev/skills/jansenanalytics/claudex/sector-rotation"><img src="https://agentmods.dev/badge/skills/jansenanalytics/claudex/sector-rotation.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 882 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.00882
Opus 5 $0.00024 $0.00441
Sonnet 5 $0.00010 $0.00176
Haiku 4.5 $0.00005 $0.00088

Measured 4d ago against content hash a0ccfcc3593c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

sector-rotation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/sector-rotation/SKILL.md · 87 lines

How it starts

The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sector Rotation Tracker

Quick Start

Collect + analyze (typical workflow)

cd /path/to/sector-rotation
python3 scripts/collect.py --db data/sectors.db

Then use the JSON output (or DB) to write analysis per references/analysis-prompt.md.

Query historical data

python3 scripts/query.py heatmap          # RS heatmap, all sectors × all periods
python3 scripts/query.py leaders --n 3    # top 3 sectors by 1M RS
python3 scripts/query.py cycle --days 90  # cycle phase history

Scripts

scripts/collect.py — Data Collector & Analyzer

Fetches 3 months of daily data for 17 tickers via yfinance. Computes:

  • Returns and relative strength vs SPY (1W, 2W, 1M, 3M)
  • Money flow proxy (OBV trend, normalized -100 to +100)
  • RSI-14, 1M annualized volatility
  • Market cycle phase detection (sector leadership pattern matching)
  • Breadth: sectors above SPY, defensive vs cyclical flow, risk appetite
  • Rotation signals: ACCELERATING, DECELERATING, RECOVERING, DETERIORATING

Flags: --db PATH, --no-db, --json Dependency: pip3 install yfinance

scripts/query.py — Database Query API

Historical queries for analysis and backtesting.

Commands:

  • snapshot [--date] — full snapshot JSON
  • sector XLE --days 30 [--csv] — single sector history
  • rankings --period 1w|2w|1m|3m — RS rankings
  • cycle --days 90 [--csv] — cycle phase history
  • signals --days 30 — rotation signals log
  • heatmap — RS heatmap (all sectors, all periods)
  • leaders --n 3 / laggards --n 3 — top/bottom sectors
  • compare XLE XLK --days 60 — head-to-head
  • breadth --days 30 [--csv] — breadth/risk appetite history
  • export --days 365 --csv — full export for backtests

Database

SQLite at data/sectors.db. 4 tables:

  • snapshots — full JSON per run + cycle phase + risk appetite
  • sector_series — flat rows per sector: close, returns, RS, flow, RSI, vol
  • cycle_history — phase, confidence, component scores, breadth metrics
  • rotation_signals — timestamped signal log (accelerating/decelerating/etc.)

Read the full file on GitHub · 87 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 87 lines · 48 tokens per session scan A a0ccfcc3593c

Subscribe to this mod's changes

sector-rotation is a skill published in the GitHub repository JansenAnalytics/claudex (5 stars, last pushed 2mo ago), licensed MIT. It adds 48 tokens to every session and 882 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

defeatbeta-earnings-analysis

Create professional equity research earnings update reports (8-12 pages, 3,000-5,000 words) analyzing quarterly results for companies already under coverage. Fast-turnaround format focusing on beat/miss analysis, key metrics, updated estimates, and revised thesis. Includes 1-3 summary tables and 8-12 charts. Use when…

defeat-beta/defeatbeta-api · 112 tokens

defeatbeta-earnings-preview

Build pre-earnings analysis with normalized baselines, weighted decision models, company-specific veto gates, scenario frameworks, catalysts, historical reactions, and options-implied moves. Use before a company reports quarterly earnings to prepare positioning notes or bilingual three-page PDF reports.

defeat-beta/defeatbeta-api · 60 tokens

defeatbeta-analyst

Professional financial analysis using 60+ market data APIs. Use for: company fundamentals (revenue, margins, EPS, balance sheet), valuation (P/E, P/B, P/S, PEG, DCF, intrinsic value), profitability (ROE, ROA, ROIC), growth trends (YoY revenue/earnings/FCF), earnings transcripts (key data, changes, guidance), industry…

defeat-beta/defeatbeta-api · 154 tokens

defeatbeta-earnings-key-data

Run one of three traceable earnings-call transcript templates through the DefeatBeta MCP tools: (1) extract current-quarter results plus next-quarter and full-year guidance, (2) extract factual QoQ or YoY financial-metric change sentences, or (3) extract numerical forward-looking forecast sentences with…

defeat-beta/defeatbeta-api · 138 tokens

gendangzou-skill

A Chinese-language research tool for analyzing sectors in China's stock market using platform, API, and independently installable application data.

MobiusQuant/Gendangzou-skill · 89 tokens

defeatbeta-dcf

Generate a fully editable Discounted Cash Flow (DCF) valuation spreadsheet for a public company. Builds a single-sheet Excel workbook with WACC, growth estimates, 10-year FCF projections, and fair price — all wired as live formulas so users can flex discount rate or growth assumptions and see fair price update.…

defeat-beta/defeatbeta-api · 96 tokens