okama-mcp: Skill for Claude Code

.agents/skills/stress-testing-portfolios/SKILL.md

stress-testing-portfolios is a skill for Claude Code, Codex from mbk-dev/okama-mcp. It costs 60 tokens per session (1,687 once invoked), scanned A, original, MIT.

A portfolio stress-testing workflow that checks how investments might behave during past crises or future currency, inflation, and interest-rate shocks. A portfolio is a collection of investments; backtesting compares it with historical data.

In plain words
What is it for?
Use it to test portfolios across crisis periods, model economic shocks, and handle funds that did not exist for the full period by using a stated proxy.
Why use it?
It exposes missing or frozen price history and unit mistakes before they distort conclusions about withdrawals, survival time, or taxes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is mbk-dev/okama-mcp's own configuration. It tells Claude Code and Codex how to work on okama-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything okama-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to mbk-dev/okama-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/mbk-dev/okama-mcp/main/.agents/skills/stress-testing-portfolios/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/mbk-dev/okama-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for stress-testing-portfolios

README.md
[![agentmods](https://agentmods.dev/badge/skills/mbk-dev/okama-mcp/stress-testing-portfolios/github.svg)](https://agentmods.dev/skills/mbk-dev/okama-mcp/stress-testing-portfolios)
Your own site
<a href="https://agentmods.dev/skills/mbk-dev/okama-mcp/stress-testing-portfolios"><img src="https://agentmods.dev/badge/skills/mbk-dev/okama-mcp/stress-testing-portfolios/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for stress-testing-portfolios

Your own site · 80×15
<a href="https://agentmods.dev/skills/mbk-dev/okama-mcp/stress-testing-portfolios"><img src="https://agentmods.dev/badge/skills/mbk-dev/okama-mcp/stress-testing-portfolios.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,687 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00060 $0.01687
Opus 5 $0.00030 $0.00843
Sonnet 5 $0.00012 $0.00337
Haiku 4.5 $0.00006 $0.00169

Measured 5d ago against content hash 527833e024e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

stress-testing-portfolios scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (stress_test.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/stress-testing-portfolios/SKILL.md · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Stress-Testing Portfolios

Overview

A stress test is only as good as the series underneath it. The wrong answers in this work are rarely modelling errors — they are data defects and unit slips the arithmetic absorbs silently: a history window that quietly shrank, a fund whose price was frozen for two years, a nominal withdrawal measured against a real portfolio value.

Run the mechanical gates first, then apply judgment. Both halves are below; neither substitutes for the other.

When to Use

  • Backtesting a portfolio across crisis episodes (1998, 2008, 2014-16, 2022)
  • Modelling a currency devaluation, inflation regime or rate shock forward
  • Any portfolio holding funds (БПИФ/ETF) younger than the episodes tested
  • Withdrawal sustainability, survival horizon or tax-consequence questions

Not for: single-asset return lookups, portfolio optimisation, or plain Monte Carlo (call monte_carlo_forecast directly).

Workflow

  1. Gate the data. poetry run python stress_test.py check SYM1 SYM2 ... --first 2010-02 Reports the binding history floor and every frozen price run. Do not walk past a finding — resolve it, or state it and its direction of bias in the report.
  2. If the episodes predate the floor, build a proxy from long-history indices at the same weights, paired sleeve-to-sleeve.
  3. Validate the proxy on the overlapstress_test.py validate. Full window and each calendar year; an annual outlier is where the defects hide. An unvalidated proxy replay is not a result.
  4. Attribute every divergence to a named sleeve before explaining itstress_test.py attribute --first ... --last ..., one episode window at a time. The contributions must sum to the observed gap.
  5. Replay the episodes, then calibrate scenario coefficients from those episodes.
  6. Run the forward scenarios and report a range, not a point.

Gates the Script Runs

Gate What it catches Why it exists
History floor okama truncates first_date to the intersection of all series, without raising or warning first_date=2010-02 on a basket containing LQDT.MOEX silently returns 2020-02 — 120 months shorter. A "2014-16 replay" would have been computed entirely on post-2020 data
Frozen series runs of an unchanged monthly close SBCB.MOEX sat at 1055.0 for 22 months (2022-02..2023-11: trading suspended, underlying eurobonds blocked), reading as a flat 0% return
Proxy validation a proxy that does not track the actual catches sleeve substitutions that drift
Gap attribution a divergence explained by a story instead of a sleeve the fact/proxy gap was first blamed on "the proxy runs hot"; per-sleeve attribution put the bulk of it on the frozen SBCB — the fact understated, the proxy did not overstate. Opposite sign, opposite conclusion
Rebalance thresholds which threshold binds, per sleeve see below

Read the full file on GitHub · 124 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 124 lines · 60 tokens per session scan A 527833e024e1

Subscribe to this mod's changes

stress-testing-portfolios is a skill published in the GitHub repository mbk-dev/okama-mcp (4 stars, last pushed 10d ago), licensed MIT. It adds 60 tokens to every session and 1,687 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other skills, from other repositories

sector-rotation

An analysis framework for comparing industries in the Chinese A-share stock market, using business conditions, price momentum, valuation, and money flows. It produces rankings and higher- or lower-allocation suggestions.

HKUDS/Vibe-Trading · 39 tokens

strategy-pivot-designer

Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.

tradermonty/claude-trading-skills · 28 tokens

twitter-reader

Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…

himself65/finance-skills · 161 tokens

chenhao-limit-up

A framework for judging Chinese A-share stocks that have reached the daily price-rise limit, using market mood, sector leadership, and trading momentum.

questflowai/investorskills · 44 tokens

trading-risk-gate

Unified pre-trade safety gate: Ruin check (Law #1), ergodicity audit, and win-rate dominance validation. Absorbs: ergodicity-check, law-of-ruin, win-rate-dominance.

winstonkoh87/Athena-Public · 53 tokens

furusato

A Japanese hometown-tax donation manager for furusato nozei, a system where donations to municipalities can qualify for an income-tax or local-tax deduction. It reads donation receipts, stores donation records, and calculates deduction limits.

kazukinagata/shinkoku · 102 tokens