Quant and equity research tools that run inside Claude, or behind your own UI. You ask Claude "preview NVDA earnings" or "screen for momentum names that pulled back this week" and you get back what a professional analyst would write at 6am, with the supporting numbers and citations to the API calls underneath. Or you skip Claude entirely. pip install quant-garage and call the same tool from your o
Add this skill
npx mdskills install rgourley/quant-garageComprehensive financial research toolkit with 42 primitives and 13 workflows for equity analysis
1# Quant Garage23<img width="1200" height="630" alt="og" src="./assets/og.png" />45> **Trade like a pro. Without the terminal.**6> [View the full landing page →](https://www.robertcreative.com/projects/quant-garage)78Quant and equity research tools that run inside Claude, or behind your9own UI. You ask Claude "preview NVDA earnings" or "screen for momentum10names that pulled back this week" and you get back what a professional11analyst would write at 6am, with the supporting numbers and citations12to the API calls underneath.1314Or you skip Claude entirely. `pip install quant-garage` and call the15same tool from your own code. Every skill is an importable Python16function that returns JSON, so it drops straight into a Jupyter17notebook, a research dashboard, a Slack alert, a cron job. Both paths18work because every skill ships the same compute as two layers: the19JSON contract for developers and a rendered note, table, stream, or20report for humans.2122Forty-two primitives plus thirteen one-command workflows. One23framework. Built in the garage, not the trading floor.2425**Needs a [Massive API key](https://massive.com/pricing).** Free Basic26tier runs twenty-one of the primitives plus most workflows end-to-end;27$29/month Stocks Starter opens thirty-nine of the forty-two primitives28and every workflow. One primitive (prediction-market-monitor) needs29no Massive key at all — it uses Kalshi's public read-only API.3031**Feedback welcome.** Found a bug or have an idea? Open an32[issue](https://github.com/rgourley/quant-garage/issues) or send a33[pull request](https://github.com/rgourley/quant-garage/pulls).3435## What the collection does3637Each primitive is useful on its own. The point of having forty-two that38share data, methodology, and audit trail is that they chain. The39eight workflows show what that chaining looks like when someone40wires the pieces together for a specific cadence.4142Tuesday morning, you're long NVDA into Thursday's print.43`earnings-drilldown` shows the implied move is rich vs the 8-quarter44realized. `valuation-sanity-check --mc` puts the current price at the4578th percentile of peer-driven fair values. You like the setup but46want to size honestly. `position-sizer` puts NVDA at 8% under47vol-target given the 48% realized vol. You execute. `portfolio-mark`48walks the snapshot fallback chain; `slippage-cost` flags one fill that49crossed the spread. End of day: `risk-report` shows NVDA now drives5035% of portfolio variance.5152One repo, one Massive key, one methodology.5354The research side has the same shape. `universe-builder` screens for55momentum pullbacks; `factor-research` confirms which factors are56working this regime; `news-scanner` checks for catalysts on the57survivors; `event-study` measures the abnormal return around each58catalyst. You get from "what should I look at?" to "here's the regime59context and the abnormal-return distribution" in a single workflow.6061Each tool plugs into the same `quant_garage/` core: same client, same62timezone handling, same audit-trail format, same significance63thresholds.6465## The idea6667Every number in this repo cites a live API call. Every take is68computed from actual readings. Every peer set carries its sample69size. When the data is thin, the tool says so instead of guessing.7071That's the whole difference between a research tool and a chatbot72with a market-data plugin. The tools refuse to fabricate when the73data isn't there, and they surface the endpoint and timestamp for74each figure so you can retrace the reasoning.7576The methodology references inside each skill folder are where the77IP lives: statistical methods, sample-size rules, base rates, edge78cases, honest caveats about what the take does and doesn't prove.79The Massive API provides the inputs. Everything else is workflow.8081LLMs and agents work better on top of this surface than under it.82Ask Claude Code "review my book" and it invokes the composite; ask83any tool-use LLM and it consumes the same JSON. The dual layer84means humans read a briefing, agents read a schema, both are anchored85to the same live citation trail.8687## Who this is for8889Four honest audiences.9091**Retail investors with a real book.** $50K to a few million. You92make informed decisions, you don't day-trade, you don't have a93Bloomberg terminal, and you want sell-side-quality output on the94positions you actually hold. The workflows above (portfolio-review,95weekly-brief, preflight-trade) were built for this exact use pattern.9697**Fintech and market-data developers.** You're building on top of98Massive (or considering it) and you need reference tooling that99shows what a serious integration looks like. Every skill is a100working data layer with source-cited outputs, retry logic, and101proper fallback chains. Fork it, adapt it, ship it.102103**LLM and agent developers.** You're building finance-adjacent104agents that need tool-use with real citations, not fabricated105numbers. Every `run()` returns JSON matching a schema; every skill106is discoverable as a Claude Code skill under `skills/`. The dual-107layer contract is designed for exactly this use case.108109**Analysts and PMs, as supplementary tooling.** You have Bloomberg110or Factset. You don't need this to replace them. You do need it111for the scriptable workflows the terminal is bad at: batch a112watchlist scan, feed the output into a Slack channel, run a113sanity check that's reproducible and citation-anchored.114115**Not for:** people looking for a trading system. These tools116encode analyst workflow, not strategy. The takes are pattern-117matchers grounded in methodology; they aren't a signal engine. If118you want production alpha, you build on top of this.119120121122## Thirteen one-command workflows123124Start here. Workflows are chains of the 26 building-block tools125below, wired for specific cadences. Each takes a watchlist or a126ticker (or nothing, for macro-only reads) and returns a single127briefing with a headline block up top and the full per-tool detail128below. If you only try one thing in this repo, try one of these.129130**[`portfolio-review`](skills/portfolio-review)**131The full book review in one call. Chains eight sub-skills: market-132regime, sector-rotation-signal, historical-analog-finder, risk-report,133earnings-blackout, macro-event-calendar, corporate-actions-scanner,134portfolio-rebalancer. Headline block distills each into one line:135regime, rotation theme, 90-day forward SPY distribution, portfolio136vol plus top variance contributor, next earnings, next macro, top1378-K, rebalance verdict. Built after a live review missed an ALLO138public offering (87.5M shares, 34% dilution) because the workflow139was run manually and one tool was skipped. Now the workflow is one140command that doesn't skip.141142**[`weekly-brief`](skills/weekly-brief)**143Sunday-night prep. Watchlist-focused, not position-focused. market-144regime, sector-rotation-signal, macro-event-calendar (7-day window),145earnings-blackout (7-day window). The Sunday briefing that frames the146week: what's the tape, what's rotating, what prints, what macro147matters.148149**[`morning-brief`](skills/morning-brief)**15060-second daily open. market-regime, macro-event-calendar (today +151tomorrow), news-scanner (last N per watchlist ticker). Sharp152counterpart to weekly-brief: shorter horizon, news-focused. Cron153this at 8am for a briefing before you open the trading window.154155**[`preflight-trade`](skills/preflight-trade)**156Before you hit execute. Takes a ticker plus intended action (buy,157sell, add, reduce, exit). Chains technical-briefing, earnings-158blackout (14d), news-scanner (last N), corporate-actions-scanner159(90d). Returns a deterministic verdict (go, wait, review) plus red160and green flag lists. Not a recommendation to trade or not trade.161A structured "is now obviously a bad time" gate.162163**[`earnings-week-prep`](skills/earnings-week-prep)**164For weeks where four of your names print in five days. earnings-165blackout on the watchlist to find who prints, then earnings-drilldown166plus technical-briefing for the top-N imminent prints. The Sunday-167night briefing before a heavy earnings week.168169**[`historical-comparison`](skills/historical-comparison)**170Twin decision-support. event-study on the specific event plus171historical-analog-finder on the market regime. Both anchors together172so you're not relying on one. Analog-only mode for when you don't173have a specific event to study.174175**[`scan-and-frame`](skills/scan-and-frame)**176Regime-framed idea generation. market-regime for context, universe-177builder for candidates, relative-strength to rank the top N. Optional178factor-research pass for factor context (heavy — off by default).179Discovery-mode, not position-mode.180181**[`stock-one-pager`](skills/stock-one-pager)**182Retail-tier single-name card. technical-briefing plus earnings-183blackout plus market-regime, translated into plain language. The184thing to read before you buy something you saw on social. Every185claim is gated to what the data actually says; nothing is templated.186187## Use cases, mapped to workflows188189Concrete situations, mapped to the workflow that solves them.190191| Situation | Workflow | Approx runtime |192|---|---|---|193| "It's Sunday evening. What's the setup for the week?" | [`weekly-brief`](skills/weekly-brief) | ~30s |194| "It's 8am. What's the tape doing and what happened overnight?" | [`morning-brief`](skills/morning-brief) | ~15s |195| "I want to review my whole book, deep." | [`portfolio-review`](skills/portfolio-review) | ~90s |196| "I'm about to buy X. Is now obviously a bad time?" | [`preflight-trade`](skills/preflight-trade) | ~30s |197| "Four of my names print earnings this week. Prep them." | [`earnings-week-prep`](skills/earnings-week-prep) | ~2 min |198| "I have a directional view on X. How do I express it with options?" | [`options-structure-analyzer`](skills/options-structure-analyzer) | ~15s |199| "What usually happens after market setups like this?" | [`historical-comparison`](skills/historical-comparison) | ~20s |200| "What sectors are actually rotating right now?" | [`sector-rotation-signal`](skills/sector-rotation-signal) | ~10s |201| "My friend asked about a stock. Give me the plain-language read." | [`stock-one-pager`](skills/stock-one-pager) | ~10s |202| "Screen for candidates in this regime." | [`scan-and-frame`](skills/scan-and-frame) | ~30s (or ~90s with the factor pass) |203204For the 42 individual primitives (compose your own workflow), scroll down.205206## The 42 building-block tools, with real use cases207208The workflows above are chains of these. If you're building your209own workflow or agent, this is the shelf of primitives to compose210from. Each is a standalone `run() -> dict` with a rendered layer211for humans and a JSON layer for downstream code.212213### Earnings work214215**[`earnings-drilldown`](skills/earnings-drilldown)**216You're long NVDA into Thursday's print. Trim, hold, or fade the217straddle? Run the tool. You get the implied move vs the 8-quarter218realized average, the post-earnings drift t-stat conditional on the219reaction direction, and which semis trade with NVDA on print days.220Output reads like a sell-side morning note: bold take at the top,221supporting numbers below.222223**[`event-study`](skills/event-study)**224You want to measure abnormal returns around any event class:225earnings, dividend changes, large volume spikes. Single event for226one ticker (gets you a note), the same event across many tickers227(cross-section table), or all events in a window (aggregate stats228with t-stats). Last month's run on mega-cap tech Q1 prints surfaced229that the cross-section average is negative despite all five beating230on EPS. Guidance is dominating headlines this regime.231232**[`earnings-blackout`](skills/earnings-blackout)**233You're running a watchlist and want a 30-second pre-trade hygiene234check: which names print this week, which printed yesterday, which235are clear. Run the tool. It returns each ticker bucketed into236blackout-imminent (0-3 days forward), blackout-soon (4-7),237just-printed (0-3 past), or clear, with the date, consensus EPS238where Benzinga is wired, and the 8-K item code where it falls back239to SEC EDGAR. Exception-report style: imminent blackouts on top,240clear names at the bottom.241242### Equity research and valuation243244**[`pitch-comps`](skills/pitch-comps)**245You're a junior banker or an equity research analyst building a CRM246comp set. You need the software peer group with multiples, growth,247EBITDA margin, plus a regression-adjusted view that controls for the248growth differential. Run it, get a table you can drop straight into249the deck or the model. The one-sentence read at the bottom is the250take the MD or PM wants on page two.251252**[`valuation-sanity-check`](skills/valuation-sanity-check)**253The analyst on your team has a $250 NVDA target with assumed 28%254growth and 60% margin. Does it survive a peer-distribution sanity255check? The tool runs the reverse-DCF at the current price and tells256you what CAGR is actually priced in. When I ran it, the $250 target257came back understated against the semi peer set, which was the258opposite of what I expected. Pass `--mc` for the Monte Carlo259fan-of-outcomes mode: 10,000 samples across the peer growth × margin260× exit-multiple distribution, with the current price's percentile261within the resulting fair-value distribution and a per-driver262sensitivity ranking. More honest than a single point estimate.263264**[`position-sizer`](skills/position-sizer)**265You like the names — NVDA, AMZN, GOOGL, META all going in. How much266of each? Run the tool and get four canonical sizing methods side by267side: vol-target, fractional Kelly, risk parity, equal weight. The268methods usually disagree; that's the point. Vol-target cuts the269high-vol names so they don't dominate. Kelly tilts toward names with270the highest edge per variance (you supply the edges). Risk parity271equalizes each name's contribution to portfolio variance. Pick the272column whose worldview matches your conviction.273274### Quant research and screening275276**[`technical-briefing`](skills/technical-briefing)**277You're staring at a single name and want the technical read before278you do anything else. Run the tool on NVDA. You get the composite279trend regime (bullish / bearish / neutral, strong or weak, with the280reasons that drove the label), RSI 14 with bucketed momentum read,281MACD line vs signal with cross status, SMAs 20 / 50 / 200, Bollinger282position, ATR as a percent of price, and the ADV-bucketed liquidity283context. Output is a sell-side morning-note block; the Take is284computed from the actual readings, not a hardcoded narrative.285286**[`universe-builder`](skills/universe-builder)**287You want every US common stock above $20 with quarterly +10% momentum288that pulled back this week. Run the screen. The tool walks the full28912,000-name universe, applies your filter chain, ranks the survivors290by composite z-score, and flags sector concentration. Last week's run291surfaced a trucking cluster (ARCB, RXO, SNDR, TFII, WERN, SAIA) all292off the same macro freight pullback. Real mean-reversion candidates.293294**[`factor-research`](skills/factor-research)**295You want to know what factor is working in the current regime. Run296the tool on the S&P 500 over a 5-year window. You get the per-factor297IC at 1M/3M/6M/12M horizons, t-stats, decile long-short spreads, hit298rates, and the cross-factor correlation matrix. Quality at +3.1299t-stat is the only single factor with statistical significance right300now. Low-vol is negative across every horizon (recent regime rewards301risk-taking).302303**[`relative-strength`](skills/relative-strength)**304You have a basket of names and want to know which are leading and305which are bleeding vs SPY (or any benchmark) across 5 / 20 / 60 /306120-day windows. Run the tool. Each name gets RS in basis points per307window, a composite percentile rank within the basket, and a trend308label (stable_leader, improving, deteriorating, stable_laggard,309mixed). Pass --include-sectors to add the 11 SPDR sector ETFs into310the ranking and see whether NVDA's strength is the name or just XLK.311312**[`pairs-scanner`](skills/pairs-scanner)**313You have a sector basket and want to know which two names are314statistically tethered right now. Run the tool. Every pair gets an315Engle-Granger cointegration test on log prices, the ADF t-stat316bucketed against MacKinnon 2010 critical values, an317Ornstein-Uhlenbeck half-life of the spread, the current z-score, and318a 70/30 out-of-sample stability check that flags regime shifts.319Tradeable pairs surface at the top (widest spreads first); the320considered-but-rejected list shows why the others didn't make it.321Screen, not strategy.322323**[`hurst-exponent`](skills/hurst-exponent)**324Companion to pairs-scanner but single-name. Runs rescaled-range325(R/S) analysis on 2 years of daily log returns and reports the Hurst326exponent with a bootstrap confidence band. Classifies the name as327mean-reverting (H < 0.45), random walk (H in [0.45, 0.55]), or328trending (H > 0.55). Answers "is this name a mean-reversion setup or329a momentum setup?" Utilities and staples cluster on the low side,330growth names in strong runs on the high side.331332**[`change-point-detector`](skills/change-point-detector)**333Bayesian Online Change-Point Detection (Adams & MacKay 2007) on a334ticker's daily log returns. Detects the specific dates where the335return-generating distribution shifted (regime change in mean, vol,336or both), reports posterior confidence at each boundary, and emits337per-segment annualized return + vol so you can see what changed.338Live on ALLO: the 2026-04-14 detection lands on the exact date of339the ALPHA3 trial futility announcement, confidence 0.9965. Not for340real-time entries (BOCPD lags real change points by 5-20341observations); use for post-hoc regime labeling and to audit342whether a pair's cointegration or a factor's edge broke partway343through the lookback.344345**[`signal-decay`](skills/signal-decay)**346Estimate the half-life of a candidate signal. Runs rolling 63-day IC347vs 5-day forward returns over a 5-year window, fits an exponential348decay to the IC series, and reports the half-life in trading days349plus a full performance tearsheet (deflated Sharpe, Sortino, Calmar,350ulcer, tail ratio, hit rate) on the signed-signal PnL. Motivated by3512024-25 factor decay research (Israel-Moskowitz-Ross,352Falck-Rej-Thesmar 2024, Chen-Zimmermann factor zoo). Live on SPY353mean-reversion: mean IC went from +0.06 early quarter to -0.16354recent quarter — the classic short-horizon mean-reversion effect355has completely flipped sign this cycle.356357**[`rough-vol-forecast`](skills/rough-vol-forecast)**358Rough-volatility-scaled vol forecast (Bayer-Friz-Gatheral 2016)359across multiple horizons. Under rough vol, realized vol scales as360h^H with H ~ 0.14 (Livieri et al. 2018 empirical) — much slower361than sqrt(t). Reports the rough-vol forecast alongside traditional362Brownian scaling and EWMA so you see the divergence directly. On363SPY: 120-day vol drops from 11.66% (traditional) to 2.08% (rough) —364a 5x reduction that changes how you size long-horizon scenarios.365366### Market context367368**[`prediction-market-monitor`](skills/prediction-market-monitor)**369Kalshi prediction market monitor for Fed decisions, CPI, GDP, NFP,370and other macro / market events. Motivated by 2025-26 post-election371growth of prediction markets as leading indicators. Reports the372implied probability at each strike, derives the cross-strike373probability distribution when the event is a laddered strike-type374(like KXFED-27APR-T4.25, T4.00, T3.75...), and computes the modal375outcome and expected value. Live on Kalshi Fed decisions: October3762027 shows 63.5% probability of a 25bp hike; December 2027 shows a377split market (37.5% hike vs 49% cut). Uses Kalshi's public378read-only API; no Massive key required.379380**[`market-regime`](skills/market-regime)**381Daily macro briefing before you do anything else. SPY trend (above382or below 20/50/200-day MAs, 5 buckets from uptrend_strong to383downtrend_strong), VIX state with percentile rank vs trailing year,384breadth proxy from the 11 sector ETFs (how many above 50-day MA),385and 20-day RS leaders/laggards across sectors. Composite regime386label (risk_on, risk_off, mixed_risk_on, mixed_risk_off, neutral)387ships with explicit reasons so you see the evidence, not just the388label. Run it at the open; it's the right anchor for everything389else.390391**[`sector-rotation-signal`](skills/sector-rotation-signal)**392`market-regime` reports current sector leadership as a snapshot.393This one tells you how the leadership order has changed. Tracks 20-394day RS rank for the 11 SPDR sector ETFs across a rotation window395(default 30 days) and flags sectors that moved two or more positions396up or down. Categorizes moves into growth / value-cyclical /397defensive / rate-sensitive buckets and generates a plain-English398theme read. Last week's run flagged risk-off: XLU up seven ranks and399XLK down nine, defensives taking share from growth. Rank change is400the leading signal; absolute standings are already priced.401402**[`macro-event-calendar`](skills/macro-event-calendar)**403Sibling to `earnings-blackout`. Forward calendar of the macro404releases that reprice the whole book: FOMC decisions, CPI, PPI, NFP,405ISM manufacturing and services, GDP, PCE, JOLTS, jobless claims,406retail sales. Every event ships with its expected release date, ET407release time, historical mean absolute one-day SPY move on that408release type, and impact tier. Crowded days (two-plus events on the409same date) get their own callout. FOMC dates are hardcoded from the410official schedule; recurring events are pattern-derived and flagged411as such so you can verify against the official calendar before412sizing around a print.413414**[`historical-analog-finder`](skills/historical-analog-finder)**415`market-regime` tells you today's state. This one takes that state416and finds K historical periods with the most similar setup, then417reports the forward SPY return distribution across those analogs.418Features are SPY-only (5/20/60/120-day return, above 50 and 200-day,419RSI 14, realized vol, drawdown from 252-day high) with z-scored420Euclidean distance. Deduplicates overlapping matches so one421historical window can't dominate the K. The mean is not a forecast;422the interquartile range is the honest read. Last run: 20 nearest423analogs to the current tape gave a 75% hit-rate above zero at 60 and424252 days, median +14.3% at 252d, with mid-2024 and late-2021 pulling425opposite directions in the K set.426427### Trading and execution428429**[`options-flow`](skills/options-flow)**430You're scanning a watchlist for unusual options activity. Premium431size, volume vs open interest, above-ask vs below-bid, repeat-strike432clustering. Output is a tight stream of the top 10-20 prints with a433sentiment tag per block. Yesterday's run surfaced a TSLA bullish read434where someone sold $400 puts on the bid AND bought $385 calls above435the ask. Two trades, same direction.436437**[`zero-dte-gamma`](skills/zero-dte-gamma)**438Estimate net dealer gamma exposure (GEX) for same-day-expiry SPY /439SPX / QQQ / IWM options and identify gamma pins. Motivated by4402024-25 research (Baltussen-Terhorst-Van Vliet 2024, Bhattacharya4412024) documenting that 0DTE options now drive systematic intraday442moves through market-maker delta hedging pressure. Reports net443dealer gamma, gamma regime (long/short), gamma flip strike, and top4445 pins with per-side call and put notional. Live on SPY 2026-07-13445expiry: $754.95 spot, dealers net short $1.25B gamma at the top446pins concentrated at $759 call strikes (9,412 OI) — expect447intraday moves to accelerate rather than mean-revert.448449**[`news-scanner`](skills/news-scanner)**450You want today's notable news cross-referenced against the price451reaction and sentiment. Each event ships with sentiment score,452novelty score (is this a re-run or a new angle), and a price-vs-453sentiment divergence flag. A "positive" article that the stock sold454off on means the market already knew; that's a flag worth surfacing.455456**[`slippage-cost`](skills/slippage-cost)**457You hand the tool yesterday's executed fills. It pulls the microsecond458NBBO at each trade time, computes slippage vs the inside, and flags459fills that crossed the spread, printed off-NBBO, hit a wide spread460moment, or showed adverse selection in the 30 seconds after fill.461Measures fill vs NBBO at fill time, not arrival-price Implementation462Shortfall. The exception report is short by design: only the broken463stuff surfaces.464465**[`options-structure-analyzer`](skills/options-structure-analyzer)**466You have a view but no structure yet. Tell the tool your thesis467(direction bullish, direction bearish, vol long, vol short, or468hedge), your horizon, and your target move. It enumerates the469candidate options structures (long call or put, bull or bear spread,470straddle, strangle, iron condor, protective put, collar), pulls the471nearest expiry with priceable legs on both sides, computes each472structure's payoff at your target, and ranks by payoff-to-capital.473Not a recommendation. A structured comparison so you can pick the474structure whose tradeoffs match your view, not just the one your475platform happened to surface. On hedges, it reports the P&L improvement476vs unhedged rather than a meaningless "percent of net premium" ratio.477478### Risk and operations479480**[`portfolio-mark`](skills/portfolio-mark)**481You need end-of-day marks for a position book. Run the tool. It pulls482the snapshot per name, walks the fallback chain (last trade → snapshot483last → minute close → day close → prior close), reports per-position484confidence (high/medium/low), and flags any name where the mark looks485stale or the spread is wide enough to need a manual check. Two modes:486delayed REST for end-of-day reports, live WebSocket for intraday.487488**[`risk-report`](skills/risk-report)**489The book is already marked. Now what could happen to it? Run the tool490and get VaR + Expected Shortfall at 95/99, max drawdown over the491lookback window with peak/trough dates, the five worst historical492days with per-name loss attribution, every position's share of the493variance budget, and a Herfindahl-based concentration read. Pairs494with `portfolio-mark`: marks tell you what the book is worth right495now; this skill tells you what could happen to that value. Pass496`--mc` for path-VaR: 10,000 correlated return paths simulated from497the fitted covariance matrix, with normal or student-t innovations498for fatter tails, over a configurable horizon. Emits cumulative499return percentiles, path max-drawdown distribution, and P(loss > X%)500at 5/10/20% thresholds.501502**[`mc-portfolio-simulator`](skills/mc-portfolio-simulator)**503Standalone Monte Carlo forward P&L simulator. Give it a book and a504horizon; get back the distribution of outcomes, tail scenarios, path505max-drawdown, and probability of loss / gain at 5/10/20/30%506thresholds. Uses the same covariance-matrix pipeline as507`position-sizer` and `risk-report --mc`, so results are directly508comparable across the three tools. Answers "given my proposed509weights, what's the 5th percentile 60-day portfolio outcome?"510511**[`portfolio-rebalancer`](skills/portfolio-rebalancer)**512`risk-report` tells you which name is driving the risk. This skill513tells you what to do about it. Feed it the same weights + book514value; set a variance-share cap, weight cap, and churn cap; it515returns a specific rebalance ticket list: which names to trim, which516to add, exact dollar amounts, before-and-after weight, before-and-517after variance share. Iterative solver with a proportional518redistribution rule so one name's trim doesn't over-concentrate the519next name. Refuses to churn more than the preset per rebalance so a520single call cannot blow up a portfolio. Not tax-aware, not521liquidity-aware, honest about both in the caveats. Turns "ALLO522carries 66 percent of variance" into "sell $66k of ALLO, redistribute,523portfolio vol drops from 21 to 15 percent."524525**[`corporate-actions-scanner`](skills/corporate-actions-scanner)**526Different job from `corp-actions-reconciler`. The reconciler checks527whether your position file has the correct post-split share count.528This one scans forward-looking: for a ticker or watchlist, it pulls529SEC 8-K filings over a lookback window (default 180 days), filters530to material items (offerings, private placements, splits, spin-offs,531buybacks, M&A, restatements), cross-references Massive news for the532headline, and computes the T+1 and T+5 price reactions. Built after533a portfolio review missed an ALLO public offering (87.5 million534shares at $2, 34 percent dilution) because news-scanner defaulted to535a 24-hour window. The offering was 78 days old and dominating the536current price, and no dedicated tool surfaced it.537538**[`corp-actions-reconciler`](skills/corp-actions-reconciler)**539An ops desk inherits a position file from 2024. Did the share counts540get adjusted for AAPL's 4-for-1 split? GOOGL's 20-for-1? NVDA's 10-541for-1? Run the tool. The exception report lists every position whose542recorded share count doesn't match the expected post-split share count,543with the source endpoint and verified-at timestamp on every flag.544545**[`t+1-settlement-prep`](skills/t+1-settlement-prep)**546You're an ops manager looking at tonight's trades. Which ones have547settlement risk crossing this weekend? Which ones need a short-sale548locate confirmed before tomorrow's cutoff? Which ones cross an ex-549dividend date? The tool walks each trade against the US holiday and550corporate-action calendar and flags six failure modes, with a551suggested next action per flag.552553### Filings and ownership554555**[`8-k-scanner`](skills/8-k-scanner)**556You have a watchlist. What material events hit those names this week?557Run the tool. It pulls every 8-K disclosure across the basket, groups558the tagged Items by filing, ranks by signal bucket (M&A / Strategic559above Restatement above Material agreement above Regulatory above560Leadership change above Capital above Earnings above Corporate561housekeeping), and puts the highest-signal filings at the top with562the supporting text quoted. Last live run caught RKLB's Iridium563merger agreement, NVDA's Ajay Puri retirement + Nicholas Parker hire564package, MSFT's Reid Hoffman board departure, ALLO's CEO succession,565and NVDA's $11B notes issuance. One 45-day scan across 6 mega caps.566567**[`risk-factor-delta`](skills/risk-factor-delta)**568Did management add anything new to Item 1A this year? Run the tool.569It diffs the last two 10-K risk-factor disclosures using Massive's570pre-parsed three-tier taxonomy (primary/secondary/tertiary category571per risk). Reports categories added, categories dropped, and572categories where the supporting text materially changed (>= 25%573length shift). Live run on AAPL's 2024 vs 2023 10-K surfaced 13 new574risk categories concentrated in technology_and_information (AI risk,575third-party data security, tech-vendor dependence), plus new576trade/tariff and credit risk categories. Also caught 7 retained577categories where AAPL trimmed language (pricing pressure -46%,578IP -42%, ESG -39%): a defensive language shift the sentiment579scorer independently confirmed.580581**[`filing-sentiment`](skills/filing-sentiment)**582Score the Business and Risk Factors sections of a company's last two58310-Ks using the Loughran-McDonald finance dictionary. Reports rate584per 10,000 tokens by category (negative, uncertain, litigious,585constraining, modal-weak, modal-strong) prior vs current with a586shift label. Answers "did management's language get more defensive?"587Live run on AAPL showed negative language up 33% in the Business588section and modal-strong ("must", "will", "always") language down58938% in Risk Factors: management getting less assertive and more590hedged. Pair with `risk-factor-delta` for the structural view; this591handles the tone.592593**[`insider-flow`](skills/insider-flow)**594Are insiders buying or selling this name? Run the tool. It pulls595every Form 4 for the ticker over the lookback window, classifies596each transaction (conviction buy P, discretionary sale S,597scheduled 10b5-1 sale, routine comp A/M/F, non-informative),598filters 10b5-1 out of sentiment, detects cluster buys (>= 2599insiders in a 14-day window worth >= $100k), and emits a bullish/600bearish label backed by net conviction dollar flow. `--exclude-601directors` cuts out VC/PE board reps unwinding fund positions602(which structurally look bearish but carry no operator signal).603Live run on RKLB showed a $27M director sale from a VC rep that,604once excluded, still left the general counsel and president as605net sellers.606607**[`manager-portfolio-diff`](skills/manager-portfolio-diff)**608What did Buffett/Klarman/Burry do last quarter? Run the tool with609an alias (`--filer berkshire`) or a CIK. It pulls the two most610recent 13-F snapshots for the fund, aggregates by CUSIP across611joint filings, and reports initiations, exits, adds (>= 25% share612change), trims (<= -25%), and portfolio value delta. Live run on613Berkshire caught Buffett exiting Visa, Mastercard, UNH, Dominos in614Q1 2026 while adding Alphabet +204% and initiating Delta Air Lines615at $2.65B. Alias set: berkshire, baupost, renaissance, bridgewater,616third-point, pershing, tiger-global, scion, appaloosa.617618**[`guidance-tracker`](skills/guidance-tracker)**619Has management been raising or cutting guidance this cycle? Run the620tool. Uses Benzinga Corporate Guidance to compare each event's621midpoint against the prior figure for the same fiscal period,622labels as raised / lowered / reaffirmed / initiation, groups by623fiscal period, and reports trajectory. Requires the Benzinga624Corporate Guidance add-on (approx $99/month); the skill emits a625clean NOT_AUTHORIZED caveat when the entitlement is missing.626627**[`analyst-tracker`](skills/analyst-tracker)**628Track sell-side positioning on a name. Uses Benzinga analyst ratings629to pull every rating event over the lookback window, classifies each630as upgrade / downgrade / initiation / reiteration / PT-change /631drop-coverage, aggregates the latest per firm, and reports the632consensus median price target plus buy/hold/sell distribution. This633is the sell-side lens pair with `insider-flow` (internal vs external634sentiment on the same name). Live NVDA run over 180 days: 26 firms635all Buy, consensus PT $308.50, big May 21 PT-raise cluster (15+636firms) right after the Q1 print. Requires the Benzinga Analyst637Ratings add-on.638639### Backtesting and infrastructure640641**[`backtest-data-prep`](skills/backtest-data-prep)**642You're building a momentum backtest. You need a 4-year OHLCV dataset643that's properly split-adjusted, survivorship-clean, and free of644look-ahead bias. The tool emits a parquet file (1,003 trading days x64599 tickers in the standard run), a manifest documenting every646corporate action applied, and an edge-cases log noting any IPOs,647delistings, or symbol changes inside the window. Drop the parquet648into pandas and start backtesting.649650### Crypto651652**[`crypto-vol-scanner`](skills/crypto-vol-scanner)**653You watch BTC/ETH/SOL plus a handful of alts. The tool surfaces vol654spikes (vs trailing 30d distribution), volume anomalies, cross-655exchange basis (Coinbase vs Bitfinex vs Bitstamp vs Binance vs656Kraken), and 24h move z-scores. Output is a stream of the top events,657with a one-line read at the bottom on the broader regime (this week's658read: "quiet regime, BTC realized vol at 30% sitting in the 25th659percentile of trailing year, setup-watch day not entry day").660661## What to sign up for662663Use **Massive**. It's the API quant-garage is664built against and the one we recommend you run the tools on. Get a key665at [massive.com/pricing](https://massive.com/pricing).666667The free **Basic** tier (5 calls per minute, end-of-day data) runs668six of the tools end to end, including earnings previews on any US669name via the SEC EDGAR fallback. Good place to try the framework.670671Most people end up wanting **Stocks Starter at $29 per month**. That672unlocks unlimited rate, 15-minute delayed real-time quotes, options673contract reference data, and the bulk grouped-aggregates endpoint674that powers the universe screeners. Thirty-nine of the forty-two675tools run on this tier (crypto-vol-scanner, full-fidelity676options-structure-analyzer, guidance-tracker, and analyst-tracker677need separate plans; the latter two are Benzinga add-ons). Every workflow678composite runs on Starter.679680Specific tools need specific add-ons:681682- **Options data** for `options-flow`, `options-structure-analyzer`,683 and full-mode `earnings-drilldown`: Options Developer at $79/month684- **Benzinga Earnings** (consensus EPS + surprise %) for full-fidelity685 `earnings-drilldown` and `event-study`: ~$99/month add-on. Without it,686 these tools fall back to SEC EDGAR for press release dates, which we687 verified matches the Benzinga date to the day on 8 of 8 of Apple's688 last 8 prints. So the SEC fallback works, you just lose the689 consensus number.690- **Benzinga News** for `news-scanner`: ~$99/month691- **Crypto Starter** for `crypto-vol-scanner`: $29/month692- **Stocks Advanced** for live-mode `portfolio-mark` with real-time693 WebSocket: $199/month. Delayed-mode portfolio-mark runs fine on694 Starter.695696Why Massive over the alternatives: broadest US market data coverage697in one account (stocks, options, crypto, FX, indices, futures), REST698+ WebSocket + S3 flat files all included, cheap free tier so anyone699can try, and the SEC EDGAR fallback we built lets you run the earnings700tools without paying for Benzinga at all.701702The [PLAN-MATRIX.md](./PLAN-MATRIX.md) file maps every tool to the703exact plan + add-ons it needs.704705## Setup706707Get a [Massive API key](https://massive.com/pricing). Free Basic runs708eighteen tools end to end; Stocks Starter ($29/month) opens thirty-eight.709710```bash711export MASSIVE_API_KEY=your_key_here712```713714Three ways to use the tools. Same code, three surfaces.715716### 1. Python library (Jupyter, scripts, notebooks)717718The most direct way. Every skill is an importable function that returns719JSON.720721```bash722pip install quant-garage723```724725Then in a notebook or a `.py` file:726727```python728from quant_garage.skills import (729 technical_briefing, earnings_drilldown, market_regime,730 pitch_comps, valuation_sanity_check, news_scanner,731)732733# One name, one call, one dict back734brief = technical_briefing.run("NVDA")735brief["trend"]["regime"] # 'bearish_weak'736brief["momentum"]["read"] # 'weak'737brief["take"] # 'NVDA looks soft. RSI 43 weak...'738739# Compose skills — pass the same client to reuse HTTP connection740from quant_garage import MassiveClient741client = MassiveClient()742743results = {}744for ticker in ["NVDA", "AAPL", "MSFT", "GOOGL", "META"]:745 results[ticker] = technical_briefing.run(ticker, client=client)746747# Everything is just dicts, so pandas is a one-liner748import pandas as pd749df = pd.DataFrame([750 {751 "ticker": t,752 "regime": r["trend"]["regime"],753 "rsi": r["momentum"]["rsi_14"],754 "atr_pct": r["volatility"]["atr_pct_of_price"],755 "take": r["take"],756 }757 for t, r in results.items()758])759df.sort_values("rsi", ascending=False)760```761762When you want the rendered version instead of the JSON:763764```python765print(technical_briefing.render(brief))766```767768Every skill follows the same contract: `run(...) -> dict` and769`render(payload) -> str`. Nothing writes to disk unless you ask.770771**Extras.** The core install is slim. Skills that need pandas/scipy or772S3 declare their own extras:773774```bash775pip install quant-garage[research] # factor-research, backtest-data-prep776pip install quant-garage[flatfiles] # boto3 + s3fs for bulk daily aggs777pip install quant-garage[live] # websocket-client for live portfolio-mark778pip install quant-garage[all] # everything779```780781### 2. CLI (shell pipelines, cron jobs)782783Every skill also ships as a thin CLI wrapper under `examples/`. Defaults784to JSON on stdout, so you can pipe into `jq` or another tool.785786```bash787# JSON out (default)788python3 examples/run-technical-briefing.py --ticker NVDA | jq '.trend.regime'789790# Rendered analyst note791python3 examples/run-technical-briefing.py --ticker NVDA --format render792793# Universe screen (price + 3M momentum + weekly pullback)794python3 examples/run-universe-builder.py \795 --min-price 20 --min-adv 400000 --min-mom-3m 0.10 --max-week-return 0.0 \796 --format render797798# Earnings drilldown, free tier (SEC EDGAR fallback)799python3 examples/run-earnings-drilldown.py --ticker AAPL --format render800801# Options flow stream on a watchlist802python3 examples/run-options-flow.py NVDA TSLA AAPL --format render803804# Crypto vol scan805python3 examples/run-crypto-vol-scanner.py --format render806```807808Pass `--out FILE.md` on any runner to also write a markdown file with809both layers (rendered + JSON).810811### 3. Claude Code skills812813Clone into your Claude Code skills directory:814815```bash816git clone https://github.com/rgourley/quant-garage.git \817 ~/.claude/skills/quant-garage818```819820Then invoke any tool with `/<skill-name>` (for example,821`/earnings-drilldown NVDA`), or just describe what you want in plain822English and Claude will pick.823824### The typical workflow825826Massive customers we've talked to tend to move through this pattern:8278281. **Ideate in Claude.** Describe what you're trying to figure out. Get829 a rendered read from one of the skills. Iterate on the framing.8302. **Test in Jupyter.** Import the same skill as a library. Feed it more831 tickers, join to your own data, chart the result, decide whether it832 holds up.8333. **Push to prod.** The library is the production interface. Wire it834 into a cron, a Slack bot, a research dashboard, whatever. The skill's835 JSON is stable across all three surfaces.836837We built the framework this way on purpose. Nothing in the middle step838requires you to shell out to a CLI or scrape a rendered note. The same839`payload = run(...)` call that answered the ideation question is the840one your production job runs.841842## What this isn't843844Not a trading model. The "takes" are sensible pattern-matchers845grounded in methodology; they're not a strategy. n=8 quarterly t-stats846are statistically thin, and the rendered output flags this honestly.847848Not a backtest framework with PnL accounting. `backtest-data-prep`849gets you a clean dataset; you write the strategy on top.850851Not a production execution system. `portfolio-mark` reports marks;852`slippage-cost` reports fill-vs-NBBO exceptions. Neither places orders.853854Not a regulated advisor. None of the outputs are investment advice.855856857858## License859860AGPL v3. See [`LICENSE`](./LICENSE).861862Fork it, ship it, improve it. If you host it as a service or build a863product on top, your modifications must be published back.864Individual quants, researchers, and academic use are unaffected.865866For commercial licensing outside AGPL terms, contact Rob directly.867868## Contributing869870See [CONTRIBUTING.md](./CONTRIBUTING.md). Open a PR with a new tool871or an extension. Each tool needs a `SKILL.md`, a `requires.yml`, an872`output-schema.json`, a `references/` folder with the methodology,873and one working example. The audit script (`npm run audit:requires`)874enforces the shape; the methodology references are where the IP lives.875
Full transparency — inspect the skill content before installing.