Skip to main content
skill Claude Code CX Codex Cursor

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.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add wshobson/agents
/plugin install quantitative-trading@claude-code-workflows
Open on GitHub

What 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-workflows

This installs the whole quantitative-trading plugin with all its skills

2Skills CLI (Vercel)

npx skills add wshobson/agents --skill risk-metrics-calculation -a claude-code

3Manually: put the files in place

~/.claude/skills/risk-metrics-calculation/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/risk-metrics-calculation/

From the same set213

The whole set →
typescript-advanced-types Seth Hobson Guides an agent through advanced TypeScript types, from generics to conditional and mapped types. Use it for typed libraries, API clients, or strict configuration objects. Claude Code CX Codex Cursor 92,169installs tailwind-design-system Seth Hobson Helps build design systems with Tailwind CSS v4, from theme tokens to component variants. Use it when a project needs shared UI patterns. Claude Code CX Codex Cursor 70,180installs brand-landingpage Travis D. Elliott This skill interviews you about the product and its visual direction, then builds a landing page through Stitch. Use it when there’s no established design yet. Claude Code CX Codex Cursor 39,476installs python-testing-patterns Seth Hobson This skill guides Python testing with pytest, fixtures and mocks. Use it when building a test suite or tracking down failing checks. Claude Code CX Codex Cursor 36,943installs python-performance-optimization Seth Hobson This skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. Claude Code CX Codex Cursor 35,675installs nextjs-app-router-patterns Seth Hobson This skill covers Next.js App Router patterns for rendering, routing, and data fetching. Use it when starting an App Router project or moving from Pages Router. Claude Code CX Codex Cursor 32,529installs api-design-principles Seth Hobson Use this skill to plan or review REST and GraphQL APIs. It helps when writing a specification or setting API conventions for a team. Claude Code CX Codex Cursor 30,348installs code-review-excellence Seth Hobson This skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. Claude Code CX Codex Cursor 30,193installs

Similar

variance-commentary official anthropics Generates flux commentary for P&L and balance sheet lines against budget and prior periods. Useful for month-end close packages and management reporting. Claude Code CX Codex Cursor +1 1,300installs unit-economics official anthropics Analyzes unit economics for SaaS and subscription businesses in PE context: builds ARR cohorts, calculates LTV:CAC, net retention, payback periods, and margin waterfall. Claude Code CX Codex Cursor +1 1,300installs churn-prevention coreyhaines31 A Claude Code skill for subscription churn: an exit survey at cancellation, an offer matched to the stated reason, and recovery of failed payments. Claude Code CX Codex Cursor +1 120,600installs revops coreyhaines31 This skill helps design RevOps workflows for lead stages, scoring, routing, and marketing-to-sales handoffs. Use it when CRM processes need clear rules. Claude Code CX Codex Cursor +1 113,000installs community-marketing coreyhaines31 Builds and grows branded communities on Discord or Slack to drive product retention and turn users into advocates. Claude Code CX Codex Cursor +1 89,100installs ads coreyhaines31 Guides paid advertising campaigns across Google Ads and Meta. It connects agents to rigorous playbooks and forbids guessing missing numbers. Claude Code CX Codex Cursor +1 82,200installs pricing coreyhaines31 Turns the agent into a pricing advisor for SaaS: pick a value metric, structure tiers, audit the pricing page. Useful when you can't tell what to charge. Claude Code CX Codex Cursor +1 78,800installs referrals coreyhaines31 This skill helps design and review referral, affiliate, and word-of-mouth programs, from incentive choices to launch metrics. Claude Code CX Codex Cursor +1 71,600installs

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

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor