Portfolio: Claude skills backed by calculation code

Portfolio drift monitoring and rebalancing, parametric VaR and expected shortfall, tax-loss harvesting screens with a wash-sale look-back, cost basis by lot, time- and money-weighted returns, Sharpe ratio reliability, and small-universe historical and forward simulations - plus guidance for accounting, attribution and risk-model workflows that the engines do not implement.

What wealth-portfolio calculates

11 commands, each available in the CLI, as an MCP tool and as a JavaScript import. Every result carries the method it used, the questions it still needs answered and the next steps worth taking.

CommandWhat it returnsWhat it needs
portfolio drift-monitorAllocation drift against targets, with the trades that would correct it.current, target, value
portfolio rebalanceTrades that move a portfolio from its current allocation to target.current, target, value
portfolio varParametric Value at Risk and expected shortfall.value, vol
portfolio factorsAsset-class mix, with factor and duration averages of values you supply.holdings
portfolio tlhTax-loss harvesting screen with a wash-sale look-back and replacement candidates.lots
quant backtestHistorical backtest over embedded annual returns for VTI, BND, VXUS and VNQ.weights
quant forward-testMonte Carlo projection of a weighted portfolio under a macro regime.weights
portfolio cost-basisCost basis and holding period for a sale, by FIFO, specific identification or average cost.lots, sale
portfolio twrTime-weighted return, which removes the effect of contributions and withdrawals.valuations
portfolio irrMoney-weighted return (XIRR) from dated contributions, distributions and ending value.cashFlows
quant sharpe-statsHow far a Sharpe ratio can be trusted: standard error, and probabilistic and deflated Sharpe ratios.returns

When to use it

Requests this pack answers:

What it does not do

Named here because leaving it out is how an agent ends up asserting something the code never computed.

Guidance only, no engine behind it

Limits to state with every result

Run it

node bin/wealth-skills.js portfolio drift-monitor --current '{"equity":68,"fixedIncome":32}' --target '{"equity":60,"fixedIncome":40}' --value 1000000 --band 5
node bin/wealth-skills.js portfolio var --value 1000000 --vol 0.14 --confidence 0.99
node bin/wealth-skills.js portfolio tlh --lots '[{"id":"L1","symbol":"VOO","quantity":100,"purchasePrice":500,"currentPrice":420,"purchaseDate":"2025-02-03"}]'
node bin/wealth-skills.js quant backtest --weights '{"VTI":0.6,"BND":0.4}' --initial 100000
node bin/wealth-skills.js quant forward-test --weights '{"VTI":0.6,"BND":0.4}' --regime stagflation

The same commands are exposed as MCP tools, so Claude, Claude Code, Codex, Cursor and any other MCP client can call them directly. See the integration guide and the pack itself, skills/wealth-portfolio/SKILL.md.

Catalog coverage

91 resources from the US Wealth Management Capability Catalog map to this pack, 22 of them backed by engine code and the rest cited as guidance or reference.

ResourceWhat the pack does with itCoverage
The Statistics of Sharpe Ratios (Lo, 2002)Uncertainty in risk-adjusted performance Standard error of the Sharpe ratio under independent returns.engine
The Deflated Sharpe Ratio (Bailey and Lopez de Prado, 2014)Adjust for selection bias and non-normal returns Deflated Sharpe ratio for selection across trials.engine
IRC 1012 Basis of propertyCost-basis statutory foundation Cost basis by lot.engine
IRS Publication 551Asset-basis guidance Purchase-price basis by lot; no gifted, inherited or adjusted basis.partial-engine
IRS Form 1099-B instructionsBroker transaction and basis reporting Lot basis and holding period; no 1099-B reconciliation.partial-engine
IRC 1091 Wash salesLoss disallowance on specified replacement transactions Wash-sale look-back across supplied lots only.partial-engine
Global Investment Performance StandardsInvestment-performance presentation standards Time-weighted return; no composite construction.partial-engine
AddeparInvestment data aggregation and portfolio reporting Performance from supplied valuations; no data aggregation.partial-engine
Orion Advisor TechnologyPortfolio accounting, reporting and advisor operations Lot basis and time-weighted return; not a book of record.partial-engine
SS&C Black DiamondWealth portfolio reporting and client experience Performance calculation only; no reporting portal.partial-engine
SS&C Advent APXPortfolio accounting and investment reporting Cost basis by lot; not portfolio accounting.partial-engine
Envestnet wealth platformManaged-account and advisor investment workflows Drift and rebalance trades; no managed-account platform.partial-engine
Morningstar OfficeAdvisor portfolio management and reporting Drift monitoring and performance; no portfolio management platform.partial-engine
MSCI BarraOneMulti-asset portfolio risk analysis Parametric VaR and expected shortfall; no multi-factor risk model.partial-engine
MSCI Barra Portfolio ManagerPortfolio construction and factor-risk analysis Asset-class mix and averages of supplied factor scores; no factor model.partial-engine
Bloomberg PORTPortfolio performance, risk and attribution Return, risk and Sharpe reliability; no attribution.partial-engine
FactSet Portfolio AnalyticsPortfolio analytics and performance attribution Time-weighted return only; no attribution.partial-engine
Aladdin WealthWealth portfolio risk and advisor analytics Parametric risk and regime simulation.partial-engine
NitrogenRisk alignment and proposal analytics Risk-tolerance fit and proposal backtests; no risk questionnaire scoring.partial-engine
55ipTax-aware investment management and transitions Lot-level tax awareness for transitions; no tax-aware optimizer.partial-engine
KwantiPortfolio comparison and investment analytics Backtest comparison over four ETFs; no fund database.partial-engine
PonteraAdvisor management of held-away retirement accounts Drift on supplied held-away allocations; no account access.partial-engine
BNY Pershing WoveConnected wealth-management workflows Connected workflow guidance only.guidance
InvestCloudDigital wealth experiences and investment workflows Client digital experience is out of scope.guidance
SimCorp Axioma portfolio optimizationConstrained portfolio optimization and risk analytics No optimizer; G001-G007 are open-source options.guidance
BCBS 239Risk-data aggregation and reporting principles Risk-data principles; guidance only.standard-reference
PyPortfolioOptEfficient-frontier, Black-Litterman and hierarchical allocation Optional optimization library; the packs do not optimize.integration-reference
Riskfolio-LibPortfolio optimization across risk measures Optional optimization library; the packs do not optimize.integration-reference
cvxportfolioConvex portfolio optimization with trading costs Optional optimization library; the packs do not optimize.integration-reference
skfolioPortfolio optimization with estimator-style workflows Optional optimization library; the packs do not optimize.integration-reference
CVXPYConvex modeling for custom allocation constraints Optional optimization library; the packs do not optimize.integration-reference
PortfolioAnalyticsR portfolio optimization and constraint modeling Optional optimization library; the packs do not optimize.integration-reference
RiskPortfoliosRisk-based portfolio allocation in R Optional optimization library; the packs do not optimize.integration-reference
GS QuantQuantitative finance analytics and data clients Optional quantitative or risk analytics library.integration-reference
DeepDowDeep-learning portfolio allocation Deep-learning allocation research code.integration-reference
TensorFlow Quant FinanceTensorFlow numerical-finance library Optional quantitative or risk analytics library.integration-reference
OpenGamma StrataMarket-risk and derivatives analytics Optional quantitative or risk analytics library.integration-reference
Open Source Risk EnginePortfolio risk and valuation infrastructure Optional quantitative or risk analytics library.integration-reference
finmath-libMathematical finance and simulation Optional quantitative or risk analytics library.integration-reference
rateslibFixed-income curves and instrument analytics Fixed-income curves; duration here comes from supplied values.integration-reference
FinancePyInstrument pricing and financial analytics Optional quantitative or risk analytics library.integration-reference
bond_pricingBond prices, yields and duration Bond duration source for the durationYears input.integration-reference
LEANEvent-driven research, backtesting and trading Backtesting beyond the four embedded ETFs.integration-reference
NautilusTraderTrading-system simulation and live adapters Backtesting beyond the four embedded ETFs.integration-reference
BacktraderPython strategy backtesting Backtesting beyond the four embedded ETFs.integration-reference
Zipline ReloadedEvent-driven strategy backtesting Backtesting beyond the four embedded ETFs.integration-reference
vectorbtVectorized strategy exploration Backtesting beyond the four embedded ETFs.integration-reference
backtesting.pyStrategy simulation and parameter exploration Backtesting beyond the four embedded ETFs.integration-reference
btPortfolio-oriented backtesting Backtesting beyond the four embedded ETFs.integration-reference
QSTraderSystematic portfolio backtesting Backtesting beyond the four embedded ETFs.integration-reference
LumibotStrategy backtesting and broker execution Backtesting beyond the four embedded ETFs.integration-reference
RQAlphaExtensible backtesting engine; adapt market conventions Backtesting beyond the four embedded ETFs.integration-reference
AlphalensPredictive-factor performance analysis Factor performance analysis.integration-reference
PerformanceAnalyticsR performance and risk analysis Performance and risk statistics.integration-reference
quantstatsStrategy-performance statistics and reports Performance and risk statistics.integration-reference
empyrical-reloadedCommon portfolio risk and return metrics Performance and risk statistics.integration-reference
pyfolio-reloadedPortfolio performance tear sheets Performance and risk statistics.integration-reference
ffnFinancial performance and portfolio statistics Performance and risk statistics.integration-reference
archVolatility modeling and financial econometrics Volatility modelling for the VaR volatility input.integration-reference
Portfolio PerformancePersonal portfolio performance measurement Personal performance tracking.integration-reference
GhostfolioPersonal investment tracking and analysis Personal investment tracking.integration-reference
Portfolio Selection (Markowitz, 1952)Mean-variance diversification foundation Portfolio variance as weights-covariance-weights, used by the forward simulation.research-reference
Capital Asset Prices (Sharpe, 1964)Equilibrium risk and expected returns Portfolio construction research; no optimizer.research-reference
Liquidity Preference as Behavior Towards Risk (Tobin, 1958)Risky allocation and cash separation Portfolio construction research; no optimizer.research-reference
Lifetime Portfolio Selection under Uncertainty (Merton, 1969)Dynamic consumption and portfolio choice Portfolio construction research; no optimizer.research-reference
Optimum Consumption and Portfolio Rules (Merton, 1971)Continuous-time lifetime allocation Portfolio construction research; no optimizer.research-reference
Global Portfolio Optimization (Black and Litterman, 1992)Combine equilibrium returns and investor views Portfolio construction research; no optimizer.research-reference
Optimal Versus Naive Diversification (DeMiguel et al., 2009)Evaluate estimation error against equal weighting Portfolio construction research; no optimizer.research-reference
Risk Reduction in Large Portfolios (Jagannathan and Ma, 2003)Understand constraint-driven risk reduction Portfolio construction research; no optimizer.research-reference
A Well-Conditioned Estimator for Large-Dimensional Covariance Matrices (Ledoit and Wolf, 2004)Covariance shrinkage for portfolio risk Portfolio construction research; no optimizer.research-reference
Building Diversified Portfolios that Outperform Out of Sample (Lopez de Prado, 2016)Hierarchical portfolio construction research Portfolio construction research; no optimizer.research-reference
Common Risk Factors in the Returns on Stocks and Bonds (Fama and French, 1993)Equity and bond factor modeling Factor model research; exposures here come from supplied scores.research-reference
A Five-Factor Asset Pricing Model (Fama and French, 2015)Profitability and investment factors Factor model research; exposures here come from supplied scores.research-reference
On Persistence in Mutual Fund Performance (Carhart, 1997)Performance persistence and factor adjustment Factor and anomaly research.research-reference
Returns to Buying Winners and Selling Losers (Jegadeesh and Titman, 1993)Cross-sectional momentum evidence Factor and anomaly research.research-reference
The Other Side of Value (Novy-Marx, 2013)Profitability and stock returns Factor and anomaly research.research-reference
Value and Momentum Everywhere (Asness et al., 2013)Cross-asset value and momentum research Factor and anomaly research.research-reference
Betting Against Beta (Frazzini and Pedersen, 2014)Leverage constraints and low-beta investing Factor and anomaly research.research-reference
Time Series Momentum (Moskowitz et al., 2012)Trend-following evidence across assets Factor and anomaly research.research-reference
Digesting Anomalies (Hou et al., 2015)Investment-based factor explanation Factor and anomaly research.research-reference
... and the Cross-Section of Expected Returns (Harvey et al., 2016)Multiple-testing concerns in factor discovery Factor and anomaly research.research-reference
Coherent Measures of Risk (Artzner et al., 1999)Axioms for portfolio risk measures Expected shortfall is a coherent risk measure; VaR is not.research-reference
Optimization of Conditional Value-at-Risk (Rockafellar and Uryasev, 2000)Tail-risk optimization CVaR is computed, not optimized.research-reference
Autoregressive Conditional Heteroscedasticity (Engle, 1982)Time-varying conditional volatility Conditional volatility models; VaR here takes a supplied volatility.research-reference
Generalized Autoregressive Conditional Heteroskedasticity (Bollerslev, 1986)GARCH volatility dynamics Conditional volatility models; VaR here takes a supplied volatility.research-reference
Tax-Aware Portfolio Construction via Convex OptimizationOptimization with tax-sensitive trade decisions Tax-aware optimization; harvesting here is rule-based.research-reference
Multi-Period Trading via Convex OptimizationReceding-horizon portfolio construction Multi-period optimization with trading costs; no optimizer.research-reference
Portfolio Optimization with Linear and Fixed Transaction CostsRebalancing with realistic trading constraints Multi-period optimization with trading costs; no optimizer.research-reference
A Reality Check for Data Snooping (White, 2000)Correct for strategy selection bias Data-snooping and overfitting tests; not implemented.research-reference
A Test for Superior Predictive Ability (Hansen, 2005)Compare forecasting models under selection Data-snooping and overfitting tests; not implemented.research-reference
The Probability of Backtest Overfitting (Bailey et al., 2017)Assess overfitting from strategy searches Data-snooping and overfitting tests; not implemented.research-reference

Questions it answers

Is the portfolio off target?

Allocation drift against targets, with the trades that would correct it. Run portfolio drift-monitor in the CLI, or call the same tool over MCP. It needs current, target and value. Drift is measured against the targets sleeve by sleeve. The result carries the method it used, the data it used, anything still missing and the next steps worth taking, for a licensed professional to review.

What trades bring this back to target?

Trades that move a portfolio from its current allocation to target. Run portfolio rebalance in the CLI, or call the same tool over MCP. It needs current, target and value. Trades are the difference from target. The result carries the method it used, the data it used, anything still missing and the next steps worth taking, for a licensed professional to review.

How much could this portfolio lose?

Parametric Value at Risk and expected shortfall. Run portfolio var in the CLI, or call the same tool over MCP. It needs value and vol. Risk is reported in dollars against it. The result carries the method it used, the data it used, anything still missing and the next steps worth taking, for a licensed professional to review.

What is this portfolio made of?

Asset-class mix, with factor and duration averages of values you supply. Run portfolio factors in the CLI, or call the same tool over MCP. It needs holdings. Every figure is a weighted average across them. The result carries the method it used, the data it used, anything still missing and the next steps worth taking, for a licensed professional to review.

Any losses to harvest?

Tax-loss harvesting screen with a wash-sale look-back and replacement candidates. Run portfolio tlh in the CLI, or call the same tool over MCP. It needs lots. Losses and the wash-sale window are computed per lot. The result carries the method it used, the data it used, anything still missing and the next steps worth taking, for a licensed professional to review.

How would this mix have done?

Historical backtest over embedded annual returns for VTI, BND, VXUS and VNQ. Run quant backtest in the CLI, or call the same tool over MCP. It needs weights. Only those four have embedded return data. The result carries the method it used, the data it used, anything still missing and the next steps worth taking, for a licensed professional to review.

The other skill packs