macro-regime
Skill64 starsChanged 17 days agoMITView on GitHub
Structural (6–24 month) macro regime for Indian equities from monthly cross-asset lines: equal weight or smallcap vs NIFTY (broadening), size, NIFTY Bank leadership, cyclicals vs defensives, NIFTY vs gold in rupees, India 10-year G-sec and the yield curve (10y minus T-bill or repo), USD/INR, Brent, the US 10-year and India VIX. Each line gets a 6- vs 12-month crossover state and its last turn. Output: a regime label (Broadening, Narrow, Inflationary squeeze, Easing, Risk-off, Transitional) with evidence, an "N of M turned" count, tilts and what would flip it. macro.py works offline from CSVs.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- kuntal-r-d/my-skillstheir own version, first seen Jun 30, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- kuntal-r-d/my-skills★ 3same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository34 other files it gives its agents.
- backtest-labSkill
- breakout-plannerSkill
- broker-integrationSkill
- event-calendarSkill
- exhaustion-reversalSkill
- fibonacci-tradingSkill
- fii-dii-flowsSkill
- fno-options-analysisSkill
- fundamental-screeningSkill
- india-market-analystSkill
- indian-market-structureSkill
- indian-tax-for-tradersSkill
- ipo-analysisSkill
- market-breadthSkill
- market-pulseSkill
- market-regimeSkill
- market-valuationSkill
- momentum-scannerSkill
- multi-timeframe-analysisSkill
- options-strategiesSkill
- pair-tradingSkill
- portfolio-reviewSkill
- position-sizingSkill
- results-seasonSkill
- risk-reward-ratioSkill
- rsi-divergenceSkill
- sector-rotationSkill
- stock-screenerSkill
- stop-loss-strategiesSkill
- technical-analysisSkill
- thesis-trackerSkill
- trading-costsSkill
- trading-disciplineSkill
- trailing-stopsSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 109
10-year and curve: read with the RBI cycle. Cuts usually show up as bull steepening (the short rate falls faster).
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Macro Regime (India)
Not the same as market-regime. That skill reads NIFTY's daily tape (distribution days,
follow-through) over a horizon of weeks and sets the exposure ceiling. This one works on month-end
data over 6–24 months. It asks which kind of market India is in (who leads, and whether crude, the
rupee and rates are helping or hurting) and changes only a few times per cycle. Use it for the
quarterly allocation tilt, then let the faster skills time entries inside it.
Commands
python3 scripts/macro.py series # file names, tickers, sources
python3 scripts/macro.py status --csv-dir macro_data/ # label, evidence, table, tilts
python3 scripts/macro.py status --csv-dir yields/ --fetch --json # CSVs for yields, Yahoo for the rest
python3 scripts/macro.py history --csv-dir macro_data/ --months 36
python3 scripts/macro.py component curve --csv-dir macro_data/ # one gauge month by monthFlags: --as-of YYYY-MM[-DD] (replay), --closed-months (drop the month in progress), --fast 6,
--slow 12, --recent 3 (turn window), --band-pct 0.25 / --band-bp 5 (dead band),
--ticker KEY=TICKER, --period 10y, --json (strict JSON). Loader helpers are shared with
../technical-analysis/scripts/ta.py. Errors print one error: line and exit 2.
Inputs: one CSV per series, any subset
A date column plus a close/price/yield column is enough. Daily, weekly or monthly rows all work
(the last value of each month is used). Null rows are skipped. Investing.com exports (MM/DD/YYYY,
"Price" column) are detected from the whole file. Name each file after the series key or label
(series lists the aliases).
| Key | Series | Yahoo | Status | Where else |
| NIFTY, BANK | NIFTY 50, NIFTY Bank | ^NSEI, ^NSEBANK | confirmed | niftyindices.com historical data |
| SMALLCAP, MIDCAP | Smallcap 250, Midcap 150 | NIFTYSMLCAP250.NS, NIFTYMIDCAP150.NS | confirmed | niftyindices.com |
| EQUALWEIGHT | NIFTY50 Equal Weight | — | csv-only | niftyindices.com strategy indices |
| FMCG, PHARMA / METAL, REALTY, PSUBANK | defensive / cyclical baskets | ^CNXFMCG ... ^CNXPSUBANK | confirmed | niftyindices.com |
| GOLD | GOLDBEES (gold in ₹) | GOLDBEES.NS | unconfirmed | broker history, MCX or IBJA prices |
| IN10Y | India 10-year G-sec yield | — | csv-only | RBI DBIE, CCIL/FBIL, Investing.com export |
| SHORT | 91-day T-bill or repo rate | — | csv-only | RBI DBIE, FBIL; a repo file needs only change dates |
| USDINR | USD/INR | INR=X (or USDINR=X) | unconfirmed | RBI/FBIL reference rate |
| BRENT | Brent crude | BZ=F | unconfirmed | EIA, Investing.com |
| US10Y | US 10-year | ^TNX | unconfirmed | FRED DGS10 |
| VIX | India VIX | ^INDIAVIX | unconfirmed | nseindia.com historical VIX |
"Confirmed" means daily history was served in this pack's 2026-10-31 Yahoo probe (shared with
sector-rotation). "Unconfirmed" tickers are the usual symbols, but Yahoo rate-limited (HTTP 429)
the 2026-11-12 check, so they were not verified. Use --ticker or a CSV if one fails. G-sec yields
are not on Yahoo. --fetch (or no --csv-dir) needs pip install yfinance.
Method
- Month-end values. One missing month is bridged; a longer hole drops older data (with a warning). A repo series is carried forward between policy changes. Ten lines: price ratios (concentration, size, banks, cyclical/defensive baskets, NIFTY/gold) and levels (10-year, USD/INR, Brent, US 10-year, VIX). Baskets are equal-weight after rebasing to 100. Without equal weight, smallcap/NIFTY becomes the concentration line and midcap/NIFTY the size line, so no ratio is counted twice.
- State = 6-month SMA vs 12-month SMA of the line, with a dead band (0.25% for ratios, 5bp for yields). A turn is a change of direction, dated by the month it happened. A fitted 6-month slope labels the trend as running or fading (for example "rising, fading"). 6- and 12-month changes are shown in % (or bp for yields).
- Curve = 10y minus the short rate, with the same crossover (steepening/flattening; bull or bear from the 10y direction), plus an inversion flag with the start month.
- Transition count: "N of M components turned in the last 3 months". 0 = stable, under 25% = isolated, 25–50% = rotation building, 50% or more = broad transition. It is a tally, not a probability. The month in progress is flagged as provisional.
Regime labels (the first one that matches is the headline; others are listed as "also matching")
| Label | Rule | Tends to favour / hurt (tendencies, not predictions) |
| Inflationary squeeze | ≥2 of Brent, USD/INR, 10y rising, none falling | IT and pharma exporters, upstream oil, gold, short debt / OMCs, paints, aviation, NBFCs, realty |
| Risk-off / contraction | ≥3 equity ratios falling incl. NIFTY/gold (cyc/def if no gold); 2 if VIX ≥22 | FMCG, pharma, gold, cash / smallcaps, PSU banks, metals, leverage |
| Broadening risk-on | concentration/size rising, none falling, ≥60% of equity ratios rising | mid/small caps, capex, PSU banks, metals / defensives, gold weight |
| Narrow / concentrated | breadth pair falling, none rising | heavyweights, large-cap quality / small-cap breakouts |
| Easing tailwind | 10y falling + a backer (steepening curve, crude down, US yields down, firmer rupee); not crude and rupee both up | banks, NBFCs, realty, autos, gilt duration |
| Transitional / mixed | none of the above | balance; use the faster skills |
The squeeze ranks first because crude feeds India's current account, the rupee and CPI together, and that combination has repeatedly kept RBI tight. "What would change the label" flips one gauge at a time and lists the flips that alter the headline, nearest crossover first.
Reading the components in India
- Breadth and size: equal weight or smallcap rising against NIFTY means money is spreading out (retail/SIP flows, domestic cyclicals). A narrow tape means FII money is sitting in the heavyweights. Smallcap/NIFTY tends to turn before the index does, in both directions.
- NIFTY Bank / NIFTY: credit growth and the rate cycle. PSU banks lead in capex upcycles. Private banks lead when FIIs return.
- Cyclicals vs defensives: metals, realty and PSU banks track the capex/PSU cycle and global metals. FMCG and pharma lead when rural demand or global growth is weak.
- NIFTY / gold: gold is the Indian household's hedge, and rupee depreciation lifts it twice. Gold winning for months is a warning about risk appetite, not just a bullion trade.
- 10-year and curve: read with the RBI cycle. Cuts usually show up as bull steepening (the short rate falls faster). An inverted 10y–T-bill curve is rare in India and usually comes from liquidity squeezes (advance-tax outflows, defending the rupee), so check the cause.
- USD/INR: a weaker rupee usually comes with FII outflows (see
fii-dii-flows). It helps IT and pharma earnings but raises imported inflation. - Brent: India imports about 85% of its crude, so rising crude hurts the current account, the rupee, OMC margins and inflation together. Falling crude is a quiet tailwind.
- US 10-year: rising US yields pull FPI debt and equity money back home, pressuring the rupee and Indian valuations.
- India VIX: the level is banded like
market-regime(13/17/22/30). The trend matters more here.
How it sits with the other skills
macro-regime (quarters) → market-regime (weeks, exposure ceiling) → market-breadth and
sector-rotation (which stocks and sectors) → fii-dii-flows (who is buying). Use the label to set
the tilt and the faster skills to time it. When the two regimes disagree (squeeze here, confirmed
uptrend there), size down rather than pick one. Feed the tilts into portfolio-review.
Limits
- Few regime shifts per decade, so each past example is one data point. The rules are judgement, not fitted. Ratios can trend for years (smallcap/NIFTY fell through 2018–20), so a state is context, not a timing signal.
- The 6/12-month averages lag by design: a turn is confirmed months after the price low or high.
- Yahoo index history can be short or patchy, and the G-sec, equal-weight and repo series are CSV-only. Under 5 components the coverage is graded "thin"; say so when you quote the label.
- Baskets are fixed (FMCG+Pharma vs Metal+Realty+PSU Bank). Supply DEFENSIVE.csv or CYCLICAL.csv to use your own series.
Output
Regime: [label] | coverage m/10 ([grade]) | month [YYYY-MM] (data to [date])
For/against: [legs] | Transition: N of M turned in the last 3 months | table | tilts | would changeEducational analysis, not investment advice. Data: [files/tickers + month-end dates].
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

