Token导航 LogoToken导航

Agent Skill · 待分类

forward-risk(远期风险)

forward-risk 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

forward-risk 是待分类类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在待分类类的 11,209 个 Skill 里排第 2,187。

总安装 1,788周安装 76GitHub Stars 58下载 626核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:forward-risk(远期风险)
来源仓库:https://github.com/joellewis/finance_skills
仓库路径:skills/forward-risk
安装命令:
npx skills add https://github.com/joellewis/finance_skills --skill forward-risk
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/joellewis/finance_skills --skill forward-risk

这个 Skill 是做什么的

这个 Skill 的分类还没最终确定,用法以来源仓库的说明为准。

forward-risk 用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。适合围绕代码变更、仓库状态或协作事项进行整理。可帮助跟踪 Issue 进展或生成 PR 摘要。使用时需确认 GitHub 访问权限和 API 调用限制。建议结合具体项目验证其对仓库结构的理解能力。

forward-risk 属于待分类类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/forward-risk

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/joellewis/finance_skills --skill forward-risk;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

forward-risk 怎么安装?

在终端执行 npx skills add https://github.com/joellewis/finance_skills --skill forward-risk。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

forward-risk 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

forward-risk 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

forward-risk 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

forward-risk 用的人多吗?

公开数据是累计安装 1,788 次,近一周安装 76 次,下载 626 次,GitHub 58 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

forward-risk 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理待分类类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

待分类类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
infsh-cli

infsh CLI · Codex、Claude

4,374,576382权限未标注未明确未收录
ai-video-generation

AI 视频生成 · Codex、Claude

4,313,376382调用外部服务未明确有提醒
lark-openapi-explorer

云雀 OpenAPI 浏览器 · Codex、Claude

2,064,1209,011需要联网未明确有提醒
lark-workflow-standup-report

Lark 工作流程站立报告 · Codex、Claude

2,041,6328,978需要联网未明确通过
use-my-browser

使用我的浏览器 · Codex、Claude

1,848,49140操作浏览器未明确未通过
forward-risk

远期风险 · 本页

1,78858需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Forward-Looking Risk Analysis

Purpose

Estimate potential future losses and risk exposures using parametric models, simulation, and scenario analysis. This skill covers parametric and Monte Carlo Value-at-Risk, Conditional VaR (Expected Shortfall), component and marginal VaR, stress testing, scenario analysis, and factor-based risk decomposition. These tools are essential for portfolio risk management and regulatory capital calculations.

Layer

1b — Forward-Looking Risk

Direction

Prospective

When to Use

  • Estimating potential future losses for a portfolio or position
  • Computing parametric VaR (variance-covariance method) for normally distributed returns
  • Running Monte Carlo simulations to estimate VaR for non-normal distributions
  • Computing CVaR / Expected Shortfall to understand tail risk beyond VaR
  • Decomposing portfolio risk into component and marginal contributions
  • Performing scenario analysis with historical or hypothetical shocks
  • Stress testing portfolios under extreme but plausible conditions
  • Breaking down risk into systematic factor risk and idiosyncratic risk

Core Concepts

Parametric (Variance-Covariance) VaR

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_p

where:

  • W = portfolio value
  • z_alpha = z-score for confidence level (1.645 for 95%, 2.326 for 99%)
  • sigma_p = portfolio volatility over the relevant horizon

More generally, including expected return:

VaR_alpha = mu - z_alpha * sigma

To convert from 1-day VaR to h-day VaR (assuming i.i.d. returns):

VaR_h = VaR_1 * sqrt(h)

Portfolio VaR (Multiple Assets)

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.

Monte Carlo VaR

Simulate a large number of portfolio return scenarios (e.g., 10,000+), then take the alpha-percentile of the simulated loss distribution.

Steps:

  1. Estimate the return distribution parameters (mean vector, covariance matrix, or use a copula model).
  2. Generate N random return scenarios (e.g., via Cholesky decomposition of the covariance matrix for multivariate normal).
  3. Compute portfolio return for each scenario.
  4. Sort results and identify the alpha-percentile loss.

Monte Carlo VaR can accommodate non-normal distributions, fat tails, path-dependent instruments, and nonlinear payoffs (e.g., options).

Conditional VaR (CVaR) / Expected Shortfall

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.

Component VaR

Decomposes total portfolio VaR into contributions from each position. Component VaRs sum to total VaR.

CVaR_i = w_i * beta_i * VaR_p

where 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_p

This decomposition identifies which positions are the largest contributors to portfolio risk.

Marginal VaR

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_p

Marginal VaR is used for position sizing: adding to a position with low marginal VaR reduces portfolio risk more efficiently.

Scenario Analysis

Apply specific historical or hypothetical market moves to the current portfolio to estimate P&L impact.

  • Historical scenarios: Replay actual market events (e.g., 2008 GFC, 2020 COVID crash, 2022 rate hiking cycle) with current holdings.
  • Hypothetical scenarios: Construct custom shocks (e.g., "equities -20%, rates +200bp, credit spreads +300bp, USD +10%").

Scenario P&L is computed by applying the scenario returns to current position exposures and revaluing.

Stress Testing

A structured framework for assessing portfolio resilience under extreme but plausible conditions.

Common stress scenarios:

  • Equity crash: S&P 500 -30% to -40%
  • Interest rate shock: +300bp parallel shift
  • Credit crisis: investment-grade spreads +200bp, high-yield +800bp
  • Liquidity freeze: bid-ask spreads widen 10x, forced selling at discount
  • Currency shock: major currency pair moves 15-20%
  • Stagflation: inflation +5%, GDP -3%, rates +200bp

Stress tests should include second-order effects: margin calls, liquidity demands, correlation spikes, counterparty risk.

Factor-Based Risk Decomposition

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:

  • b = vector of portfolio factor exposures
  • Sigma_f = factor covariance matrix
  • sigma^2_epsilon_i = idiosyncratic variance of asset i

Common factor models: Fama-French (market, size, value, momentum), Barra risk models, PCA-based statistical factors.

Key Formulas

FormulaExpressionUse Case
Parametric VaR (single)W * z_alpha * sigmaSimple position VaR
Portfolio VaRW * z_alpha * sqrt(w' * Sigma * w)Multi-asset VaR
Multi-day VaRVaR_1 * sqrt(h)Scale to h-day horizon
CVaR (normal)mu + sigma * phi(z_alpha) / (1 - alpha)Expected tail loss
Component VaRw_i * beta_i * VaR_pRisk contribution per position
Marginal VaRz_alpha * (Sigma * w)_i / sigma_pSensitivity to weight change
Factor Riskb' * Sigma_f * bSystematic risk component
Idiosyncratic Risksum(w_i^2 * sigma^2_epsilon_i)Security-specific risk

Worked Examples

Example 1: Parametric 95% VaR

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.00945

1-day 95% VaR:

VaR = $1,000,000 * 1.645 * 0.00945 = $15,545

Alternatively, computing directly from annual figures:

VaR_annual = $1,000,000 * 1.645 * 0.15 = $246,750
VaR_1day   = $246,750 / sqrt(252)       = $15,545

Interpretation: There is a 5% chance of losing more than $15,545 in a single day under normal market conditions.

Example 2: Monte Carlo VaR

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:

  1. Construct covariance matrix:
Sigma = | 0.0324  -0.0018 |
        | -0.0018  0.0025 |
  1. Cholesky decomposition of Sigma to get lower triangular matrix L.
  2. Simulate 10,000 scenarios: For each simulation, draw z ~ N(0, I), compute r = mu + L*z, then portfolio return R_p = w' * r.
  3. Compute portfolio P&L for each scenario: P&L = $1,000,000 * R_p.
  4. 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.01105)
        = 10.51%

VaR_95% = $1,000,000 * 1.645 * 0.1051 = $172,890

The Monte Carlo result should converge to approximately this value for a multivariate normal assumption.

Example 3: Expected Shortfall

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,000

Interpretation: When losses exceed the 95% VaR threshold, the average loss is $225,000. This is 30% worse than the VaR figure, highlighting the severity of tail events.

Common Pitfalls

  • VaR says nothing about tail shape: VaR only identifies a threshold. Two portfolios with identical VaR can have vastly different tail losses. Always compute CVaR alongside VaR to understand tail severity.
  • Parametric VaR assumes normality: Financial returns exhibit fat tails and skewness. Parametric VaR systematically underestimates tail risk. Use Monte Carlo with fat-tailed distributions or historical simulation for more realistic estimates.
  • Correlation breakdown in crises: Correlations spike toward 1.0 during market stress, precisely when diversification is most needed. Stress tests should use crisis-period correlations, not calm-period correlations.
  • Using too short a lookback for covariance estimation: Too short a window is noisy; too long a window includes stale data from different market regimes. A common compromise is 1-3 years of daily data, or use EWMA-weighted covariances.
  • Not distinguishing between absolute VaR and relative VaR: Absolute VaR includes expected return (VaR = -mu + z*sigma); relative VaR excludes it (VaR = z*sigma). For short horizons (1-10 days), the expected return is negligible and the distinction is minor. For longer horizons, it matters.
  • Square-root-of-time scaling limitations: VaR_h = VaR_1 * sqrt(h) assumes i.i.d. returns. With serial correlation or volatility clustering, this scaling is inaccurate.

Cross-References

  • historical-risk (wealth-management plugin, Layer 1a): Historical VaR and realized volatility serve as non-parametric alternatives and calibration benchmarks for the forward-looking models in this skill.
  • performance-metrics (wealth-management plugin, Layer 1a): VaR and CVaR can be used as risk denominators in modified risk-adjusted ratios (e.g., return/CVaR).
  • volatility-modeling (wealth-management plugin, Layer 1b): EWMA and GARCH volatility forecasts provide the volatility inputs (sigma) for parametric and Monte Carlo VaR.

Reference Implementation

See scripts/forward_risk.py for computational helpers.

平台分布

Codex

38.4%
按下载量换算240

Claude

28.18%
按下载量换算176

Cursor

18.84%
按下载量换算118

Gemini CLI

10.72%
按下载量换算67

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills