risk
Skill3 starsChanged 47 days agoMITView on GitHub
Risk analysis for trading strategies including Kelly criterion calculations, tail risk metrics, Monte Carlo projections, stress testing, and drawdown attribution. Use when exploring position sizing, capital allocation, or understanding worst-case characteristics.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- ruujOnChain/HedgeFund-Skillstheir own version, first seen Nov 8, 2026
- arunendapally/portfolio-copilottheir own version, first seen Nov 1, 2026
- tradeblocks-org/tradeblocks-skillsword for word, first seen Sep 28, 2026
- hailneed/agent-blackboxtheir own version, first seen Aug 19, 2026
- Olayeeeyo/claude-skillstheir own version, first seen Apr 5, 2026
Other versions5 projects use a version of this.
Word for word · 1
- tradeblocks-org/tradeblocks-skills★ 3100% same
Edited · 0
None found.
Wrote their own version · 4
- ruujOnChain/HedgeFund-Skills★ 17same name
- arunendapally/portfolio-copilot★ 0same name
- hailneed/agent-blackbox★ 0same name
- Olayeeeyo/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- compareSkill
- dc-analysisSkill
- health-checkSkill
- is-this-optimum-realSkill
- market-dataSkill
- oo-captureSkill
- optimizeSkill
- portfolioSkill
- profileSkill
- wfaSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 5 are distinctive, and 11 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Ask: "What aspect of risk would you like to explore?"
- Very specific: line 37
Call get_position_sizing with the user's capital base.
- Very specific: line 61
Call stress_test to see how the portfolio performed during named historical stress scenarios.
- Very specific: line 84
Call run_monte_carlo for probabilistic projections:
- Very specific: line 102
Call drawdown_attribution to identify what caused the worst drawdown.
- Very specific: line 119
Call get_tail_risk for extreme co-movement analysis (requires 2+ strategies).
- Very specific: line 134
Call what_if_scaling to explore how allocation changes affect risk metrics.
- Distinctive: line 143
Before/after portfolio metrics comparison
- Very specific: line 197
Run get_position_sizing with capitalBase: 100000
- Distinctive: line 205
Look at joint tail risk matrix for high values
- Distinctive: line 206
Check effective factors (closer to 1 = more correlated risk)
- Very specific: line 211
Run stress_test for historical named scenarios
- Very specific: line 212
Run run_monte_carlo with worst-case injection for probabilistic projection
- Very specific: line 213
Run drawdown_attribution to understand what drove the historical worst
- Very specific: line 218
Run what_if_scaling with proposed weights
- Distinctive: line 220
Check if the change improves risk-adjusted returns or just shifts risk
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Risk Analysis
Explore risk characteristics and position sizing metrics for trading strategies.
Prerequisites
- TradeBlocks MCP server running
- Block with trade data (10+ trades minimum for meaningful metrics)
Process
Step 1: Understand User Goals
Risk analysis serves different purposes. Ask what the user wants to understand:
| Goal | Primary Tool | Also Consider |
| "What does Kelly suggest?" | get_position_sizing | Monte Carlo for drawdown context |
| "What are worst-case scenarios?" | run_monte_carlo | stress_test for named scenarios |
| "How did I do during COVID/bear markets?" | stress_test | Drawdown attribution |
| "What caused my biggest drawdown?" | drawdown_attribution | Tail risk for future risk |
| "How correlated are my strategies?" | get_tail_risk | Position sizing per strategy |
| "What if I change allocations?" | what_if_scaling | Marginal contribution |
Ask: "What aspect of risk would you like to explore?"
Then use list_blocks to identify the target block.
Step 2: Position Sizing (Kelly Criterion)
Call get_position_sizing with the user's capital base.
Key parameters:
capitalBase: Starting capital (required)kellyFraction: "full", "half" (default), or "quarter"maxAllocationPct: Cap per strategy (default: 25%)minTrades: Minimum trades for valid calculation (default: 10)sortBy: Sort by "kelly", "winRate", "payoffRatio", "allocation", "name"useMarginReturns: Use percentage returns based on margin (better for compounding strategies)
Tool returns:
- Win rate and payoff ratio (inputs to Kelly formula)
- Raw Kelly percentage (what the formula suggests)
- Adjusted allocations at full/half/quarter Kelly
- Per-strategy breakdown if multiple strategies exist
- Warnings (e.g., "Portfolio Kelly exceeds 25%", "negative Kelly")
Important context for Kelly:
- Full Kelly is mathematically optimal but assumes perfect knowledge of edge
- Half Kelly is commonly used to account for estimation uncertainty
- Negative Kelly indicates historical losses exceeded wins (Kelly formula doesn't apply)
Step 3: Stress Testing
Call stress_test to see how the portfolio performed during named historical stress scenarios.
Key parameters:
blockId: Block folder namescenarios: Optional list of specific scenario names (omit for all built-in scenarios)customScenarios: User-defined scenarios with custom date rangesincludeEmpty: Include scenarios with no trades (default: false)
Tool returns per scenario:
- Scenario name and date range
- Trade count, win rate, net P&L during that period
- Profit factor and max drawdown
Present as a stress test table:
| Scenario | Dates | Trades | Win Rate | Net P&L | Max DD |
| ... | ... | ... | ... | ... | ... |
Key insight: If a strategy had zero trades during a stress period, it had no exposure — that's important context (either it didn't exist yet, or its filters kept it out).
Step 4: Monte Carlo Projections
Call run_monte_carlo for probabilistic projections:
Key parameters:
includeWorstCase: Enable worst-case injection (default: true)worstCasePercentage: Percentage of worst-case trades (default: 5%)worstCaseMode: "pool" (adds to resample pool) or "guarantee" (ensures worst appears)resampleMethod: "trades" (default), "daily", or "percentage" (for compounding)simulationLength: Number of trades/days to project forwardnormalizeTo1Lot: Normalize for fair comparison across position sizes
Focus on:
- 5th percentile outcome (valueAtRisk.p5)
- Probability of profit
- Mean and median max drawdown
- Distribution of terminal equity
Step 5: Drawdown Attribution
Call drawdown_attribution to identify what caused the worst drawdown.
Key parameters:
blockId: Block folder namestrategy: Optional filtertopN: Number of top contributors (default: 5)
Tool returns:
- Drawdown period (peak date to trough date)
- Peak and trough equity values
- Per-strategy P&L attribution during the drawdown
- Percentage contribution to total loss
This answers "which strategies caused the most pain" during the worst period.
Step 6: Tail Risk (Multi-Strategy)
Call get_tail_risk for extreme co-movement analysis (requires 2+ strategies).
Key parameters:
tailThreshold: Percentile for "tail" events (default: 0.1 = worst 10%)varianceThreshold: For effective factors calculation (default: 0.8)normalization: "raw", "margin", or "notional"
Tool returns:
- Joint tail risk matrix (do strategies fail together?)
- Effective factors (how many independent risk sources exist)
- Risk level: LOW (<0.3), MODERATE (0.3-0.5), HIGH (>0.5)
- Copula correlation (statistical dependency structure)
Step 7: What-If Scaling
Call what_if_scaling to explore how allocation changes affect risk metrics.
Key parameters:
blockId: Block folder namestrategyWeights: Weight per strategy (e.g.,{"StrategyA": 0.5, "StrategyB": 1.5})strategies: Multi-strategy mode with per-strategy block source and scale factorshowUncapped: Also show results without maxContractsPerTrade ceiling
Tool returns:
- Before/after portfolio metrics comparison
- Per-strategy breakdown at new weights
- Profile-aware: respects contract ceilings from profiles
Common questions this answers:
- "What if I removed this underperforming strategy?"
- "What if I doubled my best performer?"
- "What if I halved everything during high VIX?"
Step 8: Present Findings
Synthesize findings into what the data reveals:
Position Sizing Metrics:
- Win rate: [value]% | Payoff ratio: [value]
- Kelly formula suggests: [value]% (based on historical data)
- At half Kelly: [dollar amount] of [capital base]
- [Any warnings from the tool]
Stress Test Results:
- [Worst scenario]: [P&L and drawdown during that period]
- [Best scenario]: [how the strategy held up]
- Scenarios with no exposure: [list]
Monte Carlo Projections:
- 5th percentile return: [value]
- Probability of profit: [value]%
- Mean max drawdown: [value]%
Drawdown Attribution:
- Worst drawdown: [peak] to [trough] ([magnitude])
- Primary contributor: [strategy] at [percentage] of total loss
Tail Risk (if applicable):
- Average joint tail risk: [value] ([LOW/MODERATE/HIGH])
- Effective factors: [value] of [strategy count]
- [Note any high-risk pairs]
What stands out:
- [Highlight notable findings]
- [Surface any warnings from the tools]
- [Note relationships between metrics]
Present these as insights from the historical data, letting the user decide what fits their situation.
Interpretation References
- references/kelly-guide.md - Kelly criterion explained
- references/tail-risk.md - Understanding fat tails
Common Scenarios
"I have $100,000 - what does Kelly suggest?"
- Run
get_position_sizingwithcapitalBase: 100000 - Review the Kelly percentages and warnings
- Surface both raw Kelly and half-Kelly figures
- Note that Kelly assumes independent trades and known edge
"Do my strategies fail together?"
- Run
get_tail_risk - Look at joint tail risk matrix for high values
- Check effective factors (closer to 1 = more correlated risk)
- High correlation means drawdowns may compound
"What's the worst realistic outcome?"
- Run
stress_testfor historical named scenarios - Run
run_monte_carlowith worst-case injection for probabilistic projection - Run
drawdown_attributionto understand what drove the historical worst - Combine: stress tests show what happened, Monte Carlo shows what might happen
"Should I change my allocations?"
- Run
what_if_scalingwith proposed weights - Compare before/after Sharpe, drawdown, net P&L
- Check if the change improves risk-adjusted returns or just shifts risk
Related Skills
After risk analysis:
/tradeblocks:health-check- Full metrics overview/tradeblocks:portfolio- Correlation and diversification analysis/tradeblocks:wfa- Test parameter robustness
Notes
- Kelly assumes independent trades; real trades may be correlated
- Historical volatility may underestimate future extremes
- Monte Carlo resamples history - it can't predict unknown risks
- Stress tests only cover known historical scenarios
- Negative Kelly means the formula doesn't apply (no positive edge in historical data)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

