/forward-risk
Estimate potential future losses using VaR, Expected Shortfall, Monte Carlo simulation, and stress testing. Use when the user asks about Value-at-Risk, CVaR, Expected Shortfall, scenario analysis, stress testing, or factor-based risk decomposition. Also trigger when users
$ npx -y skills add JoelLewis/finance_skills --skill forward-risk --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/forward-risk
Context preview
The summary Claude sees to decide when to auto-load this skill.
Estimate potential future losses using VaR, Expected Shortfall, Monte Carlo simulation, and stress testing. Use when the user asks about Value-at-Risk, CVaR, Expected Shortfall, scenario analysis, stress testing, or factor-based risk decomposition. Also trigger when users
SKILL.md
forward-risk.SKILL.mdname: forward-risk
description: "Estimate potential future losses using VaR, Expected Shortfall, Monte Carlo simulation, and stress testing. Use when the user asks about Value-at-Risk, CVaR, Expected Shortfall, scenario analysis, stress testing, or factor-based risk decomposition. Also trigger when users mention 'how much could I lose', 'worst-case scenario', 'tail risk', 'risk budget', 'component VaR', 'marginal VaR', '99% confidence loss', 'Monte Carlo simulation', or ask how to project portfolio risk forward."
Forward-Looking Risk Analysis
Core Concepts
Parametric (Variance-Covariance) VaR
Assumes returns are normally distributed. For a single asset or portfolio in dollar terms (assuming zero expected return over short horizons):
VaR = W * z_alpha * sigma_p
where:
- W = portfolio value
- z_alpha = z-score for confidence level (1.645 for 95%, 2.326 for 99%)
- sigma_p = portfolio volatility over the relevant horizon
More generally, including expected return:
VaR_alpha = mu - z_alpha * sigma
To convert from 1-day VaR to h-day VaR (assuming i.i.d. returns):
VaR_h = VaR_1 * sqrt(h)
Portfolio VaR (Multiple Assets)
For a portfolio with weight vector w and covariance matrix Sigma:
sigma_p = sqrt(w' * Sigma * w)
VaR_p = W * z_alpha * sqrt(w' * Sigma * w)
The covariance matrix captures both individual volatilities and correlations between assets.
Monte Carlo VaR
Simulate a large number of portfolio return scenarios (e.g., 10,000+), then take the alpha-percentile of the simulated loss distribution.
Steps: 1. Estimate the return distribution parameters (mean vector, covariance matrix, or use a copula model). 2. Generate N random return scenarios (e.g., via Cholesky decomposition of the covariance matrix for multivariate normal). 3. Compute portfolio return for each scenario. 4. Sort results and identify the alpha-percentile loss.
Monte Carlo VaR can accommodate non-normal distributions, fat tails, path-dependent instruments, and nonlinear payoffs (e.g., options).
Conditional VaR (CVaR) / Expected Shortfall
CVaR answers: "Given that losses exceed VaR, what is the expected loss?"
ES_alpha = E[Loss | Loss > VaR_alpha]
For a normal distribution:
ES_alpha = mu + sigma * phi(z_alpha) / (1 - alpha)
where phi is the standard normal PDF.
CVaR is a **coherent risk measure** (unlike VaR) because it satisfies subadditivity: CVaR(A+B) <= CVaR(A) + CVaR(B). This means diversification always reduces or maintains CVaR, which is not guaranteed for VaR.
Component VaR
Decomposes total portfolio VaR into contributions from each position. Component VaRs sum to total VaR.
CVaR_i = w_i * beta_i * VaR_p
where beta_i = Cov(R_i, R_p) / Var(R_p) is the asset's beta to the portfolio.
Equivalently:
CVaR_i = w_i * (partial VaR / partial w_i)
sum(CVaR_i) = VaR_p
This decomposition identifies which positions are the largest contributors to portfolio risk.
Marginal VaR
Measures the rate of change of portfolio VaR with respect to a small increase in a position's weight.
MVaR_i = partial(VaR_p) / partial(w_i) = z_alpha * (Sigma * w)_i / sigma_p
Marginal VaR is used for position sizing: adding to a position with low marginal VaR reduces portfolio risk more efficiently.
Scenario Analysis
Apply specific historical or hypothetical market moves to the current portfolio to estimate P&L impact.
- **Historical scenarios:** Replay actual market events (e.g., 2008 GFC, 2020 COVID crash, 2022 rate hiking cycle) with current holdings.
- **Hypothetical scenarios:** Construct custom shocks (e.g., "equities -20%, rates +200bp, credit spreads +300bp, USD +10%").
Scenario P&L is computed by applying the scenario returns to current position exposures and revaluing.
Stress Testing
A structured framework for assessing portfolio resilience under extreme but plausible conditions.
Common stress scenarios:
- Equity crash: S&P 500 -30% to -40%
- Interest rate shock: +300bp parallel shift
- Credit crisis: investment-grade spreads +200bp, high-yield +800bp
- Liquidity freeze: bid-ask spreads widen 10x, forced selling at discount
- Currency shock: major currency pair moves 15-20%
- Stagflation: inflation +5%, GDP -3%, rates +200bp
Stress tests should include second-order effects: margin calls, liquidity demands, correlation spikes, counterparty risk.
Factor-Based Risk Decomposition
Separate total portfolio risk into systematic factor risk and idiosyncratic (security-specific) risk.
sigma^2_p = b' * Sigma_f * b + sum(w_i^2 * sigma^2_epsilon_i)
where:
- b = vector of portfolio factor exposures
- Sigma_f = factor covariance matrix
- sigma^2_epsilon_i = idiosyncratic variance of asset i
Common factor models: Fama-French (market, size, value, momentum), Barra risk models, PCA-based statistical factors.
Key Formulas
| Formula | Expression | Use Case | |---------|-----------|----------| | Parametric VaR (single) | W * z_alpha * sigma | Simple position VaR | | Portfolio VaR | W * z_alpha * sqrt(w' * Sigma * w) | Multi-asset VaR | | Multi-day VaR | VaR_1 * sqrt(h) | Scale to h-day horizon | | CVaR (normal) | mu + sigma * phi(z_alpha) / (1 - alpha) | Expected tail loss | | Component VaR | w_i * beta_i * VaR_p | Risk contribution per position | | Marginal VaR | z_alpha * (Sigma * w)_i / sigma_p | Sensitivity to weight change | | Factor Risk | b' * Sigma_f * b | Systematic risk component | | Idiosyncratic Risk | sum(w_i^2 * sigma^2_epsilon_i) | Security-specific risk |
Worked Examples
Example 1: Parametric 95% VaR
**Given:** A $1,000,000 equity portfolio with an annualized volatility of 15%.
**Calculate:** 1-day 95% parametric VaR (assuming 252 trading days and zero expected daily return).
**Solution:**
Daily volatility:
sigma_daily = 0.15 / sqrt(252) = 0.15 / 15.875 = 0.00945
1-day 95% VaR:
VaR = $1,000,000 * 1.645 * 0.00945 = $15,545
Alternatively, computing direc
Read more
name: forward-risk description: "Estimate potential future losses using VaR, Expected Shortfall, Monte Carlo simulation, and stress testing. Use when the user asks about Value-at-Risk, CVaR, Expected Shortfall, scenario analysis, stress testing, or factor-based risk decomposition. Also trigger when users mention 'how much could I lose', 'worst-case scenario', 'tail risk', 'risk budget', 'component VaR', 'marginal VaR', '99% confidence loss', 'Monte Carlo simulation', or ask how to project portfolio risk forward."
Forward-Looking Risk Analysis
Core Concepts
Parametric (Variance-Covariance) VaR
Assumes returns are normally distributed. For a single asset or portfolio in dollar terms (assuming zero expected return over short horizons):
VaR = W * z_alpha * sigma_p
where:
- W = portfolio value
- z_alpha = z-score for confidence level (1.645 for 95%, 2.326 for 99%)
- sigma_p = portfolio volatility over the relevant horizon
More generally, including expected return:
VaR_alpha = mu - z_alpha * sigma
To convert from 1-day VaR to h-day VaR (assuming i.i.d. returns):
VaR_h = VaR_1 * sqrt(h)
Portfolio VaR (Multiple Assets)
For a portfolio with weight vector w and covariance matrix Sigma:
sigma_p = sqrt(w' * Sigma * w) VaR_p = W * z_alpha * sqrt(w' * Sigma * w)
The covariance matrix captures both individual volatilities and correlations between assets.
Monte Carlo VaR
Simulate a large number of portfolio return scenarios (e.g., 10,000+), then take the alpha-percentile of the simulated loss distribution.
Steps: 1. Estimate the return distribution parameters (mean vector, covariance matrix, or use a copula model). 2. Generate N random return scenarios (e.g., via Cholesky decomposition of the covariance matrix for multivariate normal). 3. Compute portfolio return for each scenario. 4. Sort results and identify the alpha-percentile loss.
Monte Carlo VaR can accommodate non-normal distributions, fat tails, path-dependent instruments, and nonlinear payoffs (e.g., options).
Conditional VaR (CVaR) / Expected Shortfall
CVaR answers: "Given that losses exceed VaR, what is the expected loss?"
ES_alpha = E[Loss | Loss > VaR_alpha]
For a normal distribution:
ES_alpha = mu + sigma * phi(z_alpha) / (1 - alpha)
where phi is the standard normal PDF.
CVaR is a **coherent risk measure** (unlike VaR) because it satisfies subadditivity: CVaR(A+B) <= CVaR(A) + CVaR(B). This means diversification always reduces or maintains CVaR, which is not guaranteed for VaR.
Component VaR
Decomposes total portfolio VaR into contributions from each position. Component VaRs sum to total VaR.
CVaR_i = w_i * beta_i * VaR_p
where beta_i = Cov(R_i, R_p) / Var(R_p) is the asset's beta to the portfolio.
Equivalently:
CVaR_i = w_i * (partial VaR / partial w_i) sum(CVaR_i) = VaR_p
This decomposition identifies which positions are the largest contributors to portfolio risk.
Marginal VaR
Measures the rate of change of portfolio VaR with respect to a small increase in a position's weight.
MVaR_i = partial(VaR_p) / partial(w_i) = z_alpha * (Sigma * w)_i / sigma_p
Marginal VaR is used for position sizing: adding to a position with low marginal VaR reduces portfolio risk more efficiently.
Scenario Analysis
Apply specific historical or hypothetical market moves to the current portfolio to estimate P&L impact.
- **Historical scenarios:** Replay actual market events (e.g., 2008 GFC, 2020 COVID crash, 2022 rate hiking cycle) with current holdings.
- **Hypothetical scenarios:** Construct custom shocks (e.g., "equities -20%, rates +200bp, credit spreads +300bp, USD +10%").
Scenario P&L is computed by applying the scenario returns to current position exposures and revaluing.
Stress Testing
A structured framework for assessing portfolio resilience under extreme but plausible conditions.
Common stress scenarios:
- Equity crash: S&P 500 -30% to -40%
- Interest rate shock: +300bp parallel shift
- Credit crisis: investment-grade spreads +200bp, high-yield +800bp
- Liquidity freeze: bid-ask spreads widen 10x, forced selling at discount
- Currency shock: major currency pair moves 15-20%
- Stagflation: inflation +5%, GDP -3%, rates +200bp
Stress tests should include second-order effects: margin calls, liquidity demands, correlation spikes, counterparty risk.
Factor-Based Risk Decomposition
Separate total portfolio risk into systematic factor risk and idiosyncratic (security-specific) risk.
sigma^2_p = b' * Sigma_f * b + sum(w_i^2 * sigma^2_epsilon_i)
where:
- b = vector of portfolio factor exposures
- Sigma_f = factor covariance matrix
- sigma^2_epsilon_i = idiosyncratic variance of asset i
Common factor models: Fama-French (market, size, value, momentum), Barra risk models, PCA-based statistical factors.
Key Formulas
| Formula | Expression | Use Case | |---------|-----------|----------| | Parametric VaR (single) | W * z_alpha * sigma | Simple position VaR | | Portfolio VaR | W * z_alpha * sqrt(w' * Sigma * w) | Multi-asset VaR | | Multi-day VaR | VaR_1 * sqrt(h) | Scale to h-day horizon | | CVaR (normal) | mu + sigma * phi(z_alpha) / (1 - alpha) | Expected tail loss | | Component VaR | w_i * beta_i * VaR_p | Risk contribution per position | | Marginal VaR | z_alpha * (Sigma * w)_i / sigma_p | Sensitivity to weight change | | Factor Risk | b' * Sigma_f * b | Systematic risk component | | Idiosyncratic Risk | sum(w_i^2 * sigma^2_epsilon_i) | Security-specific risk |
Worked Examples
Example 1: Parametric 95% VaR
**Given:** A $1,000,000 equity portfolio with an annualized volatility of 15%.
**Calculate:** 1-day 95% parametric VaR (assuming 252 trading days and zero expected daily return).
**Solution:**
Daily volatility:
sigma_daily = 0.15 / sqrt(252) = 0.15 / 15.875 = 0.00945
1-day 95% VaR:
VaR = $1,000,000 * 1.645 * 0.00945 = $15,545
Alternatively, computing direc
A collection of Claude Code skill plugins for financial services. 91 skills across 7 domain plugins teach Claude investment management, regulatory compliance, advisory workflows, trading operations, and more — so it can assist with finance questions, build
Other skills on finance-skills.
- /advisor-dashboards
Design, build, and optimize dashboards for RIA practice management with AUM tracking, revenue analytics, and KPI frameworks. Use when the user asks about tracking firm-level metrics, monitoring advisor productivity, measuring organic growth rate, analyzing client retention and
Open skill - /client-onboarding
Design and implement end-to-end client onboarding workflows from prospect intake through funded account, covering KYC verification, document collection, e-signature, and custodian submission. Use when the user asks about building a digital onboarding flow, integrating identity
Open skill - /client-reporting-delivery
Design, generate, and deliver client performance reports across all channels, covering quarterly reports, tax reporting, portal integration, and compliance review. Use when the user asks about building or redesigning report templates, choosing what to include in quarterly or
Open skill - /client-review-prep
Prepare advisors for client review meetings by assembling context packages, performance summaries, drift analysis, talking points, and meeting agendas. Use when the user asks about preparing for a client review, building a pre-meeting checklist, generating talking points for an
Open skill - /crm-client-lifecycle
Design and optimize CRM systems and client lifecycle workflows for advisory firms, covering segmentation, household management, service tiers, and retention analytics. Use when the user asks about client segmentation models, building household structures, defining service tier
Open skill - /fee-billing
Build and manage advisory fee billing operations from fee schedule design through calculation, collection, revenue recognition, and compliance disclosure. Use when the user asks about tiered or breakpoint fee schedules, billing cycle configuration, AUM valuation for billing,
Open skill

