agentleFS
efaslantasefaslantas/claude-finops/.claude/skills/monte-carlo/SKILL.md

monte-carlo

Skill2 starsChanged 5 months agoMITView on GitHub

Monte Carlo simulation for portfolio/retirement/accumulation planning. Runs 1000 price paths using Geometric Brownian Motion, computes percentile outcomes (10th/50th/90th), probability of reaching a target, and expected shortfall. No external code runner needed — Claude computes analytically.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read output/latest.json for current portfolio value if not specified.

    line 48
  2. Very specific:

    If target_value specified: P(portfolio > target at year T) = paths above target / N.

    line 83
  3. Distinctive:

    Disclaimer: All projections are probabilistic estimates based on historical return/volatility assumptions.

    line 109

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Monte Carlo Simulator

Trigger phrases

  • "10 yıllık portföy simülasyonu yap"
  • "Emeklilik planlaması — 20 yıl, aylık $1000 katkı"
  • "Monte Carlo: ₺1M portföy, 5 yıl hedef"
  • "Altın alımını simüle et — 50g/yıl, 10 yıl"
  • "What's the probability my portfolio reaches ₺2M in 5 years?"
  • "Run Monte Carlo: [asset] [years] [monthly contribution]"

Input parameters

ParameterDescriptionDefault
yearsSimulation horizonrequired
initial_valueStarting portfolio value (TRY)from latest.json
monthly_contributionMonthly addition (TRY, can be 0)0
annual_returnExpected annual return (decimal)asset-class default
annual_volatilityAnnual volatility (decimal)asset-class default
target_valueTarget to compute probability foroptional
n_pathsNumber of paths1000

Default return/volatility by asset class (use as base, state explicitly)

Asset classμ (annual)σ (annual)
BIST equities18%28%
US equities (USD)10%18%
Gold (TRY)22%20%
TRY cash40%5%
Crypto (BTC)35%70%
Balanced portfolio15%15%

Adjust based on current macro context (high inflation → higher TRY returns but higher vol).

Phases

Phase 1 — Parameter setup

Read output/latest.json for current portfolio value if not specified. Determine asset mix and blended μ/σ from portfolio composition. State all assumptions explicitly.

Phase 2 — Analytical Monte Carlo

GBM formula for each annual step:

S(t+1) = S(t) × exp((μ - σ²/2)×Δt + σ×√Δt×Z)
where Z ~ N(0,1)

Since Claude cannot generate true random numbers, use a deterministic quasi-random sequence (Halton sequence base 2 and 3) to simulate N=1000 paths across T years. For each path, iterate year by year, applying the GBM formula and adding monthly contributions compounded at the annual rate (simplified: monthly_contribution × 12 × ((1+μ)^t - 1)/μ).

Phase 3 — Percentile outcomes

At each year t, compute across all paths:

  • P10 (pessimistic): 10th percentile
  • P50 (median): 50th percentile
  • P90 (optimistic): 90th percentile

Present as a table:

Year | P10 (₺)  | P50 (₺)  | P90 (₺)
   1 | 780,000  | 920,000  | 1,100,000
   3 | 650,000  | 1,150,000| 1,800,000
   5 | 540,000  | 1,450,000| 2,800,000
  10 | 380,000  | 2,800,000| 8,200,000

Phase 4 — Target probability

If target_value specified: P(portfolio > target at year T) = paths above target / N.

Phase 5 — Risk metrics

  • Expected shortfall (CVaR@5%): average of bottom 5% of paths at year T
  • Max drawdown (median path): largest peak-to-trough decline
  • Break-even year: first year where P50 > initial_value
  • CAGR (median path)

Phase 6 — Scenario comparison

Run 3 versions:

  1. Current portfolio (as-is)
  2. With rebalance applied (if rebalance_needed from latest.json)
  3. With +₺5,000/month contribution

Phase 7 — Output

Write output/montecarlo-<YYYYMMDD>.md:

# Monte Carlo Simulation — <Horizon> Year Outlook
## Assumptions
## Year-by-Year Outcomes (P10 / P50 / P90)
## Target Probability: P(≥₺X at year T) = Y%
## Risk Metrics
## Scenario Comparison
## Interpretation Guide

Disclaimer: All projections are probabilistic estimates based on historical return/volatility assumptions. Past performance does not guarantee future results. Not investment advice.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.