All skills
wshobson avatar

/risk-metrics-calculation

@be57c0b
by Seth Hobsonwshobson/agents40k stars
4,281

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.

Use this Skill: https://skilld.dev/gh/wshobson/agents/risk-metrics-calculation

This session only. Nothing lands on disk.

SKILL.md

≈54 tokens always: the name and description. ≈441 when used: this file. ≈4.2k more on demand in 1 file.

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

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is safe to use. It contains standard mathematical and statistical functions for calculating portfolio risk metrics using common Python libraries such as numpy, pandas, and scipy, with no indications of malicious behavior, data exfiltration, or prompt injection.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    1 file scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at be57c0b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 4 months ago
  • Python
  • var
  • cvar
  • sharpe
  • sortino
  • drawdown
  • portfolio
  • risk-management
  • finance

README badge

README badge for wshobson/agents/risk-metrics-calculation

Calculates portfolio risk metrics including Value at Risk, Conditional Value at Risk, Sharpe ratio, Sortino ratio, and maximum drawdown analysis. Use this skill when building risk dashboards, setting position limits, or implementing regulatory reporting for investment portfolios.

Generated from the current SKILL.md.

Does this skill calculate VaR and CVaR?
Yes. It provides Value at Risk and Conditional Value at Risk (Expected Shortfall) for tail risk measurement, along with the note that CVaR should be used alongside VaR since VaR alone underestimates tail risk.
What risk metrics are included?
The skill covers volatility (standard deviation, beta), tail risk (VaR, CVaR), drawdown analysis (max drawdown, Calmar ratio), and risk-adjusted returns (Sharpe, Sortino ratios).
Can I use this for regulatory reporting?
Yes. Regulatory reporting is listed as a core use case, though the skill does not specify which regulatory frameworks or jurisdictions it targets.
Does this skill handle different time horizons?
Yes. It supports intraday, daily, weekly, monthly, and annual time horizons for risk measurement and rebalancing decisions.
What data assumptions does this skill make about returns?
The skill documentation explicitly warns against assuming normal distributions, noting that returns are fat-tailed, and recommends considering historical and hypothetical stress testing rather than relying on distributional assumptions alone.

Generated from the current SKILL.md. These answers refresh after source changes.