Analyze $ARGUMENTS to determine the research type and target, then execute the following command.
Execution Command
python3 /Users/kikuchihiroyuki/stock-skills/.claude/skills/market-research/scripts/run_research.py <command> <target>
Natural Language Routing
For natural language → skill determination, refer to .claude/rules/intent-routing.md .
Output by Research Type
stock (Stock Research)
- Basic Information + Valuation (yfinance)
- Latest News (yfinance)
- X Sentiment (Grok API)
- In-Depth Analysis: News, Earnings Materials, Analyst Views, Competitor Comparison (Grok API)
industry (Industry Research)
- Trends, Key Players, Growth Drivers, Risks, Regulatory Trends (Grok API)
market (Market Overview)
- Price Movements, Macro Factors, Sentiment, Notable Events, Sector Rotation (Grok API)
business (Business Model Analysis)
- Business Overview (What It Earns From)
- Business Segment Composition (Segment Name, Revenue Ratio, Overview)
- Revenue Model (Stock Type/Flow Type/Subscription, etc.)
- Competitive Advantage (Barriers to Entry, Brand, Technology, Moat)
- Key KPIs (Metrics Investors Should Watch)
- Growth Strategy (Medium-Term Management Plan, M&A, New Businesses)
- Business Risks (Structural Risks, Dependencies)
About the API
Grok API
- Use the Grok API only when the XAI_API_KEY environment variable is set
- When not set, generate the report using only yfinance data (for stock)
Two-Layer Structure
- Layer 1 (yfinance): Always available (fundamentals, stock price data)
- Layer 2 (Grok API): When XAI_API_KEY is set (in-depth analysis via X posts and Web search)
- industry / market / business require Layer 2. When not set, display that fact
API Status Summary (KIK-431)
Display the Grok API status at the end of each report:
| Status | Display |
|---|---|
| Normal | ✅ Normal |
| Not Set | 🔑 Not Set — Available when XAI_API_KEY is set |
| Authentication Error | ❌ Authentication Error (401) — Please check XAI_API_KEY |
| Rate Limit | ⚠️ Rate Limit (429) — Wait a while and retry |
| Timeout | ⏱️ Timeout — Check network connection |
| Other Errors | ❌ Error — Check stderr for details |
Output Supplement
After displaying the script output as-is, Claude should supplement the following:
For stock
- Check the consistency between fundamental data and Grok research
- Point out any divergence between value score and market sentiment
- Supplement with any additional context that affects investment decisions
In the case of industry
- Supplement with Japan-market-specific circumstances (regulatory environment, barriers to entry, etc.)
- Propose related stock screening (coordination with /screen-stocks)
In the case of market
- Estimate the impact on the portfolio (coordination with /stock-portfolio)
- Mention any similar past cases
In the case of business
- Consider the relationship between segment composition and stock valuation
- Sustainability of the revenue model (stock-based is stable, flow-based is highly sensitive to the economy, etc.)
- Check whether competitive advantage is reflected in actual financial indicators (ROE, profit margin, etc.)
/stock-reportSupplement consistency with fundamentals together with the results of
Execution example
# 銘柄リサーチ
python3 .../run_research.py stock 7203.T
python3 .../run_research.py stock AAPL
# 業界リサーチ
python3 .../run_research.py industry 半導体
python3 .../run_research.py industry "Electric Vehicles"
# マーケットリサーチ
python3 .../run_research.py market 日経平均
python3 .../run_research.py market "S&P500"
# ビジネスモデル分析
python3 .../run_research.py business 7751.T
python3 .../run_research.py business AAPL
Prior knowledge integration rules (KIK-466)
If the output of get_context.py contains the following, integrate it with the research results and respond:
- Relationship with held stocks: If there are portfolio holdings in the sector being researched, "there is an impact on the 7203.T you hold → health check recommended"
- Past research (SUPERSEDES): Compare with the previous research on the same subject. "Previous (2 weeks ago): sentiment neutral → this time: somewhat bullish"
- Investment notes: If there are concerns or theses about the target stock, suggest updates by cross-checking with the research results
- Watchlist: If the research target is on the watchlist, add context such as "watched stock → material for buy-timing judgment"
Prompting recording of analysis conclusions
When a stock/business/industry research response contains a conclusion with a view or thesis on a stock:
💡 This analysis has not yet been recorded as an investment note. Would you like to record it as a thesis/concern?