Index of every page on this site: llms.txt
All skills
wshobson avatar

/risk-metrics-calculation

@4220308
by Seth Hobsonwshobson/agents43k stars
4,518
Run it yourself

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

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

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

Description uses 2.7% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈218 characters, or 2.7%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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 rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo5 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    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.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Runlayer8mo

    1 file scanned · No issues

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 4220308. 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 6 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.