Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Portfolio optimization library: mean-variance, Black-Litterman, CVaR optimization, risk parity, Hierarchical Risk Parity (HRP), and CLA. Factor models, shrinkage estimators, and ex-ante risk analysis.
.claude/skills/mkurman-pyportfolioopt/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -9% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-18 | ✗→✓ | ▲ Improved | -40% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 7% | 0% |
| case-03 | ✓→✓ | = Same ✓ | -45% | 0% |
PyPortfolioOpt implements mean-variance optimization, Black-Litterman, CVaR optimization, risk parity, Hierarchical Risk Parity (HRP), and CLA. Handles asset allocation with factor models and ex-ante risk decomposition.
bashuv pip install PyPortfolioOpt
pythonimport yfinance as yf from pypfopt import EfficientFrontier, risk_models, expected_returns prices = yf.download(["AAPL", "MSFT", "GOOGL"], start="2022-01-01")["Close"] mu = expected_returns.mean_historical_return(prices) S = risk_models.sample_cov(prices) ef = EfficientFrontier(mu, S) weights = ef.max_sharpe() print(ef.clean_weights()) perf = ef.portfolio_performance() print(f"Return: {perf[0]:.2%}, Vol: {perf[1]:.2%}, Sharpe: {perf[2]:.2f}")
pythonfrom pypfopt import HRPOpt returns = prices.pct_change().dropna() hrp = HRPOpt(returns) weights = hrp.optimize()
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 13,664 | 10,366 | -24% | 1 | 1 | 0% | 2,751 | 2,494 | -9% | 0 | 0 | — |
case-02 | fail→fail | 10,163 | 7,074 | -30% | 1 | 1 | 0% | 2,039 | 1,745 | -14% | 0 | 0 | — |
case-03 | pass→pass | 7,387 | 2,345 | -68% | 1 | 1 | 0% | 1,230 | 681 | -45% | 0 | 0 | — |
case-04 | pass→pass | 14,167 | 11,267 | -20% | 1 | 1 | 0% | 2,740 | 2,511 | -8% | 0 | 0 | — |
case-05 | pass→pass | 3,729 | 3,459 | -7% | 1 | 1 | 0% | 693 | 921 | +33% | 0 | 0 | — |
case-06 | pass→pass | 6,816 | 4,678 | -31% | 1 | 1 | 0% | 1,295 | 1,248 | -4% | 0 | 0 | — |
case-07 | pass→pass | 9,300 | 6,944 | -25% | 1 | 1 | 0% | 1,715 | 1,539 | -10% | 0 | 0 | — |
case-08 | pass→pass | 3,610 | 2,994 | -17% | 1 | 1 | 0% | 575 | 788 | +37% | 0 | 0 | — |
case-09 | pass→pass | 3,630 | 3,714 | +2% | 1 | 1 | 0% | 625 | 933 | +49% | 0 | 0 | — |
case-10 | pass→pass | 3,271 | 1,909 | -42% | 1 | 1 | 0% | 490 | 631 | +29% | 0 | 0 | — |
case-11 | pass→pass | 7,378 | 3,960 | -46% | 1 | 1 | 0% | 1,436 | 1,017 | -29% | 0 | 0 | — |
case-12 | pass→pass | 2,785 | 2,331 | -16% | 1 | 1 | 0% | 451 | 710 | +57% | 0 | 0 | — |
case-13 | pass→pass | 4,012 | 1,945 | -52% | 1 | 1 | 0% | 651 | 651 | 0% | 0 | 0 | — |
case-14 | fail→pass | 4,089 | 2,626 | -36% | 1 | 1 | 0% | 712 | 751 | +5% | 0 | 0 | — |
case-15 | pass→pass | 11,251 | 6,393 | -43% | 1 | 1 | 0% | 2,180 | 1,702 | -22% | 0 | 0 | — |
case-16 | pass→pass | 7,679 | 5,211 | -32% | 1 | 1 | 0% | 1,317 | 1,210 | -8% | 0 | 0 | — |
case-17 | pass→pass | 10,055 | 9,849 | -2% | 1 | 1 | 0% | 1,698 | 2,125 | +25% | 0 | 0 | — |
case-18 | fail→pass | 7,683 | 3,157 | -59% | 1 | 1 | 0% | 1,511 | 910 | -40% | 0 | 0 | — |
case-19 | fail→pass | 3,238 | 1,417 | -56% | 1 | 1 | 0% | 449 | 481 | +7% | 0 | 0 | — |
case-20 | pass→pass | 7,255 | 7,889 | +9% | 1 | 1 | 0% | 1,529 | 2,079 | +36% | 0 | 0 | — |
case-21 | pass→pass | 11,340 | 7,977 | -30% | 1 | 1 | 0% | 2,305 | 2,050 | -11% | 0 | 0 | — |
case-22 | pass→pass | 12,344 | 12,434 | +1% | 1 | 1 | 0% | 2,493 | 2,760 | +11% | 0 | 0 | — |
case-23 | pass→pass | 23,657 | 20,552 | -13% | 1 | 1 | 0% | 4,345 | 4,285 | -1% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +17 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.