risk-metrics-calculation — Claude Code skill: risk metrics, install
Calculates portfolio risk metrics and reviews drawdowns. Use it for risk limits, dashboards, and risk-adjusted return analysis.
/plugin marketplace add wshobson/agents
/plugin install quantitative-trading@claude-code-workflowsWhat risk-metrics-calculation does
This skill calculates VaR, CVaR, Sharpe, and Sortino metrics, then examines portfolio drawdowns. It covers volatility, tail losses, risk-adjusted performance, position sizing, and risk reporting.
The material works across intraday, daily, weekly, monthly, and annual analysis. Detailed patterns and worked examples are in references/details.md; read it when the short navigation is not enough.
A single metric cannot describe portfolio risk, so VaR should be checked alongside CVaR, stress tests, and correlation analysis. Check the assumptions about return distributions, lookback periods, and transaction costs before using the results for limits or reporting.
What it helps with
- calculate VaR and CVaR for a portfolio
- measure maximum portfolio drawdown
- compare returns with Sharpe and Sortino
- set position risk limits
- prepare metrics for a risk dashboard
Example prompts for the agent
- Calculate VaR, CVaR, Sharpe, and Sortino for the portfolio in `portfolio.csv`.
- Run a maximum drawdown review and stress test with historical scenarios.
- Prepare a risk report and list the assumptions for return distributions and the lookback period.
How to install risk-metrics-calculation
1Plugin marketplace
/plugin marketplace add wshobson/agents/plugin install quantitative-trading@claude-code-workflowsThis installs the whole quantitative-trading plugin with all its skills
2Skills CLI (Vercel)
npx skills add wshobson/agents --skill risk-metrics-calculation -a claude-code3Manually: put the files in place
~/.claude/skills/risk-metrics-calculation/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/risk-metrics-calculation/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill risk-metrics-calculation -a codex2Manually: put the files in place
.agents/skills/risk-metrics-calculation/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill risk-metrics-calculation -a cursor2Manually: put the files in place
.cursor/skills/risk-metrics-calculation/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install wshobson/agents risk-metrics-calculation2Manually: put the files in place
.github/skills/risk-metrics-calculation/SKILL.mdPlatform CLI
gemini skills install https://github.com/wshobson/agents --path plugins/quantitative-trading/skills/risk-metrics-calculationManually: put the files in place
.devin/skills/risk-metrics-calculation/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set213
The whole set →Similar
Questions about risk-metrics-calculation
How do I install risk-metrics-calculation in Claude Code?
Run /plugin marketplace add wshobson/agents, then run /plugin install quantitative-trading@claude-code-workflows.
What does risk-metrics-calculation do?
It calculates VaR, CVaR, Sharpe, and Sortino, reviews drawdowns, and supports risk dashboards, limits, position sizing, and reporting.
Why should VaR not be used on its own?
VaR can underestimate tail losses. Check it with CVaR, stress tests, and correlation analysis.
Source text
SKILL.md · MIT
--- name: risk-metrics-calculation description: Calculate portfolio risk metrics including VaR, CVaR, Sharpe, Sortino, and drawdown analysis. Use when measuring portfolio risk, implementing risk limits, or building risk monitoring systems. --- # Risk Metrics Calculation Comprehensive risk measurement toolkit for portfolio management, including Value at Risk, Expected Shortfall, and drawdown analysis. ## When to Use This Skill - Measuring portfolio risk - Implementing risk limits - Building risk dashboards - Calculating risk-adjusted returns - Setting position sizes - Regulatory reporting ## Core Concepts ### 1. Risk Metric Categories | Category | Metrics | Use Case | | ----------------- | --------------- | -------------------- | | **Volatility** | Std Dev, Beta | General risk | | **Tail Risk** | VaR, CVaR | Extreme losses | | **Drawdown** | Max DD, Calmar | Capital preservation | | **Risk-Adjusted** | Sharpe, Sortino | Performance | ### 2. Time Horizons ``` Intraday: Minute/hourly VaR for day traders Daily: Standard risk reporting Weekly: Rebalancing decisions Monthly: Performance attribution Annual: Strategic allocation ``` ## Detailed patterns and worked examples Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient. ## Best Practices ### Do's - **Use multiple metrics** - No single metric captures all risk - **Consider tail risk** - VaR isn't enough, use CVaR - **Rolling analysis** - Risk changes over time - **Stress test** - Historical and hypothetical - **Document assumptions** - Distribution, lookback, etc. ### Don'ts - **Don't rely on VaR alone** - Underestimates tail risk - **Don't assume normality** - Returns are fat-tailed - **Don't ignore correlation** - Increases in stress - **Don't use short lookbacks** - Miss regime changes - **Don't forget transaction costs** - Affects realized risk
© Seth Hobson · MIT · wshobson/agents