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
npx skills add staskh/trading_skills --skill risk-assessment -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/risk-assessment/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/risk-assessment/
1Skills CLI (Vercel)
npx skills add staskh/trading_skills --skill risk-assessment -a codex2Manually: put the files in place
.agents/skills/risk-assessment/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add staskh/trading_skills --skill risk-assessment -a cursor2Manually: put the files in place
.cursor/skills/risk-assessment/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install staskh/trading_skills .claude/skills/risk-assessment2Manually: put the files in place
.github/skills/risk-assessment/SKILL.md1Skills CLI (Vercel)
npx skills add staskh/trading_skills --skill risk-assessment -a gemini-cli2Platform CLI
gemini skills install https://github.com/staskh/trading_skills --path .claude/skills/risk-assessmentManually: put the files in place
.devin/skills/risk-assessment/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add staskh/trading_skills --skill risk-assessment -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.