Monte Carlo Analysis logo

Monte Carlo Analysis

Organization
microsoft
monte-carlo-analysis

Use this skill whenever the user asks to run a Monte Carlo simulation, model risk or uncertainty with random sampling, estimate P5/P50/P95 outcomes, or produce a probability distribution for project timelines, portfolio returns, downtime, costs, or similar uncertain variables. Trigger on phrases like 'run a Monte Carlo', 'simulate outcomes', 'probability chart for best and worst case', or when they give min/most-likely/max (or mean/std) and want thousands of iterations. Do NOT trigger for deterministic forecasts with no uncertainty, or for generic charts unrelated to simulation.

Overview

Publishermicrosoft
Repositorycat-agent-skills
Skill namemonte-carlo-analysis
Stars
95
Forks
115
Bundled files
9
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 9 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by microsoft on GitHub. Read the source before you install it.

Installation

Install the Monte Carlo Analysis AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/microsoft/cat-agent-skills/tree/main/submissions/monte-carlo-analysis
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/microsoft/cat-agent-skills.git /tmp/cat-agent-skills
mkdir -p .claude/skills
cp -r /tmp/cat-agent-skills/submissions/monte-carlo-analysis .claude/skills/monte-carlo-analysis
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Monte Carlo Analysis in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Monte Carlo Analysis on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Monte Carlo Analysis is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Convert an unstructured risk question into a structured Monte Carlo run via the bundled scripts/monte_carlo.py toolkit. Sample from the right distribution, summarise percentiles, and return a histogram PNG plus spreadsheet export. Offer an interactive HTML chart when the user asks for it.

Instructions

  1. Cognitive intake. Detect the core question (timeline, financial risk, yield, downtime, claims, etc.). If the user did not give enough numbers to parameterise a distribution, stop and ask — do not invent bounds. Prompt with the distribution options below.

  2. Choose a distribution:

    • Triangular — user gives Minimum, Most Likely (peak), Maximum.
    • Normal — user gives Mean and Std Dev (optional base_modifier for portfolio / compounding style: outcome = base * (1 + return)).
    • Uniform — every value between Minimum and Maximum is equally likely.
    • Log-normal — non-negative, right-skewed risks; user gives log-scale mean and sigma. Highlight the Mean vs P50 gap when skew is large.
    • Poisson — count of rare events in a fixed interval; user gives lambda (expected count per interval, e.g. outages per month).
    • Weibull — time-to-failure / reliability; user gives shape (k) and scale (λ). Shape < 1 → infant mortality, = 1 → exponential, > 1 → wear-out.
    • Beta — bounded probability [0, 1] or percentage; user gives alpha and beta. Useful for proportions, conversion rates, or task-completion estimates.
    • Exponential — memoryless inter-arrival times; user gives scale (mean = 1 / rate). Good for time between random events (calls, failures, requests).
  3. Defaults. If simulations are unspecified, use 10000. Prefer a clear chart_title and x_axis_label in the user's domain units (days, USD, hours).

  4. Execute with the toolkit (import or CLI). Always produce:

    • Summary stats: mean, P5, P50, P95
    • PNG histogram with P5 / P50 / P95 marker lines
    • CSV of all iterations (opens in Excel)

    Also produce when asked:

    • Interactive HTML — self-contained Chart.js page with live sliders per distribution parameter, a simulations count slider, and a P-threshold calculator (P(outcome < X) = ?)
    • .xlsx workbook (requires openpyxl; otherwise point them to the CSV)
python
import sys
sys.path.insert(0, "scripts")
from monte_carlo import simulate

result = simulate({
    "distribution": "triangular",
    "low": 12, "peak": 18, "high": 45,
    "simulations": 10000,
    "chart_title": "Cloud migration duration (days)",
    "x_axis_label": "Days",
    "html": True,          # optional interactive Chart.js page with live controls
    "excel": True,         # optional .xlsx (falls back to CSV if openpyxl missing)
    "out_prefix": "simulation",
})
# result keys: mean, p5, p50, p95, brief_summary, chart_path, csv_path, …
  1. Present results in domain language:

    • P5 = downside / late / risk baseline
    • P50 = median expectation
    • P95 = optimistic / upper ceiling (or severe upside for cost/risk)
    • Show or link the PNG; mention CSV/Excel paths; offer HTML if not requested yet.
    • Always end with a brief summary (2–3 sentences). Prefer result["brief_summary"] from the toolkit; you may lightly rephrase it into the user's domain (days, dollars, hours) without changing the numbers.
  2. Response layout (adapt labels to the domain):

markdown
### Simulation Analytics Report
Ran {simulations} iterations ({distribution}).

| Metric | Value |
| --- | --- |
| P5 (risk baseline) | {p5} |
| P50 (median) | {p50} |
| P95 (upper) | {p95} |
| Mean | {mean} |

Histogram: {chart_path}
Raw iterations: {csv_path}

### Brief summary
{brief_summary}

Guardrails

  • Never run the script when required parameters are missing — ask first.
  • Do not fabricate distribution parameters or claim false precision.
  • Prefer the bundled toolkit over hand-rolled NumPy each time, for consistent charts and exports.
  • Keep LLM replies to the summary payload; do not dump all iteration rows into chat.

Bundled files

  • scripts/monte_carlo.py — simulation engine, PNG, CSV/Excel, interactive HTML
  • references/cheatsheet.md — parameters, CLI, test prompts
  • assets/sample_triangular.json — demo payload (project timeline)
  • assets/sample_normal.json — demo payload (portfolio returns)
  • assets/sample_lognormal.json — demo payload (skewed downtime)
  • assets/sample_poisson.json — demo payload (event count per interval)
  • assets/sample_weibull.json — demo payload (component lifetime)
  • assets/sample_exponential.json — demo payload (time between arrivals)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Monte Carlo Analysis AI skill do?

Use this skill whenever the user asks to run a Monte Carlo simulation, model risk or uncertainty with random sampling, estimate P5/P50/P95 outcomes, or produce a probability distribution for project timelines, portfolio returns, downtime, costs, or similar uncertain variables. Trigger on phrases like 'run a Monte Carlo', 'simulate outcomes', 'probability chart for best and worst case', or when they give min/most-likely/max (or mean/std) and want thousands of iterations. Do NOT trigger for deterministic forecasts with no uncertainty, or for generic charts unrelated to simulation.

Why use Monte Carlo Analysis on TypingMind?

Because you install it once and use it with any model. Monte Carlo Analysis is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Monte Carlo Analysis in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/microsoft/cat-agent-skills/tree/main/submissions/monte-carlo-analysis. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Monte Carlo Analysis?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Monte Carlo Analysis?

As many as you like. As long as a model supports skills, you can use Monte Carlo Analysis with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Monte Carlo Analysis AI skill free?

Yes. It is published on GitHub by microsoft under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇