Analyze your portfolio to identify concentration risks, calculate Value at Risk, estimate drawdowns, beta, Sharpe ratio, income, run stress tests, and sugges...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install afrexai-portfolio-risk或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install afrexai-portfolio-risk⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/afrexai-portfolio-risk/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
Complete investment portfolio risk management system. Analyze positions, calculate risk metrics, stress test scenarios, optimize allocations, and generate institutional-grade risk reports — all without external APIs.
---
When the user shares their portfolio (positions, tickers, amounts), structure it into this format:
portfolio:
name: "User Portfolio"
currency: USD
as_of: "2026-02-15"
positions:
- ticker: AAPL
shares: 50
avg_cost: 185.00
current_price: 228.50 # Look up via web search
asset_class: US_EQUITY
sector: Technology
- ticker: BTC
units: 0.5
avg_cost: 42000
current_price: 97500
asset_class: CRYPTO
sector: Digital Assets
- ticker: VOO
shares: 100
avg_cost: 410.00
current_price: 535.00
asset_class: US_EQUITY_ETF
sector: Broad Market
cash:
amount: 15000
currency: USD
For each position, use web search to find current price:
[TICKER] stock price today[COIN] price USD today| Position | Shares | Cost Basis | Current Value | Weight | P&L | P&L % | |----------|--------|-----------|---------------|--------|-----|-------| | AAPL | 50 | $9,250 | $11,425 | 18.2% | +$2,175 | +23.5% | | ... | ... | ... | ... | ... | ... | ... | | TOTAL | | $XX,XXX | $XX,XXX | 100% | ±$X,XXX | ±X.X% |
---
Calculate ALL of the following for every portfolio analysis:
Position Concentration:
- Any single position >20% of portfolio = HIGH RISK ⚠️
- Any single position >10% = MODERATE RISK
- Top 3 positions >50% = CONCENTRATED
Sector Concentration:
- Any sector >30% = OVERWEIGHT
- Count unique sectors — fewer than 4 = UNDER-DIVERSIFIED
Asset Class Breakdown:
- Equities: X%
- Fixed Income: X%
- Crypto: X%
- Cash: X%
- Alternatives: X%
Calculate the maximum expected loss at given confidence levels:
Daily VaR Calculation:
1. Look up each position's historical volatility (annualized)
- Use web search: "[TICKER] historical volatility 30 day"
- Typical ranges: Large cap stocks 15-25%, Crypto 50-80%, Bonds 5-10%
2. Convert to daily volatility:
Daily Vol = Annual Vol / √252
3. Position VaR (95% confidence):
Position VaR = Position Value × Daily Vol × 1.645
4. Position VaR (99% confidence):
Position VaR = Position Value × Daily Vol × 2.326
5. Portfolio VaR (simplified — assumes correlation ≈ 0.5 for stocks):
Portfolio VaR ≈ √(Σ(Position VaR²) + 2×0.5×Σ(VaR_i × VaR_j))
Report:
- 1-Day 95% VaR: $X,XXX (X.X% of portfolio)
- 1-Day 99% VaR: $X,XXX (X.X% of portfolio)
- 10-Day 95% VaR: $X,XXX (= 1-Day VaR × √10)
- Monthly 95% VaR: $X,XXX (= 1-Day VaR × √21)
Based on asset class historical max drawdowns:
- US Large Cap: -50% (2008-09), typical correction -20%
- US Small Cap: -55%, typical correction -25%
- International Equity: -55%, typical -25%
- Emerging Markets: -65%, typical -30%
- Investment Grade Bonds: -15%, typical -5%
- High Yield Bonds: -30%, typical -10%
- REITs: -70%, typical -25%
- Crypto (BTC): -85%, typical -50%
- Gold: -45%, typical -15%
- Cash: 0%
Portfolio Max Drawdown Estimate:
= Σ(Position Weight × Asset Class Max Drawdown)
Report:
- Estimated worst-case drawdown: -$XX,XXX (XX.X%)
- Estimated typical correction: -$XX,XXX (XX.X%)
- Recovery time estimate: X-X months (based on historical averages)
For each equity position:
- Look up beta via web search: "[TICKER] beta"
- Portfolio Beta = Σ(Position Weight × Position Beta)
Interpretation:
- Beta > 1.2: Portfolio is AGGRESSIVE (amplifies market moves)
- Beta 0.8-1.2: Portfolio is NEUTRAL
- Beta < 0.8: Portfolio is DEFENSIVE
- Negative beta positions: HEDGE value
Market Impact:
- If S&P 500 drops 10%, portfolio expected to move: Beta × -10%
Portfolio Expected Return = Σ(Weight × Expected Return)
Where Expected Return by asset class:
- US Large Cap: 8-10% annually
- US Small Cap: 9-11%
- International Developed: 6-8%
- Emerging Markets: 8-12%
- Investment Grade Bonds: 4-5%
- High Yield: 6-7%
- Crypto: highly variable (use 0% for conservative estimate)
- REITs: 7-9%
- Cash: current money market rate (~4.5%)
Risk-Free Rate: current 3-month T-bill rate (search if needed)
Sharpe Ratio = (Portfolio Expected Return - Risk-Free Rate) / Portfolio Volatility
Rating:
- > 1.0: EXCELLENT risk-adjusted returns
- 0.5-1.0: GOOD
- 0-0.5: MEDIOCRE — consider rebalancing
- < 0: POOR — return doesn't justify risk
For dividend-paying positions:
- Look up dividend yield: "[TICKER] dividend yield"
- Annual Income = Shares × Annual Dividend per Share
- Portfolio Yield = Total Annual Dividends / Portfolio Value
Report:
- Monthly estimated income: $XXX
- Annual estimated income: $X,XXX
- Yield on cost: X.X%
- Current yield: X.X%
---
Run these scenarios against the portfolio and report impact:
scenarios:
market_crash_2008:
name: "2008 Financial Crisis"
impacts:
US_EQUITY: -0.50
INTL_EQUITY: -0.55
EMERGING: -0.60
BONDS: +0.05
HIGH_YIELD: -0.30
REITS: -0.70
CRYPTO: -0.80 # projected based on risk profile
GOLD: +0.10
CASH: 0
covid_crash_2020:
name: "COVID-19 Crash (Feb-Mar 2020)"
impacts:
US_EQUITY: -0.34
INTL_EQUITY: -0.35
EMERGING: -0.35
BONDS: +0.03
HIGH_YIELD: -0.20
REITS: -0.40
CRYPTO: -0.50
GOLD: -0.05
CASH: 0
dot_com_2000:
name: "Dot-Com Bust (2000-2002)"
impacts:
US_EQUITY: -0.45
TECH: -0.75 # Apply to technology sector specifically
INTL_EQUITY: -0.40
BONDS: +0.15
CASH: 0
rate_hike_shock:
name: "Rapid Rate Hike (+300bps)"
impacts:
US_EQUITY: -0.15
BONDS: -0.15
HIGH_YIELD: -0.10
REITS: -0.25
CRYPTO: -0.20
GOLD: -0.10
CASH: +0.01 # higher yields
inflation_surge:
name: "Stagflation (persistent 8%+ inflation)"
impacts:
US_EQUITY: -0.20
BONDS: -0.20
CRYPTO: -0.10 # debatable hedge
GOLD: +0.15
REITS: -0.05
COMMODITIES: +0.20
CASH: -0.03 # real value erosion
crypto_winter:
name: "Crypto Winter (80% drawdown)"
impacts:
CRYPTO: -0.80
US_EQUITY: -0.05 # minor contagion
For each scenario:
📉 SCENARIO: [Name]
| Position | Current Value | Stressed Value | Loss |
|----------|--------------|----------------|------|
| AAPL | $11,425 | $5,713 | -$5,712 |
| ... | ... | ... | ... |
| TOTAL | $XX,XXX | $XX,XXX | -$XX,XXX (-XX.X%) |
Could you survive this? [YES/NO based on cash reserves and income needs]
Recovery estimate: X-X months
If user describes a specific worry, build a custom scenario:
User: "What if tech crashes 40% but bonds rally?"
→ Build custom impact map, apply to portfolio, report results
---
Compare current allocation to standard models:
AGGRESSIVE (Age <35, high risk tolerance):
Equities: 80-90%, Bonds: 5-10%, Alternatives: 5-10%, Cash: 2-5%
GROWTH (Age 35-50):
Equities: 60-75%, Bonds: 15-25%, Alternatives: 5-10%, Cash: 5%
BALANCED (Age 50-60):
Equities: 40-60%, Bonds: 30-40%, Alternatives: 5-10%, Cash: 5-10%
CONSERVATIVE (Age 60+, income focus):
Equities: 20-40%, Bonds: 40-50%, Alternatives: 5%, Cash: 10-20%
Current allocation matches: [MODEL] profile
Recommended adjustments: [specific moves]
...
安装 Portfolio Risk Analyzer 后,可以对 AI 说这些话来触发它
Help me get started with Portfolio Risk Analyzer
Explains what Portfolio Risk Analyzer does, walks through the setup, and runs a quick demo based on your current project
Use Portfolio Risk Analyzer to analyze your portfolio to identify concentration risks, calculate V...
Invokes Portfolio Risk Analyzer with the right parameters and returns the result directly in the conversation
What can I do with Portfolio Risk Analyzer in my finance & investment workflow?
Lists the top use cases for Portfolio Risk Analyzer, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/afrexai-portfolio-risk/ 目录(个人级,所有项目可用),或 .claude/skills/afrexai-portfolio-risk/(项目级)。重启 AI 客户端后,用 /afrexai-portfolio-risk 主动调用,或让 AI 根据上下文自动发现并使用。
Portfolio Risk Analyzer 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Portfolio Risk Analyzer 可免费安装使用。请查阅仓库了解许可证信息。
Analyze your portfolio to identify concentration risks, calculate Value at Risk, estimate drawdowns, beta, Sharpe ratio, income, run stress tests, and sugges...
Portfolio Risk Analyzer 属于「Finance & Investment」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my finance & investment tasks using Portfolio Risk Analyzer
Identifies repetitive steps in your workflow and sets up Portfolio Risk Analyzer to handle them automatically