Skip to content

Portfolio Risk Metrics

Calculate VaR, CVaR, Sharpe, Sortino and drawdown measures for a portfolio

Repository
wshobson/agents
Stars
42,095
Licence
MIT
Files
2 files

What it does

When installed, the agent knows how to explain and calculate common portfolio risk measures such as Value at Risk (VaR), Expected Shortfall (CVaR), Sharpe and Sortino ratios, and drawdown analysis. It also knows the usual cautions, such as not relying on VaR alone, not assuming returns follow a normal distribution, and using enough historical data. The skill points to a separate reference file with worked examples for deeper detail.

Great for

  • Analysts or portfolio managers who want help structuring risk calculations
  • Developers building a risk dashboard or risk-limit checks for trading or investment tools
  • Students learning how VaR, CVaR and Sharpe ratios are defined and used

Skip it if

  • Making live trading or position-sizing decisions without independent review, since the skill is general guidance and not a validated risk system
  • Regulatory or compliance reporting, which the skill mentions but does not specify rules for, so outputs need expert verification

Try asking

  • “Calculate 95% historical VaR and CVaR for my portfolio's daily returns”
  • “Explain the difference between Sharpe and Sortino and which fits my strategy”
  • “Write a Python function that computes maximum drawdown and Calmar ratio from a price series”
  • “Suggest how to set up a rolling risk monitoring report for my holdings”
Step-by-step guide: how to use Portfolio Risk MetricsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 2 original files, the MIT licence and an attribution note.

    risk-metrics-calculation.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip risk-metrics-calculation.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip risk-metrics-calculation.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Provide your own return or price data and state the lookback period and confidence level, since the skill's guidance depends on these assumptions.
  • Ask for several metrics together, as the skill itself stresses that no single metric captures all risk.
  • Have any generated formulas checked against a trusted library or source before using them with real money.

What's inside

  • references/details.md
  • SKILL.md

Redistributed unmodified from wshobson/agents under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.