Codex adapter note
This skill is generated from
skills/investment-team.md
so Claude Code and Codex users share one canonical workflow.
- Treat as the user's request in the current Codex thread.
- When the source mentions Claude-only surfaces such as Task, Agent, WebSearch, Bash, Read, or Write, use the closest Codex capability available in this session: subagents when available, web search when needed, shell commands for local tools, and normal file edits for workspace files.
- Use shared project tools from in this repository. Prefer running commands from the repository root with paths like
python3 tools/financial_rigor.py ...
; if the current thread starts outside the repo, locate the actual checkout path first instead of assuming a fixed home-directory path.
- Before starting research, run the command to confirm today's date; treat it as the baseline for "latest" data and state the data cutoff date in the report header. Never assume the current date from training data.
- Preserve the research quality rules from : cross-check financial data, use exact arithmetic tools for valuation/math, and clearly label uncertainty and source gaps.
Investment Research Team: Four-Role Parallel Analysis Framework
Conduct team-based investment research and analysis on $ARGUMENTS. Use the Team tool to create a true multi-Agent parallel research team.
Execution Process
Step 1: Present Team Framework
Present the following team structure to the user and start after confirmation:
| Role | Responsibilities | Analysis Framework |
|---|
| team-lead (yourself) | Overall coordination, summary and research, output final report | Synthesis Framework of Four Masters |
| business-analyst | Business model & moat analysis | Perspective of Duan Yongping |
| financial-analyst | Financial statement & valuation analysis | Perspective of Warren Buffett |
| industry-researcher | Industry structure & competitive landscape | Perspective of Charlie Munger |
| risk-assessor | Risk assessment & management research | Perspective of Li Lu |
Step 1.5: AI Research Bias Assessment
Before creating the team, present the "AI Research Feasibility" assessment of the company to the user:
Information Abundance Rating (determines research strategy):
| Rating | Characteristics | Research Strategy Adjustment |
|---|
| Grade A (Ample Information) | Listed for many years, extensive brokerage coverage | The team focuses on reverse verification and non-consensus perspectives, avoiding "correct nonsense" consistent with the market |
| Grade B (Moderate Information) | Recently listed, limited coverage | All calculated data by each Agent must be marked with confidence level, and the team-lead must mark "data sufficiency" during summary |
| Grade C (Scarce Information) | Niche/ newly listed/ emerging market | The team switches to "First Principles Mode": do not pursue report completeness, focus on several core issues of business essence |
Key Reminder: More information ≠ higher certainty, less information ≠ lower certainty. The confidence level AI can output ≠ the actual investment certainty. Certainty comes from the business model itself, not from the quantity of information.
Inform each Agent of the rating result to influence their research methods.
Step 1.75: WebSearch Permission Pre-check (Critical · Avoid Agent Silent Degradation)
Before creating the team and starting any background Agents, must first confirm that WebSearch permission is granted.
Why Pre-check is Necessary: This skill uses
to start 4 background sub-Agents, and
background Agents cannot pop up interactive permission confirmation to users. If
is not in the
whitelist of
.claude/settings.local.json
, the sub-Agents' web search will be
silently blocked, causing them to degenerate into answering based solely on training knowledge (with knowledge cutoff date), yet still output a "seemingly complete but actually unconnected" pseudo-research according to the framework — this is the most dangerous failure mode of this skill (see issue #58).
Pre-check Steps:
- Use Bash to check if the whitelist includes WebSearch:
bash
grep -l '"WebSearch"' .claude/settings.local.json ~/.claude/settings.local.json 2>/dev/null
- If neither location hits (i.e., not granted) → Stop, do not start Agents, prompt the user:
⚠️ Detected that WebSearch is not in the permission whitelist. Background research Agents cannot access the internet and will degenerate into answering based solely on training knowledge. Please add
to
in
.claude/settings.local.json
(or run
and check the box), then re-run this command.
- If hits → Proceed normally.
Step 2: Create Team
Use TeamCreate to create the team:
- team_name: (lowercase English, e.g., )
- agent_type:
Step 3: Create 4 Tasks
Use TaskCreate to create the following 4 tasks (each must have subject, description, activeForm):
Task 1: Business Model Analysis
- subject:
Analyze {company-name}'s business model, moat and user value
- description includes:
- Essence of business model: core business definition, revenue structure breakdown
- How platform/product flywheel effect operates
- Moat analysis: brand/switching cost/network effect/scale effect/technical barrier, verify one by one
- User/customer value: what unique value is created for all parties
- Business matrix and synergistic effect
- Assessment against Duan Yongping's "good business" standards: differentiation, pricing power, sustainable competitive advantage
- Require searching latest financial reports, industry reports and other public information
Task 2: Financial and Valuation Analysis
- subject:
Analyze {company-name}'s financial data, profitability and valuation
- description includes:
- Trends of revenue, net profit, operating profit in the past 3-5 years
- Profitability indicators: ROE, ROA, gross margin, operating profit margin
- Cash flow analysis: operating cash flow, free cash flow, capital expenditure
- Balance sheet health: cash reserves, debt ratio, liquidity
- Valuation analysis: PE/PS/PB/EV, comparison with historical and peer data
- Margin of safety assessment: intrinsic value vs current stock price
- Financial Rigor Verification (Must use Bash to call tools, no mental calculation allowed):
- Market capitalization verification:
python3 tools/financial_rigor.py verify-market-cap --price {price} --shares {shares} --reported {reported-market-cap} --currency {currency}
- Valuation verification:
python3 tools/financial_rigor.py verify-valuation --price {price} --eps {EPS} --bvps {book-value-per-share}
- Key data cross-validation:
python3 tools/financial_rigor.py cross-validate --field {field} --values '{JSON}' --unit {unit}
- Three-scenario valuation:
python3 tools/financial_rigor.py three-scenario --price {price} --eps {EPS} --shares {shares-in-billions} --growth {optimistic} {neutral} {pessimistic} --pe {optimistic-PE} {neutral-PE} {pessimistic-PE}
- Directly embed tool output results into the report as verification records
Task 3: Industry and Competition Analysis
- subject:
Analyze {industry}'s structure and {company-name}'s competitive landscape
- description includes:
- Industry scale and growth: market size, growth rate, penetration rate
- Competitive landscape: market share of major competitors, comparison of competitive strategies
- Core competitor threat assessment: analyze major competitors one by one
- Structure of each segmented track
- Industry trends: technological changes, policy impacts, new entrants
- Industry chain analysis: value distribution in upstream, midstream and downstream
- Require searching latest industry data and competitive dynamics
Task 4: Risk and Management Assessment
- subject:
Assess {company-name}'s investment risks and management quality
- description includes:
- Management assessment: CEO's circle of competence, integrity, strategic vision, capital allocation ability, quality of historical decisions
- Regulatory risk: current and potential regulatory impacts
- Competitive risk: assessment of threat levels from various competitors
- Business risk: losses from new businesses, expansion uncertainty
- Macro risk: impacts of economic cycle, industry cycle
- Governance structure: ownership structure, related party transactions, shareholder return policies
- Long-term certainty: What will the company be like in 10 years? What might disrupt its business model?
- Require searching latest regulatory dynamics, management statements, etc.
Step 4: Launch 4 Parallel Agents
Use the Task tool to launch 4 Agents simultaneously (must call the Task tool 4 times in the same message):
Configuration for each Agent:
- :
- :
- : Corresponding team name
- : Corresponding role name (business-analyst / financial-analyst / industry-researcher / risk-assessor)
Prompt template for each Agent:
You are the "{Chinese-role-name}" in the {company-name} investment research team, responsible for analyzing {company-name} from the investment perspective of {master-name}.
Please complete Task #{task-number}: {task-subject}
Specific requirements:
{content-of-task-description}
**Research Methods**:
- Use WebSearch to search for the latest public information (financial reports, industry reports, news)
- **Financial data must come from two independent sources**, follow the specifications in `skills/financial-data.md` (US stocks: macrotrends+stockanalysis; Hong Kong stocks: aastocks+macrotrends; A-shares: East Money+CNINFO; Taiwan stocks: FinMind `tools/twstock_data.py`+Goodinfo), mark if the error between the two sources exceeds 1%
- Ensure data accuracy, mark sources for key data
- Conduct in-depth analysis, avoid superficial content
- **Forbidden to fake network failure**: If WebSearch is blocked/unavailable, forbidden to pretend to have network results using training knowledge. Must prominently mark "⚠️ This report failed to access the internet, based on training knowledge (cutoff date X), confidence level downgraded" at the top of the report, and truthfully inform the team-lead, who will decide whether to terminate the research
**Output Requirements**:
- The report must be detailed, use Markdown tables to present key data
- Each analysis dimension must have clear conclusions and ratings
- Include an overall conclusion for this dimension at the end of the report
**After Completion**:
1. Use TaskUpdate to mark Task #{task-number} as completed
2. Send the complete analysis report to the team-lead via SendMessage (type: "message", recipient: "team-lead")
Step 5: Receive Reports and Track Progress
- Display a real-time progress table to the user (which Agents have completed, which are still researching)
- Update progress and display 3-5 core key points of the report each time a report is received
- Wait for all 4 reports to arrive
Step 6: Shut Down Team Members
After receiving all reports, send a shutdown_request to the 4 Agents (using SendMessage, type: "shutdown_request").
Step 7: Summarize Final Report
Synthesize the 4 analysis reports and output the final report with the following structure:
1. One-Sentence Conclusion
Summarize whether it is worth investing and the core logic in a paragraph (50-100 words)
2. Four-Dimension Rating Summary Table
| Dimension | Framework | Rating (1-5 stars) | Core Judgment |
|---|
Overall Rating: X / 5
3. Core Data Overview
Table of key financial and operating indicators (comparison of the past 2 years)
4. Analysis Summary by Dimension
Extract 3-5 most important findings from each dimension
5. Investment Arguments (Bull vs Bear)
- 🟢 Bull Case (5-7 points)
- 🔴 Bear Case (5-7 points)
6. Buffett's Pre-Buy Checklist
| # | Checklist Item | Pass? | Explanation |
10 core checklist items, evaluate one by one
7. Final Investment Recommendation
- Qualitative judgment table (business quality/management/valuation/timing)
- Tiered operation recommendation table (aggressive/conservative/very conservative → recommendation + price range)
- Key catalysts (3-5 points each for buy signals/sell signals)
8. Summary Paragraph
Final summary of 100-200 words
Step 8: Save Report
Write the complete final report to
~/{company-name}_Investment_Research_Report_{date}.md
(date format YYYYMMDD).
Step 9: Data Sampling Inspection (Exit Process)
bash
# Step 1 — Extract inspection list (15% random sampling)
python3 tools/report_audit.py extract \
--report <report-file-path>
# Step 2 — Fetch data for each item in the list from reliable sources (refer to skills/financial-data.md)
# Step 3 — Output approval/rejection verdict
python3 tools/report_audit.py verdict \
--results '<filled-JSON>' \
--report <report-file-name>
【Approval】 All passed → Report can be published; 【Rejection】 Any failed → Revise and re-review.
Step 10: Clean Up Team
Use TeamDelete to clean up team resources.
Important Notes
- 4 Agents must be launched in parallel — Call the Task tool 4 times in the same message
- Agents report via SendMessage — Not file collaboration, but message communication
- Data Accuracy — Require Agents to use WebSearch to search for the latest data, cross-validate key data
- Clear Conclusions — Do not avoid giving buy/hold/avoid recommendations and specific price ranges
- All analysis must be supported by data — Attach data sources
- Be Patient — 4 Agents need a few minutes for research, update progress to the user in real-time
- Anti-Bias Awareness — When summarizing, the team-lead must evaluate: Are the analyses of each Agent limited by information abundance? Are they excessively convergent with market consensus? The final report must include "Information Abundance Rating" and "AI Research Limitation Statement"
- Honesty Principle When Information is Scarce — It is better to leave blank and mark "insufficient data" in the report than to fill the framework with speculation to fake certainty