Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add mahmoud20138/Tradecraft --skill correlation-regime-switchergit clone --depth 1 https://github.com/mahmoud20138/TradecraftWrote 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.
[](https://agentmods.dev/skills/mahmoud20138/tradecraft/correlation-regime-switcher)<a href="https://agentmods.dev/skills/mahmoud20138/tradecraft/correlation-regime-switcher"><img src="https://agentmods.dev/badge/skills/mahmoud20138/tradecraft/correlation-regime-switcher/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/mahmoud20138/tradecraft/correlation-regime-switcher"><img src="https://agentmods.dev/badge/skills/mahmoud20138/tradecraft/correlation-regime-switcher.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00087 | $0.00826 |
| Opus 5 | $0.00044 | $0.00413 |
| Sonnet 5 | $0.00017 | $0.00165 |
| Haiku 4.5 | $0.00009 | $0.00083 |
Grade A, and why
correlation-regime-switcher 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 11d 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.
What it actually says
Correlation Regime Switcher
import pandas as pd
import numpy as np
class CorrelationRegimeSwitcher:
REGIME_STRATEGIES = {
"normal_correlation": {
"description": "Correlations at historical norms",
"strategies": ["trend_following", "carry_trade", "mean_reversion_pairs"],
"risk_level": "NORMAL",
},
"correlation_breakdown": {
"description": "Historical correlations breaking down",
"strategies": ["single_pair_momentum", "volatility_selling"],
"risk_level": "ELEVATED — reduce correlated positions",
},
"correlation_spike": {
"description": "All assets moving together (crisis mode)",
"strategies": ["safe_haven_only", "volatility_buying", "cash"],
"risk_level": "HIGH — correlation=1 means no diversification benefit",
},
"decorrelation": {
"description": "Assets becoming uncorrelated — dispersion rising",
"strategies": ["pairs_trading", "relative_value", "basket_trades"],
"risk_level": "OPPORTUNITY — dispersion creates relative value trades",
},
}
@staticmethod
def detect_regime(correlation_matrix: pd.DataFrame, historical_avg_corr: float) -> dict:
"""Classify current correlation regime."""
upper_tri = correlation_matrix.values[np.triu_indices_from(correlation_matrix.values, k=1)]
current_avg = np.mean(np.abs(upper_tri))
deviation = current_avg - abs(historical_avg_corr)
if current_avg > 0.8:
regime = "correlation_spike"
elif deviation > 0.15:
regime = "correlation_spike"
elif deviation < -0.15:
regime = "decorrelation"
elif abs(deviation) < 0.05:
regime = "normal_correlation"
else:
regime = "correlation_breakdown"
strategies = CorrelationRegimeSwitcher.REGIME_STRATEGIES[regime]
return {
"regime": regime,
"current_avg_correlation": round(current_avg, 4),
"historical_avg": round(abs(historical_avg_corr), 4),
"deviation": round(deviation, 4),
**strategies,
}
@staticmethod
def transition_detector(rolling_corr: pd.Series, window: int = 20) -> dict:
"""Detect regime transitions from rolling correlation data."""
recent = rolling_corr.tail(window)
prior = rolling_corr.iloc[-(window*2):-window]
change = recent.mean() - prior.mean()
return {
"transition_detected": abs(change) > 0.2,
"direction": "CONVERGING" if change > 0.2 else "DIVERGING" if change < -0.2 else "STABLE",
"magnitude": round(abs(change), 4),
"action": "Switch strategy set — correlation regime changing" if abs(change) > 0.2 else "Hold current strategies",
}
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.
- 11d ago First seen · 87 lines · 87 tokens per session scan A 53069beba8a4
correlation-regime-switcher is a skill published in the GitHub repository mahmoud20138/Tradecraft (15 stars, last pushed 4mo ago), licensed MIT. It adds 87 tokens to every session and 826 once invoked, about $0.0004 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-08-30.
Other skills, from other repositories
etf-premium
Calculate ETF premium/discount vs NAV via Yahoo Finance, and decompose single-day surges into NAV-driven vs structural components (gamma squeeze, dealer hedging, blocked AP arbitrage). Use whenever the user asks about an ETF's premium or discount, NAV comparison, why an ETF diverged from its holdings, or how much of a…
stock-liquidity
Analyze stock liquidity using bid-ask spreads, volume profiles, order book depth, market impact estimates, and turnover ratios via Yahoo Finance data. Use this skill whenever the user asks about liquidity, trading costs, bid-ask spread, market depth, volume analysis, slippage, market impact, turnover ratio, or how…
tradingview-reader
Read TradingView desktop app for market data, news, alerts, watchlists, and screener results using opencli (read-only). Use this skill whenever the user wants quotes, options chains, options expiries, screener results across stocks/crypto/forex/futures/bonds, gainers/losers/movers, news headlines or full story bodies…
company-valuation
Estimate the intrinsic value of a public company using DCF, relative (peer multiple) and sum-of-parts (SOTP) methods, then triangulate to an implied share price with upside/downside versus the current market price. Use this skill whenever the user asks: "what is AAPL worth", "valuation of NVDA", "fair value of TSLA"…
sepa-strategy
Analyze stocks using Mark Minervini's SEPA (Specific Entry Point Analysis) methodology. Use this skill whenever the user mentions SEPA, Minervini, superperformance, trend template, VCP (Volatility Contraction Pattern), Stage 2 uptrend, stage analysis, pivot point breakout, or asks about growth stock screening…
stock-correlation
Analyze stock correlations to find related companies and trading pairs. Use when the user asks about correlated stocks, related companies, sector peers, trading pairs, or how two or more stocks move together. Triggers: "what correlates with NVDA", "find stocks related to AMD", "correlation between AAPL and MSFT"…