一键导入
stock-portfolio
Portfolio management. Display holdings, record trades, and analyze portfolio structure. Input data foundation for stress tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Portfolio management. Display holdings, record trades, and analyze portfolio structure. Input data foundation for stress tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Natural language queries to the knowledge graph. Search past reports, screenings, trades, research, and market context.
Investment note management. Record, retrieve, and delete investment theses, concerns, and lessons.
Deep research on stocks, industries, markets, and business models. Integrates Grok API (X/Web search) and yfinance for multi-angle analysis reports.
Plan Mode — Orchestrator oversees workflow design, execution, autonomous loop, and review. Activated when told "in plan mode."
Undervalued stock screening. EquityQuery-based screening without a predefined stock list. Searches for undervalued stocks across 60+ regions including Japan, US, ASEAN, Hong Kong, Korea, and Taiwan using P/E, P/B, dividend yield, ROE, and more.
Detailed report for individual stocks and ETFs. Generates a financial analysis report from a ticker symbol. Individual stocks show valuation, undervaluation score, and shareholder return rate. ETFs show expense ratio, AUM, and fund size.
| name | stock-portfolio |
| description | Portfolio management. Display holdings, record trades, and analyze portfolio structure. Input data foundation for stress tests. |
| argument-hint | [command] [args] e.g.: snapshot, buy 7203.T 100 2850, sell AAPL 5, analyze, list |
| allowed-tools | Bash(python3 *) |
Parse $ARGUMENTS to determine the command and execute it as shown below.
python3 /Users/kikuchihiroyuki/stock-skills/.claude/skills/stock-portfolio/scripts/run_portfolio.py <command> [args]
Generates a portfolio snapshot including current prices, P/L, and currency conversions.
python3 .../run_portfolio.py snapshot
python3 .../run_portfolio.py buy --symbol <sym> --shares <n> --price <p> [--currency JPY] [--date YYYY-MM-DD] [--memo text] [--yes]
Omitting --yes (-y) displays a confirmation preview of the purchase and exits. Specifying --yes skips confirmation and records directly (KIK-444).
python3 .../run_portfolio.py sell --symbol <sym> --shares <n> [--price <sale price>] [--date YYYY-MM-DD] [--yes]
Omitting --yes (-y) displays a confirmation preview (cost basis, estimated realized P/L) and exits. Specifying --yes skips confirmation and records directly (KIK-444).
Specifying --price calculates and displays realized P/L, P/L ratio, and estimated after-tax amount, and saves to data/history/trade/*.json (KIK-441).
Aggregates and displays P/L statistics from past sale records (those recorded with --price).
python3 .../run_portfolio.py review [--year 2026] [--symbol NVDA]
Output:
Calculates sector/region/currency/size HHI (Herfindahl index) and analyzes portfolio bias. Includes a 4-axis analysis with size composition table (large/mid/small/ETF/unknown) (KIK-438, KIK-469 P2: ETF classification). ETFs are independently classified as sector "ETF" and size "ETF."
python3 .../run_portfolio.py analyze
Checks whether the investment thesis for each holding is still valid. Outputs 3-level alerts across multiple axes: technical (SMA50/200, RSI, Golden Cross/Dead Cross detection) and fundamental (change quality score, shareholder return stability). Small-cap stocks are automatically escalated in sensitivity (KIK-438).
python3 .../run_portfolio.py health
Technical Analysis (KIK-356/374/438):
Shareholder Return Stability (KIK-403):
Small-Cap Allocation (KIK-438):
[small] badgeETF Health Check (KIK-469 Phase 2):
Alert Levels:
Generates specific adjustment actions (SELL/SWAP/ADD/TRIM_CLASS/FLAG) using 17 rules (P1-P10: per-position, F1-F7: PF-wide) based on health check results + market regime determination.
python3 .../run_portfolio.py adjust [--full]
CLI options:
--full: Full analysis mode (includes concentration and correlation analysis. Higher API load)Output:
Regime adjustment: During crash, urgency is raised one level. During bear, small-cap and downtrend rules are elevated.
Analyzes current portfolio structure and presents proposals for reducing concentration risk and adjusting toward target allocation.
python3 .../run_portfolio.py rebalance [options]
CLI options:
--strategy defensive|balanced|aggressive (default: balanced)--reduce-sector SECTOR (e.g., Technology)--reduce-currency CURRENCY (e.g., USD)--max-single-ratio RATIO (e.g., 0.15)--max-sector-hhi HHI (e.g., 0.25)--max-region-hhi HHI (e.g., 0.30)--additional-cash AMOUNT (JPY, e.g., 1000000)--min-dividend-yield YIELD (e.g., 0.03)Estimates 12-month expected return for each holding in 3 scenarios (optimistic/base/pessimistic) from analyst target prices or historical return distributions. Includes value trap warnings and TOP/BOTTOM rankings.
python3 .../run_portfolio.py forecast
Estimation methods:
[ETF] badge)growth_driver catalyst count × 1.7% to optimistic scenario, subtracts risk catalyst count × 1.7% from pessimistic scenario (max ±10%)Output structure (KIK-390):
Simulates adding, selling, or swapping stocks and displays the impact on the portfolio as a Before/After comparison.
# Add only (traditional)
python3 .../run_portfolio.py what-if --add "SYMBOL:SHARES:PRICE[,...]"
# Swap (sell then buy) (KIK-451)
python3 .../run_portfolio.py what-if --remove "SYMBOL:SHARES[,...]" --add "SYMBOL:SHARES:PRICE[,...]"
# Sell-only simulation (KIK-451)
python3 .../run_portfolio.py what-if --remove "SYMBOL:SHARES[,...]"
CLI options:
--add: List of stocks to add (optional). Format: SYMBOL:SHARES:PRICE comma-separated--remove: List of stocks to sell (optional). Format: SYMBOL:SHARES comma-separated (no price needed — calculated at market value)--add or --remove is requiredOutput:
--remove is specified, automatically displays screening appearance count, investment memos, and research history before the simulation (when Neo4j connected)Verifies returns from accumulated screening results and compares against benchmarks (Nikkei 225 / S&P 500).
python3 .../run_portfolio.py backtest [options]
CLI options:
--preset PRESET: Screening preset to verify (e.g., alpha, value)--region REGION: Region to verify (e.g., jp, us)--days N: Verifies return N days after retrieval (default: 90)Output:
Simulates future asset growth with compound interest based on the current portfolio. Calculates compound interest using forecast expected returns + dividend reinvestment + monthly accumulation, displayed in 3 scenarios (optimistic/base/pessimistic).
python3 .../run_portfolio.py simulate [options]
CLI options:
--years N (simulation years, default: 10)--monthly-add AMOUNT (monthly accumulation, JPY, default: 0)--target AMOUNT (target amount, JPY, e.g., 15000000)--reinvest-dividends (reinvest dividends, default: ON)--no-reinvest-dividends (do not reinvest dividends)Displays the contents of portfolio.csv as-is.
python3 .../run_portfolio.py list
For natural language → skill selection, see .claude/rules/intent-routing.md.
.claude/skills/stock-portfolio/data/portfolio.csvDisplay results in Markdown format.
[small] badge) / P/L ratio / Trend / Cross event / Change quality / Alert / Long-term suitability / Return stability[ETF] badge# Snapshot
python3 .../run_portfolio.py snapshot
# Record purchase
python3 .../run_portfolio.py buy --symbol 7203.T --shares 100 --price 2850 --currency JPY --date 2025-06-15 --memo Toyota
# Record sale
python3 .../run_portfolio.py sell --symbol AAPL --shares 5
# Structural analysis
python3 .../run_portfolio.py analyze
# List holdings
python3 .../run_portfolio.py list
# Health check
python3 .../run_portfolio.py health
# Estimated yield
python3 .../run_portfolio.py forecast
# Rebalancing proposal
python3 .../run_portfolio.py rebalance
python3 .../run_portfolio.py rebalance --strategy defensive
python3 .../run_portfolio.py rebalance --reduce-sector Technology --additional-cash 1000000
# What-If simulation (add only)
python3 .../run_portfolio.py what-if --add "7203.T:100:2850,AAPL:10:250"
# What-If simulation (swap: sell 7203.T → buy 9984.T) (KIK-451)
python3 .../run_portfolio.py what-if --remove "7203.T:100" --add "9984.T:50:7500"
# What-If simulation (sell only) (KIK-451)
python3 .../run_portfolio.py what-if --remove "7203.T:50"
# Adjustment advisor (KIK-496)
python3 .../run_portfolio.py adjust
python3 .../run_portfolio.py adjust --full
# Backtest
python3 .../run_portfolio.py backtest --preset alpha --region jp --days 90
When get_context.py output contains the following, integrate with health check results:
When the response includes specific judgments about EXIT/warnings (e.g., "sell recommended," "continue holding"):
💡 Would you like to record this judgment as an investment memo?