Writing Livekit Scenarios
livekit-examples/agent-starter-python
Creates and maintains the scenarios a LiveKit agent simulation runs, and wires the agent to consume them.
Estimate potential future losses using VaR, Expected Shortfall, Monte Carlo simulation, and stress testing.
$ npx skills add JoelLewis/finance_skills --skill forward-risk -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install JoelLewis/finance_skills forward-risk --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/wealth-management/skills/forward-risk .claude/skills/forward-risk && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "forward-risk" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/forward-risk into .claude/skills/forward-risk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "forward-risk", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/forward-riskType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add JoelLewis/finance_skills --skill forward-risk -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install JoelLewis/finance_skills forward-risk --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/wealth-management/skills/forward-risk .agents/skills/forward-risk && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "forward-risk" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/forward-risk into .agents/skills/forward-risk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "forward-risk", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add JoelLewis/finance_skills --skill forward-risk -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install JoelLewis/finance_skills forward-risk --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/wealth-management/skills/forward-risk .cursor/skills/forward-risk && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "forward-risk" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/forward-risk into .cursor/skills/forward-risk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "forward-risk", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/JoelLewis/finance_skills.git --path plugins/wealth-management/skills/forward-risk--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add JoelLewis/finance_skills --skill forward-risk -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install JoelLewis/finance_skills forward-risk --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/wealth-management/skills/forward-risk .gemini/skills/forward-risk && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "forward-risk" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/forward-risk into .gemini/skills/forward-risk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "forward-risk", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install JoelLewis/finance_skills forward-riskInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add JoelLewis/finance_skills --skill forward-risk -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/wealth-management/skills/forward-risk .github/skills/forward-risk && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "forward-risk" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/forward-risk into .github/skills/forward-risk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "forward-risk", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add JoelLewis/finance_skills --skill forward-risk -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install JoelLewis/finance_skills forward-risk --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/wealth-management/skills/forward-risk .opencode/skills/forward-risk && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "forward-risk" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/forward-risk into .opencode/skills/forward-risk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "forward-risk", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
forward-riskEstimate potential future losses using VaR, Expected Shortfall, Monte Carlo simulation, and stress testing.
Forward Risk is an agent skill from JoelLewis/finance_skills. Estimate potential future losses using VaR, Expected Shortfall, Monte Carlo simulation, and stress testing. Use when the user asks about Value-at-Risk, CVaR, Expected Shortfall, scenario analysis, stress testing, or factor-based risk decomposition. Also trigger when users mention 'how much could I lose', 'worst-case scenario', 'tail risk', 'risk budget', 'component VaR', 'marginal VaR', '99% confidence loss', 'Monte Carlo simulation', or ask how to project portfolio risk forward.
Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/forward_risk.py`).
It sits in Testing & QA, covering Load testing. The repository describes itself as: Claude Code skill plugins for financial services — 81 skills across 7 domain plugins covering investment management, compliance, advisory practice, trading, and operations. The licence is MIT.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 5c498ea. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
uvpython3pythonFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Forward Risk loads about 2.6k tokens when it runs. Until then it costs about 124 tokens; SKILL.md has 1,124 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from JoelLewis/finance_skills at commit 5c498ea, republished under its MIT licence (© JoelLewis). 1,124 words, ~2,598 tokens.
.claude/skills/forward-risk/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Assumes returns are normally distributed. For a single asset or portfolio in dollar terms (assuming zero expected return over short horizons):
VaR = W * z_alpha * sigma_pwhere:
More generally, including expected return:
VaR_alpha = mu - z_alpha * sigmaTo convert from 1-day VaR to h-day VaR (assuming i.i.d. returns):
VaR_h = VaR_1 * sqrt(h)For a portfolio with weight vector w and covariance matrix Sigma:
sigma_p = sqrt(w' * Sigma * w)
VaR_p = W * z_alpha * sqrt(w' * Sigma * w)The covariance matrix captures both individual volatilities and correlations between assets.
Simulate a large number of portfolio return scenarios (e.g., 10,000+), then take the alpha-percentile of the simulated loss distribution.
Steps:
Monte Carlo VaR can accommodate non-normal distributions, fat tails, path-dependent instruments, and nonlinear payoffs (e.g., options).
CVaR answers: "Given that losses exceed VaR, what is the expected loss?"
ES_alpha = E[Loss | Loss > VaR_alpha]For a normal distribution:
ES_alpha = mu + sigma * phi(z_alpha) / (1 - alpha)where phi is the standard normal PDF.
CVaR is a coherent risk measure (unlike VaR) because it satisfies subadditivity: CVaR(A+B) <= CVaR(A) + CVaR(B). This means diversification always reduces or maintains CVaR, which is not guaranteed for VaR.
Decomposes total portfolio VaR into contributions from each position. Component VaRs sum to total VaR.
CVaR_i = w_i * beta_i * VaR_pwhere beta_i = Cov(R_i, R_p) / Var(R_p) is the asset's beta to the portfolio.
Equivalently:
CVaR_i = w_i * (partial VaR / partial w_i)
sum(CVaR_i) = VaR_pThis decomposition identifies which positions are the largest contributors to portfolio risk.
Measures the rate of change of portfolio VaR with respect to a small increase in a position's weight.
MVaR_i = partial(VaR_p) / partial(w_i) = z_alpha * (Sigma * w)_i / sigma_pMarginal VaR is used for position sizing: adding to a position with low marginal VaR reduces portfolio risk more efficiently.
Apply specific historical or hypothetical market moves to the current portfolio to estimate P&L impact.
Scenario P&L is computed by applying the scenario returns to current position exposures and revaluing.
A structured framework for assessing portfolio resilience under extreme but plausible conditions.
Common stress scenarios:
Stress tests should include second-order effects: margin calls, liquidity demands, correlation spikes, counterparty risk.
Separate total portfolio risk into systematic factor risk and idiosyncratic (security-specific) risk.
sigma^2_p = b' * Sigma_f * b + sum(w_i^2 * sigma^2_epsilon_i)where:
Common factor models: Fama-French (market, size, value, momentum), Barra risk models, PCA-based statistical factors.
| Formula | Expression | Use Case |
|---|---|---|
| Parametric VaR (single) | W * z_alpha * sigma | Simple position VaR |
| Portfolio VaR | W * z_alpha * sqrt(w' * Sigma * w) | Multi-asset VaR |
| Multi-day VaR | VaR_1 * sqrt(h) | Scale to h-day horizon |
| CVaR (normal) | mu + sigma * phi(z_alpha) / (1 - alpha) | Expected tail loss |
| Component VaR | w_i * beta_i * VaR_p | Risk contribution per position |
| Marginal VaR | z_alpha * (Sigma * w)_i / sigma_p | Sensitivity to weight change |
| Factor Risk | b' * Sigma_f * b | Systematic risk component |
| Idiosyncratic Risk | sum(w_i^2 * sigma^2_epsilon_i) | Security-specific risk |
Given: A $1,000,000 equity portfolio with an annualized volatility of 15%.
Calculate: 1-day 95% parametric VaR (assuming 252 trading days and zero expected daily return).
Solution:
Daily volatility:
sigma_daily = 0.15 / sqrt(252) = 0.15 / 15.875 = 0.009451-day 95% VaR:
VaR = $1,000,000 * 1.645 * 0.00945 = $15,545Alternatively, computing directly from annual figures:
VaR_annual = $1,000,000 * 1.645 * 0.15 = $246,750
VaR_1day = $246,750 / sqrt(252) = $15,545Interpretation: There is a 5% chance of losing more than $15,545 in a single day under normal market conditions.
Given: A two-asset portfolio (60% equities, 40% bonds). Equities: mu = 10%, sigma = 18%. Bonds: mu = 4%, sigma = 5%. Correlation rho = -0.2. Portfolio value = $1,000,000.
Calculate: 95% annual VaR via Monte Carlo simulation (conceptual steps).
Solution:
Sigma = | 0.0324 -0.0018 |
| -0.0018 0.0025 |Cholesky decomposition of Sigma to get lower triangular matrix L.
Simulate 10,000 scenarios: For each simulation, draw z ~ N(0, I), compute r = mu + L*z, then portfolio return R_p = w' * r.
Compute portfolio P&L for each scenario: P&L = $1,000,000 * R_p.
Sort P&L from worst to best. The 500th worst (5th percentile) is the 95% VaR.
For this portfolio, the analytical answer provides a benchmark:
sigma_p = sqrt(0.6^2 * 0.0324 + 0.4^2 * 0.0025 + 2 * 0.6 * 0.4 * (-0.0018))
= sqrt(0.011664 + 0.0004 - 0.000864)
= sqrt(0.0112)
= 10.58%
VaR_95% = $1,000,000 * 1.645 * 0.1058 = $174,090The Monte Carlo result should converge to approximately this value for a multivariate normal assumption.
Given: From the Monte Carlo simulation above, the losses exceeding VaR (the worst 500 out of 10,000 scenarios) have an average loss of $225,000.
Calculate: 95% CVaR.
Solution:
CVaR_95% = $225,000Interpretation: When losses exceed the 95% VaR threshold, the average loss is $225,000. This is roughly 29% worse than the $174,090 VaR figure, highlighting the severity of tail events.
uv run scripts/forward_risk.py # run the demo (uses PEP 723 inline deps)
uv run scripts/forward_risk.py --verify # check demo outputs against the worked examples (exit 1 on mismatch)
python3 scripts/forward_risk.py # alternative (requires: pip install numpy scipy)The demo prints the calculations covered above; its values match the worked examples in this skill. Run --help for a list of the classes and functions. For programmatic use, import the module rather than running it — the demo only executes under python forward_risk.py.
© JoelLewis, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (scripts) in plugins/wealth-management/skills/forward-risk of JoelLewis/finance_skills.
Open the folder on GitHubat commit 5c498ea
Forward Risk next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Forward Risk this skillJoelLewis/finance_skills | 205 | — | ~2.6k | Automated safety check: Pass | MIT | |
| Writing Livekit Scenarioslivekit-examples/agent-starter-python | 264 | 1 repos | ~2.5k | Automated safety check: Pass | MIT | |
| Go Testingcxuu/golang-skills | 172 | 1 repos | ~1.3k | Automated safety check: Pass | Apache-2.0 | |
| Goalcraftgrp06/goalcraft | 102 | — | ~3.8k | Automated safety check: Pass | MIT | |
| Thinking Partnermattnowdev/thinking-partner | 206 | — | ~4.4k | Automated safety check: Pass | MIT | |
| Visionkunchenguid/vision | 331 | — | ~2.9k | Automated safety check: Pass | MIT |
livekit-examples/agent-starter-python
Creates and maintains the scenarios a LiveKit agent simulation runs, and wires the agent to consume them.
cxuu/golang-skills
A skill your agent uses when writing, reviewing, or improving Go test code — including table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions with cmp.Diff.
grp06/goalcraft
Turn a rough draft, vague ambition, or messy task brief into a powerful Codex /goal objective for persistent, evidence-checked work.
mattnowdev/thinking-partner
A deterministic thinking partner that challenges assumptions and applies mental models to sharpen decisions, solve problems, and think more clearly.
kunchenguid/vision
Draft and stress-test a VISION.md for a repository, then iterate with the author on an interactive review board until approved.
owenHochwald/volt
Safely exercise and evaluate HTTP APIs with the Volt CLI, including authenticated requests, JSON bodies, staged load, machine-readable results, performance baselines, and before/after comparisons.
JoelLewis/finance_skills
Determine how to distribute capital across asset classes using strategic and tactical allocation frameworks.
JoelLewis/finance_skills
Determine how much capital to allocate to individual positions within a portfolio.
JoelLewis/finance_skills
Analyze commodity markets including futures curve dynamics, roll yield, and supply/demand fundamentals.
JoelLewis/finance_skills
Analyze currency markets, exchange rate mechanics, and FX risk management for international portfolios.
JoelLewis/finance_skills
Provide frameworks for managing and paying off personal debt effectively.
JoelLewis/finance_skills
Build diversified portfolios using correlation analysis, efficient frontier construction, and factor-based diversification.
Categories
Estimate potential future losses using VaR, Expected Shortfall, Monte Carlo simulation, and stress testing. Forward Risk is an agent skill from JoelLewis/finance_skills. Estimate potential future losses using VaR, Expected Shortfall, Monte Carlo simulation, and stress testing.
Forward Risk fits situations like: the user asks about Value-at-Risk; expected Shortfall; scenario analysis; factor-based risk decomposition.
Run `npx skills add JoelLewis/finance_skills --skill forward-risk -a claude-code`. Or copy the skill folder (plugins/wealth-management/skills/forward-risk in JoelLewis/finance_skills) into .claude/skills/forward-risk in your project. Claude Code loads it when a task matches its description.
Run `npx skills add JoelLewis/finance_skills --skill forward-risk -a codex`. Or copy the skill folder (plugins/wealth-management/skills/forward-risk in JoelLewis/finance_skills) into .agents/skills/forward-risk in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add JoelLewis/finance_skills --skill forward-risk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/forward-risk, .gemini/skills/forward-risk, .github/skills/forward-risk and .opencode/skills/forward-risk in your project.
Going by SKILL.md and its folder, Forward Risk needs Python for the scripts in its folder and the command-line tools its instructions call (uv, python3 and python). Our summary lists: Python 3.
SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Forward Risk is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Forward Risk: Writing Livekit Scenarios (livekit-examples/agent-starter-python, 264 stars), Go Testing (cxuu/golang-skills, 172 stars), Goalcraft (grp06/goalcraft, 102 stars) and Thinking Partner (mattnowdev/thinking-partner, 206 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
JoelLewis (a GitHub user) maintains it in JoelLewis/finance_skills, which has 205 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on July 18, 2026.
Source: JoelLewis/finance_skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.