Skip to main content
skill CX Codex

risk-assessment · staskh — Claude Code skill: volatility, VaR

risk-assessment calculates risk metrics for stocks and positions: volatility, beta, Value at Risk, and maximum drawdown. Use it to assess position risk and determine sizing.

MIT 113 installs ★ 417 updated 2026-10-21

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add staskh/trading_skills --skill risk-assessment -a claude-code
Open on GitHub

What risk-assessment does

The skill runs a Python script that pulls historical price data and computes seven risk metrics: annualized volatility, beta relative to SPY, daily VaR at 95% and 99% confidence levels, maximum drawdown over the period, and Sharpe ratio. Pass a dollar amount to get position-specific VaR in dollar terms.

Requires numpy and yfinance. Analyzes periods from one month to one year (default: one year). All timestamps use America/New_York timezone. Output is JSON with metrics, generation time, and data delay.

What it helps with

  • assess stock volatility over a time period
  • calculate maximum drawdown and Value at Risk
  • size a position based on VaR limits
  • compare betas across stocks against SPY
  • evaluate risk-adjusted returns using Sharpe ratio

Example prompts for the agent

  • What is the VaR for a 50k TSLA position?
  • Calculate volatility and drawdown for AAPL over the last three months
  • Compare MSFT and GOOGL betas to see which fits my risk profile

How to install risk-assessment

1Skills CLI (Vercel)

npx skills add staskh/trading_skills --skill risk-assessment -a claude-code

2Manually: put the files in place

~/.claude/skills/risk-assessment/SKILL.md

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

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about risk-assessment

How do I install risk-assessment in Claude Code?

Run npx skills add staskh/trading_skills --skill risk-assessment -a claude-code, then check ~/.claude/skills/risk-assessment/SKILL.md.

What metrics does it calculate?

Volatility, beta, 95% and 99% VaR, maximum drawdown, Sharpe ratio, and (if you provide position size) dollar VaR for your position.

What are the dependencies?

Requires numpy and yfinance. If uv is not installed or pyproject.toml is missing, replace uv run python with python in commands.

Source text

SKILL.md · MIT
---
name: risk-assessment
description: Assess risk metrics for a stock or position including volatility, beta, VaR, and drawdown analysis. Use when user asks about risk, volatility, beta, VaR, value at risk, drawdown, or position sizing.
dependencies: ["trading-skills"]
---

# Risk Assessment

Calculate risk metrics for stocks and positions.

## Instructions

> **Note:** If `uv` is not installed or `pyproject.toml` is not found, replace `uv run python` with `python` in all commands below.

```bash
uv run python scripts/risk.py SYMBOL [--period PERIOD] [--position-size SIZE]
```

## Arguments

- `SYMBOL` - Ticker symbol
- `--period` - Analysis period: 1mo, 3mo, 6mo, 1y (default: 1y)
- `--position-size` - Dollar amount for position-specific metrics (optional)

## Output

Returns JSON with:
- `volatility` - Historical volatility (annualized)
- `beta` - Beta vs SPY
- `var_95` - 95% Value at Risk (daily)
- `var_99` - 99% Value at Risk (daily)
- `max_drawdown` - Maximum drawdown in period
- `sharpe_ratio` - Risk-adjusted return
- `position_risk` - If position-size provided, dollar VaR

Explain what the risk metrics mean and suggest position sizing if relevant.

## Dependencies

- `numpy`
- `yfinance`


## Timezone

All timestamps and time-based calculations must use the `America/New_York` timezone. All JSON output must include `generated_at` (NY time string) and `data_delay` fields.

© staskh · MIT · staskh/trading_skills

Similar skills

All skills for AI and ML →

risk-assessment by other authors comes first.

risk-assessment official anthropics risk-assessment is a Claude Code skill that identifies and evaluates operational risks in projects, vendor changes, and decisions. It generates a prioritized register with assigned owners. CX Codex +1 3,600installs historical-risk JoelLewis historical-risk quantifies realized investment risk using volatility estimators, drawdown tracking, and downside metrics. Useful for portfolio risk analysis and historical VaR computations. CX Codex +1 797installs forward-risk JoelLewis forward-risk estimates future portfolio losses with parametric VaR, Expected Shortfall, Monte Carlo simulation and scenario analysis. Useful when you need tail risk on current positions. CX Codex +1 766installs legal-risk-assessment official anthropics The legal-risk-assessment skill scores legal risks on a severity-by-likelihood matrix and flags when a matter needs senior counsel. Useful for contract and deal review. CX Codex +1 5,500installs trader-risk ruvnet Evaluates portfolio VaR, CVaR, drawdown limits, and circuit breaker status using the neural-trader risk engine. CX Codex +1 732installs feature-risk-assessment official anthropics feature-risk-assessment takes one risk apart: what could go wrong, how likely, how bad, what already limits the damage. Built for the cases a table row can't hold. CX Codex +1 641installs risk-management agiprolabs risk-management — a skill that sets portfolio risk rules for crypto trading: drawdown limits, daily and weekly loss stops, concentration caps and automated circuit breakers. CX Codex +1 743installs

From the same set12

The whole set →
stock-quote stock-quote is a Claude Code skill that fetches current price, volume, change, and 52-week range for any ticker. CX Codex +1 138installs greeks Skill computes option Greeks (delta, gamma, theta, vega) and implied volatility using the Black-Scholes model. Use it to understand how your position reacts to price changes, time decay, and shifts in volatility. CX Codex +1 137installs report-stock report-stock builds stock research reports in Markdown or PDF covering market trends, PMCC viability, and company fundamentals. CX Codex +1 123installs option-chain Skill pulls option chain data from Yahoo Finance: calls and puts with strike prices, bids, asks, volumes, and implied volatility. Use it to check option quotes for a specific expiration date. CX Codex +1 117installs ib-portfolio ib-portfolio — a skill for Claude Code fetches open positions and holdings from Interactive Brokers. The agent invokes it when asked about current stocks, portfolio value, or account assets. CX Codex +1 107installs spread-analysis The spread-analysis skill performs quantitative analysis of multi-leg option strategies for Claude Code. It triggers on requests concerning vertical spreads, iron condors, straddles, or strangle strategies. CX Codex +1 105installs ib-account The ib-account Claude Code skill fetches an Interactive Brokers account summary. It activates for questions about balances, buying power, or available cash. CX Codex +1 103installs price-history The price-history Claude Code skill fetches historical OHLCV data for a stock. It activates for requests about past prices or data for chart analysis. CX Codex +1 102installs

Project sponsors

Companies that keep this analytics open