Agent skill

Portfolio Stress Test

by okikusan-public in okikusan-public/stock_skills

Stress-tests a stock portfolio: takes a list of holdings, applies macro scenarios and reports shock sensitivity, concentration, correlation, VaR and causal chains.

No licenceAuto-check passedBusiness, Finance & HR

SKILL.md written in Japanese; this summary is our English description.

Install Portfolio Stress Test

skills CLI
$ npx skills add okikusan-public/stock_skills --skill stress-test -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install okikusan-public/stock_skills stress-test --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/okikusan-public/stock_skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/stress-test .claude/skills/stress-test && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
stress-test
GitHub stars
135
Token cost
~814 tokens
SKILL.md length
158 words
Files
2 (incl. scripts)
Skills in repo
9
Repo updated
First seen
Licence
None found

At a glance

Stress-tests a stock portfolio: takes a list of holdings, applies macro scenarios and reports shock sensitivity, concentration, correlation, VaR and causal chains.

  • Works in 8 steps: ポートフォリオ概要 → 集中度分析 → ショック感応度スコア → …
  • Finding the weak points in a stock portfolio
  • SKILL.md covers 実行コマンド, 自然言語ルーティング, 引数の解釈ルール and シナリオ一覧, plus 3 more sections
  • Runs Python scripts from its folder; calls python3

What it does

The skill turns the request into a comma-separated list of ticker symbols, optional holding weights and an optional scenario, then runs scripts/run_stress_test.py. Company names such as Toyota are converted to tickers first, weights can be decimals or percentages and default to an equal split, and the built-in scenarios include a triple decline in stocks, currency and bonds, a stronger dollar against the yen, a US recession, a Bank of Japan rate hike, US-China tension, renewed inflation, a tech crash and a stronger yen. A custom scenario can be described in plain language.

Results follow a ten-step pipeline: portfolio overview, concentration analysis with sector, region and currency HHI, a shock sensitivity score per holding built from beta, financial health and valuation resilience, scenario definition with macro changes, per-holding impact estimates and the total portfolio loss, correlation analysis with factor regression and high-correlation pairs, VaR at 95% and 99% from a year of daily returns, cause-and-effect chains across sectors, and an overall verdict with recommended actions and hedge candidates.

The agent adds qualitative explanations for correlations the factor model leaves unexplained, keeping statistical findings and inferred causes clearly separate. The skill text is written in Japanese.

When your agent uses it

  • Finding the weak points in a stock portfolio
  • Estimating losses under a scenario such as a US recession or a stronger yen
  • Checking concentration and correlation risk among holdings

Example prompts

  • “Stress-test 7203.T, AAPL and D05.SI weighted 50%, 30% and 20% under a tech crash.”
  • “Which scenario hurts my holdings most if the Bank of Japan raises rates?”
  • “Run a stress test on Toyota and Apple and show where the portfolio is most concentrated.”

Requirements

  • Python 3, to run scripts/run_stress_test.py
  • Pre-approved tools (allowed-tools): Bash(python3 *)

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. ポートフォリオ概要
  2. 集中度分析
  3. ショック感応度スコア
  4. シナリオ定義
  5. 銘柄別インパクト推定
  6. ポートフォリオ全体インパクト
  7. 因果連鎖分析
  8. 総合判定 + 推奨アクション(KIK-352)

What it can do on your machine

Read from SKILL.md and the folder at commit 6bc1be2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(python3 *)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Portfolio Stress Test loads about 814 tokens when it runs. Until then it costs about 19 tokens; SKILL.md has 158 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~19
When it runs · the whole SKILL.md, loaded when a task matches
~814

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

Without a licence we can't republish the file, so here is its outline and opening line. It has 158 words (~814 tokens).

name
stress-test
allowed-tools
Bash(python3 *)
argument-hint
[銘柄リスト] [--scenario SCENARIO] 例: 7203.T,AAPL,D05.SI --scenario トリプル安

Read the full SKILL.md on GitHub

Files

SKILL.md and 1 other file (scripts) in .claude/skills/stress-test of okikusan-public/stock_skills.

  • SKILL.md
  • scripts/run_stress_test.py

Open the folder on GitHubat commit 6bc1be2

Compare with similar skills

Portfolio Stress Test next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Portfolio Stress Test compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Portfolio Stress Test this skillokikusan-public/stock_skills135—~814Automated safety check: PassNone
Eastmoney Market DataHKUDS/Vibe-Trading35k—~1kAutomated safety check: PassMIT
SEC EDGAR Filings FetcherHKUDS/Vibe-Trading35k—~1.4kAutomated safety check: PassMIT
A-Share Daily Reviewqusong0627/QuantMind1.7k—~1.9kAutomated safety check: PassAGPL-3.0
Financial Researchfirecrawl/web-agent1.2k—~1.1kAutomated safety check: PassMIT
Alpha Desk Investment ResearchJingHao-Leon/dsh-alpha-desk181—~1.3kAutomated safety check: NotesMIT

Similar skills

  • Eastmoney Market Data

    HKUDS/Vibe-Trading

    Index of Eastmoney's free, no-token market data interfaces for China A-shares and Hong Kong stocks: fund flows, dragon-tiger lists, margin trading, reports and news.

    35k GitHub stars~1k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • SEC EDGAR Filings Fetcher

    HKUDS/Vibe-Trading

    Fetches U.S. SEC EDGAR data: resolves tickers to CIK numbers, lists recent 10-K, 10-Q and 8-K filings with document URLs, and pulls XBRL financial series.

    35k GitHub stars~1.4k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • A-Share Daily Review

    qusong0627/QuantMind

    Produces a post-market review report for the China A-share market from local QuantDB data, news sentiment and model signals, ending in a next-day direction call.

    1.7k GitHub stars~1.9k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Financial Research

    firecrawl/web-agent

    Pulls a public company's latest 10-K or 10-Q figures and analyst consensus from SEC EDGAR and Yahoo Finance, then cross-checks the two sources.

    1.2k GitHub stars~1.1k tokensUpdated 5 mo ago
    Business, Finance & HRAuto-check passed
  • Alpha Desk Investment Research

    JingHao-Leon/dsh-alpha-desk

    Runs an AI investment research desk around the aihf hedge-fund CLI, with research cycles, backtests and iFinD data, under a risk gate and a rule against placing real trades.

    181 GitHub stars~1.3k tokensUpdated 18 days ago
    Business, Finance & HRAuto-check: notes
  • Quant Buddy Market Data and Backtesting

    pseudo-longinus/quant-buddy-skills

    Queries A-share, Hong Kong and US stock quotes, valuation and financial data through the Quant Buddy API, and runs screening, factor calculation and strategy backtests.

    193 GitHub stars~11k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed

More from okikusan-public/stock_skills

All 9 skills in this repo
  • Market and Stock Deep Research

    okikusan-public/stock_skills

    Produces deep-dive reports on a stock, industry, market or business model by combining yfinance data with Grok API searches of X and the web.

    135 GitHub stars~739 tokensUpdated 5 mo ago
    Auto-check passed
  • Value Stock Screener

    okikusan-public/stock_skills

    Screens for undervalued stocks across about 60 regions with yfinance's EquityQuery, using ratios such as PER, PBR, dividend yield and ROE, with optional theme filters.

    135 GitHub stars~2.4k tokensUpdated 5 mo ago
    Auto-check passed
  • Stock Portfolio Manager

    okikusan-public/stock_skills

    Manages a stock portfolio through a Python command line: snapshots with profit and loss, buy and sell records, structure analysis, health checks and trade reviews.

    135 GitHub stars~2.4k tokensUpdated 5 mo ago
    Auto-check passed
  • Stock and ETF Report

    okikusan-public/stock_skills

    Generates a financial report for one stock or ETF from its ticker, with valuation scores for stocks and expense ratio and fund-size ratings for ETFs.

    135 GitHub stars~370 tokensUpdated 5 mo ago
    Auto-check passed
  • Plan Mode Orchestrator

    okikusan-public/stock_skills

    Runs a seven-agent planning workflow, started by asking for plan mode, that designs, executes, loops and reviews analysis work for stock portfolio decisions.

    135 GitHub stars~2.5k tokensUpdated 5 mo ago
    Auto-check passed
  • Graph Query

    okikusan-public/stock_skills

    知識グラフへの自然言語クエリ。過去のレポート・スクリーニング・取引・リサーチ・市況を検索. An agent skill from okikusan-public/stock_skills.

    135 GitHub stars~153 tokensUpdated 5 mo ago
    Auto-check passed

Questions about Portfolio Stress Test

What does Portfolio Stress Test do?

Stress-tests a stock portfolio: takes a list of holdings, applies macro scenarios and reports shock sensitivity, concentration, correlation, VaR and causal chains. py. Company names such as Toyota are converted to tickers first, weights can be decimals or percentages and default to an equal split, and the built-in scenarios include a triple decline in stocks, currency and bonds, a stronger dollar against the yen, a US recession, a Bank of Japan rate hike, US-China tension, renewed inflation, a tech crash and a stronger yen.

When should I use Portfolio Stress Test?

Portfolio Stress Test fits situations like: finding the weak points in a stock portfolio; estimating losses under a scenario such as a US recession or a stronger yen; checking concentration and correlation risk among holdings.

How do I install Portfolio Stress Test in Claude Code?

Run `npx skills add okikusan-public/stock_skills --skill stress-test -a claude-code`. Or copy the skill folder (.claude/skills/stress-test in okikusan-public/stock_skills) into .claude/skills/stress-test in your project. Claude Code loads it when a task matches its description.

How do I install Portfolio Stress Test in Codex?

Run `npx skills add okikusan-public/stock_skills --skill stress-test -a codex`. Or copy the skill folder (.claude/skills/stress-test in okikusan-public/stock_skills) into .agents/skills/stress-test in your project. Codex loads it when a task matches its description.

Can I use Portfolio Stress Test in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add okikusan-public/stock_skills --skill stress-test -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/stress-test, .gemini/skills/stress-test, .github/skills/stress-test and .opencode/skills/stress-test in your project.

What does Portfolio Stress Test need to run?

Going by SKILL.md and its folder, Portfolio Stress Test needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3, to run scripts/run_stress_test.py. Its frontmatter pre-approves these tools: Bash(python3 *).

Does Portfolio Stress Test access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Portfolio Stress Test safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Portfolio Stress Test use?

No licence was found for Portfolio Stress Test or its repository. Without one, default copyright applies: ask the author before reusing or redistributing it.

How many tokens does Portfolio Stress Test use?

About 814 tokens (SKILL.md is roughly 3.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Portfolio Stress Test?

Skills that share tags, products or a category with Portfolio Stress Test: Eastmoney Market Data (HKUDS/Vibe-Trading, 35k stars), SEC EDGAR Filings Fetcher (HKUDS/Vibe-Trading, 35k stars), A-Share Daily Review (qusong0627/QuantMind, 1.7k stars) and Financial Research (firecrawl/web-agent, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Portfolio Stress Test?

okikusan-public (a GitHub user) maintains it in okikusan-public/stock_skills, which has 135 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on April 25, 2026.

Source: okikusan-public/stock_skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.