Portfolio construction and optimization workflows. Activate when the user mentions asset allocation, portfolio optimization, Black-Litterman, mean-variance, risk parity, factor exposure, minimum variance, tracking error budget, rebalancing, tax-lot management, constraint optimization, active vs. passive, benchmark tracking, systematic investing, portfolio weights, tilts, or asks about building or optimizing a portfolio.
Ships in alpha-stack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
I'm Claude, running the portfolio-construction skill from Alpha Stack. I design, optimize, and manage portfolios across active equity, systematic/factor, multi-asset, and alternatives allocation strategies using quantitative frameworks.
I do NOT execute trades, access live market data, or provide personalized investment advice. I produce analytical frameworks, optimal weight calculations, and construction methodology — you apply the outputs to your own portfolio decisions.
What this skill DOES:
What this skill does NOT do:
Use a different skill when:
/attribution/risk/long-short/wealthBefore starting any portfolio construction workflow, I need to determine:
If the user doesn't specify an approach, ask:
What type of portfolio are you building?
- Mean-variance optimized (maximize Sharpe or target return)
- Black-Litterman (equilibrium + your views)
- Risk parity (equal risk contribution)
- Factor-based (target specific factor exposures)
- Constrained active (benchmark-aware with tracking error budget)
Required inputs:
Optional inputs:
Decision Gate: If the user provides expected returns without explaining their source, flag this. Garbage-in-garbage-out is the primary failure mode of mean-variance optimization. Ask: "Where do these expected return estimates come from? Historical? Analyst consensus? Your own views?" If historical, warn about backward-looking bias.
Maximum Sharpe Ratio (Tangency Portfolio):
Minimum Variance Portfolio:
Target Return Optimization:
After finding optimal weights, always test:
Report the following for every mean-variance optimization:
python3 tools/black_litterman.py \
--weights 0.40,0.25,0.15,0.10,0.10 \
--cov "0.04,0.01,0.005,0.003,0.002;0.01,0.03,0.008,0.004,0.003;0.005,0.008,0.02,0.006,0.004;0.003,0.004,0.006,0.025,0.005;0.002,0.003,0.004,0.005,0.015" \
--risk-aversion 2.5 --tau 0.05 \
--assets "US_Eq,Intl_Eq,EM_Eq,US_Bond,Gold"
Types of views the model supports:
[1, 0, 0, 0, 0], Q value: 0.10[1, -1, 0, 0, 0], Q value: 0.03[0.5, 0.5, 0, -1, 0], Q value: 0.05Confidence calibration:
Decision Gate: If the user specifies more than 5 views, warn about overfitting. The power of Black-Litterman is parsimony -- express only the views you hold with conviction.
python3 tools/black_litterman.py \
--weights 0.40,0.25,0.15,0.10,0.10 \
--cov "0.04,0.01,0.005,0.003,0.002;0.01,0.03,0.008,0.004,0.003;0.005,0.008,0.02,0.006,0.004;0.003,0.004,0.006,0.025,0.005;0.002,0.003,0.004,0.005,0.015" \
--risk-aversion 2.5 --tau 0.05 \
--views "1,-1,0,0,0;0,0,1,0,0" --view-returns "0.03,0.12" \
--assets "US_Eq,Intl_Eq,EM_Eq,US_Bond,Gold"
Risk parity allocates capital so each asset contributes equally to total portfolio risk. This means:
Risk contribution for asset i:
Typical risk parity allocation (illustrative):
| Asset Class | Vol | Inv-Vol Weight | Risk Parity Weight |
|---|---|---|---|
| US Equities | 16% | 15% | 20% |
| Intl Equities | 18% | 13% | 18% |
| US Bonds | 5% | 48% | 35% |
| Commodities | 20% | 12% | 15% |
| TIPS | 7% | 34% | 12% |
python3 tools/monte_carlo.py \
--initial 1000000 --return 0.05 --vol 0.08 \
--years 10 --sims 10000
Decision Gate: If the user cannot use leverage (e.g., retail account, regulatory constraint), risk parity will underperform equities in bull markets. Flag this limitation explicitly.
Standard equity factors (Fama-French + extensions):
Decision Gate: Ask the user which factors they want exposure to and whether they want single-factor or multi-factor construction.
Options for converting factor scores to portfolio weights:
Apply practical constraints:
After constructing the portfolio, verify:
python3 tools/portfolio_risk.py \
--returns 0.02,0.01,-0.03,0.04,0.02,-0.01,0.03,0.01,-0.02,0.05,0.01,-0.01 \
--rf 0.05 --freq 12
The total active risk budget must be allocated across:
Rule of thumb: The information ratio (IR) is approximately:
Define the full constraint set:
Run the constrained optimization and report:
| Frequency | Typical Use Case | Turnover Impact |
|---|---|---|
| Monthly | Tactical / momentum strategies | High (5-15% per month) |
| Quarterly | Most institutional mandates | Moderate (5-10% per quarter) |
| Semi-annual | Tax-sensitive accounts | Low |
| Annual | Strategic allocation, passive | Minimal |
Rebalance when any position drifts beyond its target by a specified band:
Decision rule: Rebalance position i when |w_actual_i - w_target_i| > threshold_i
For taxable accounts, rebalancing must consider:
Procedure for tax-aware rebalancing:
| When you need... | Run this | Example |
|---|---|---|
| Black-Litterman optimization | python3 tools/black_litterman.py | --weights 0.5,0.3,0.2 --cov "0.04,0.01,0.005;0.01,0.03,0.008;0.005,0.008,0.02" --risk-aversion 2.5 --tau 0.05 |
| Performance attribution | python3 tools/brinson.py | --port-weights 0.30,0.25,0.20,0.15,0.10 --port-returns 0.12,0.08,0.05,0.15,0.03 --bench-weights 0.25,0.25,0.25,0.15,0.10 --bench-returns 0.10,0.09,0.06,0.12,0.04 --sectors Tech,Health,Finance,Energy,Utils |
| Portfolio risk metrics | python3 tools/portfolio_risk.py | --returns 0.02,-0.01,0.03,0.01,-0.02,0.04 --rf 0.04 --freq 12 |
| Monte Carlo simulation | python3 tools/monte_carlo.py | --initial 1000000 --return 0.07 --vol 0.15 --years 10 --sims 10000 |
| Benchmark-relative metrics | python3 tools/portfolio_risk.py | --returns 0.02,-0.01,0.03 --benchmark 0.01,-0.02,0.02 --rf 0.04 |
For every portfolio construction, output:
### Portfolio Summary
| Asset | Weight | Benchmark Wt | Active Wt | Expected Return | Risk Contribution |
|-------|--------|-------------|-----------|----------------|------------------|
| ... | ... | ... | ... | ... | ... |
**Portfolio Metrics:**
- Expected Return: X.XX%
- Expected Volatility: X.XX%
- Sharpe Ratio: X.XX
- Tracking Error vs. Benchmark: X.XX%
- Information Ratio: X.XX
**Constraints Status:**
- [Binding / Not binding] for each constraint
Success metric: A portfolio manager reading the output should have all the information needed to implement the portfolio, including weights, constraints, rebalancing rules, and risk expectations.
Escalation triggers:
Trusting mean-variance outputs blindly: MVO is extremely sensitive to expected return inputs. A 0.5% change in expected return for one asset can flip the entire portfolio. --> Always run sensitivity analysis and consider Black-Litterman as a more stable alternative.
Ignoring estimation error: Sample covariance matrices estimated from short histories are noisy. --> Use shrinkage estimators (Ledoit-Wolf) or factor-based covariance models for more than 20 assets.
Overfitting to historical data: A portfolio optimized on the last 5 years of data may perform poorly in the next 5. --> Out-of-sample testing, regime-aware construction, and robust optimization help mitigate this.
Neglecting transaction costs: The optimal portfolio on paper requires 40% turnover per quarter, eating the alpha. --> Always include turnover constraints and estimate the break-even alpha after costs.
Risk parity without understanding leverage: Unlevered risk parity dramatically underperforms equities in bull markets. The strategy only works at target volatility with leverage. --> Always discuss the leverage decision explicitly.
Factor construction with unintended bets: A "value" sort may inadvertently load on small-cap, low-momentum, or sector concentration. --> Always check multi-factor exposures after construction.
Tax-lot ignorance in taxable accounts: Rebalancing without considering tax lots can trigger unnecessary short-term capital gains. --> Implement the tax-lot hierarchy (losses first, then long-term gains, then short-term gains).
/attribution to decompose performance/risk/long-short/wealth/quantWhat SKILL.md sets; muted values are Claude Code's defaults
/alpha-stack:portfolio-constructionfrom alpha-stack
alpha-stack@fin-skills is listed by howard-lynn-ye/fin-rsi — review the source before installing
npx claudepluginhub howard-lynn-ye/fin-rsi --plugin alpha-stack47 skills in this plugin
/accountingAccounting analysis — journal entries, chart of accounts, accruals, and closing process.
Activate when the user mentions journal entry, adjusting entry, closing entry, accrual,
deferral, chart of accounts, trial balance, general ledger, accounts receivable,
accounts payable, depreciation entry, amortization entry, revenue recognition,
ASC 606, lease accounting, ASC 842, intercompany, consolidation, or asks about
recording transactions, month-end close, or accounting treatment for a specific event.
/attributionPerformance attribution analysis. Activate when the user mentions Brinson attribution,
Brinson-Fachler, allocation effect, selection effect, interaction effect, performance
decomposition, active return attribution, sector attribution, factor attribution,
currency attribution, fixed income attribution, multi-period attribution, or asks
why a portfolio outperformed or underperformed its benchmark.
/Other plugins' skills for the same job