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.
curl -O https://raw.githubusercontent.com/mbk-dev/okama-mcp/main/.agents/skills/stress-testing-portfolios/SKILL.mdgit clone --depth 1 https://github.com/mbk-dev/okama-mcpWrote 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.
[](https://agentmods.dev/skills/mbk-dev/okama-mcp/stress-testing-portfolios)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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.
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
- Gate the data.
poetry run python stress_test.py check SYM1 SYM2 ... --first 2010-02Reports 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. - If the episodes predate the floor, build a proxy from long-history indices at the same weights, paired sleeve-to-sleeve.
- Validate the proxy on the overlap —
stress_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. - Attribute every divergence to a named sleeve before explaining it —
stress_test.py attribute --first ... --last ..., one episode window at a time. The contributions must sum to the observed gap. - Replay the episodes, then calibrate scenario coefficients from those episodes.
- 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 |
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.
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.
- 5d ago First seen · 124 lines · 60 tokens per session scan A 527833e024e1
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.
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.
strategy-pivot-designer
Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.
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…
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.
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.
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.