SuperAPI AI Directory

investment-research

Writing & research

View repository

Updated 10-15 17:17

About this skill

Codex adapter note

This skill is generated from skills/investment-research.md so Claude Code and Codex users share one canonical workflow.

  • Treat $ARGUMENTS 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 tools/ 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 date 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 AGENTS.md: cross-check financial data, use exact arithmetic tools for valuation/math, and clearly label uncertainty and source gaps.
Investment Research: Buffett-Munger-Duan Yongping-Li Lu Four Masters Comprehensive Analysis Framework

Conduct systematic investment research analysis on $ARGUMENTS.

Research Framework

Based on the methodologies of four investment masters—Buffett, Munger, Duan Yongping, and Li Lu—execute the research in the following order across seven modules:

Preliminary Step: Awareness of AI Research Bias (Mandatory)

Before starting the research, first assess the company's "AI researchability" and identify potential data biases:

Information Richness Rating:

Grade Characteristics AI Research Trap Countermeasure
Grade A (Information Abundant) Listed for many years, covered by many brokerages, intensive media coverage Consensus is too strong; AI output converges with market pricing, limited alpha Focus on reverse testing: Why don't smart people buy it? What risks are being overlooked?
Grade B (Information Moderate) Listed for 1-3 years, limited coverage, some data requires estimation AI may fill gaps with "reasonable speculation," appearing complete but actually creating false certainty Mark confidence level for each estimated data point, distinguishing "evidence-based estimation" from "fabricated filler"
Grade C (Information Scarce) Recently listed/obscure stock/emerging market, almost no coverage AI will be overly conservative due to insufficient materials, misjudging it as "unclear = bad" Use first-principles questioning (see below) to extract the business essence from limited information

First-Principles Research Method for Grade C Companies: When public information is insufficient, do not try to piece together a report that "looks complete"; instead, focus on the following underlying questions:

  1. Who are the customers? Why do they pay? Are there alternatives?
  2. What drives repeat purchases? Is it habit, lock-in, or continuously creating new value?
  3. Could a competitor replicate this business with 10 billion?
  4. What key decisions has management made? What judgment and values do these decisions reflect?

Bias Self-Check List(Stay vigilant throughout the research):

  • Does my sense of "certainty" come from the essence of the business, or from the amount of materials?
  • If the amount of information on this company were halved, would my conclusion change?
  • Is the AI-generated analysis highly similar to market consensus? If so, where is my information advantage?
  • Is the possibility that "public information is scarce but the business essence is excellent" being underestimated?

Write the information richness rating result at the beginning of the report, and in the final conclusion note the distinction between "AI research confidence" and "actual investment certainty."

Step One: Data Collection

Data Source Standards: See skills/financial-data.md. All financial data must come from two independent sources; discrepancies >1% must be flagged.

  • US stocks: macrotrends (primary) + stockanalysis (secondary)
  • Hong Kong stocks: aastocks (primary) + macrotrends ADR (secondary)
  • A-shares: East Money (primary) + CNINFO (secondary)

Use the Task tool to launch a background Agent to collect the following data from the web:

  1. Revenue structure: segment revenue, growth rate, and gross margin for the most recent fiscal year and trailing 4 quarters
  2. Financial metrics: revenue, net profit, gross margin, operating margin, free cash flow, and cash reserves for the past 5 years
  3. Competitive landscape: market share, comparison with major competitors
  4. Business model and moat: sources of core competitive advantage
  5. Technical capabilities: core technology stack, R&D investment
  6. Management: founder/CEO background, shareholding percentage, key decision records
  7. Industry outlook: TAM (total addressable market), growth forecasts
  8. Risk factors: geopolitics, regulation, supply chain, etc.
  9. Current valuation: market cap, PE, PS, PEG, EV/Revenue
  10. Core arguments of both bulls and bears

Data cross-validation (mandatory, use financial rigor tools)

After data collection is complete,must call tools/financial_rigor.py to perform programmatic verification of key data, eliminating LLM mental-math errors.

Data points that must be verified:

  • Total share count (confirmed from at least 2 sources such as exchanges, Yahoo Finance, StockAnalysis, etc.)
  • Current stock price and market cap (manually calculate stock price × total share count and compare with reported market cap to prevent unit errors)
  • Revenue and net profit for the most recent fiscal year (confirmed from the company's annual report + at least 1 third-party source)
  • Cash reserves and net cash (cash + short-term investments - total debt, note differences in definitions)
  • Management shareholding percentage (distinguish economic interest from voting power, note dual-class share structures)

Mandatory verification steps (use Bash to call tools):

Step 1 — Market cap verification (exact decimal, not floating point):

python3 tools/financial_rigor.py verify-market-cap \
  --price {股价} --shares {总股本} --reported {报告市值} --currency {币种}

Step 2 — Multi-source cross-validation of key data:

python3 tools/financial_rigor.py cross-validate \
  --field {字段名} --values '{"来源1": 数值, "来源2": 数值}' --unit {单位}

Perform separately for revenue, net profit, and cash reserves.

Step 3 — Precise verification of valuation metrics (PE/PB/ROE/FCF Yield, etc.):

python3 tools/financial_rigor.py verify-valuation \
  --price {股价} --eps {EPS} --bvps {每股净资产} --fcf-per-share {每股FCF} --dividend {每股股息}

Verification rules:

  1. At least 2 independent sources for each key data point
  2. When discrepancies between sources are found, prioritize company annual reports/exchange data and note the reasons for the differences
  3. All data involving calculations must be verified through tools; LLM mental math is prohibited
  4. Tool output results are directly embedded in the report appendix "Key Data Cross-Validation Record"
  5. If the tool reports ❌ excessive deviation, the cause must be investigated before analysis can continue

Common error prevention:

  • Market cap units: HKD 100 million vs RMB 100 million vs USD 100 million, easy to omit/add a zero
  • FCF definition: different sources may define capital expenditure differently (whether it includes leases, acquisitions, etc.)
  • Debt definition: whether operating lease liabilities are included
  • Shareholding percentage: economic interest ≠ voting power in dual-class share companies

Step 2: Business essence analysis — Duan Yongping's "right business"

Analysis points:

  • Define the essence of this business in one sentence
  • Revenue structure breakdown (chart)
  • 5-year profitability trend (chart)
  • Business model canvas: one-time sales vs subscription/repeat purchase? Hardware vs software vs platform?
  • Ecosystem stickiness/customer lock-in strength
  • Gross margin level compared with peers, explain why it is high/low
  • Operating leverage analysis
  • Duan Yongping-style follow-up questions:What makes this business good? If it could only be described in one sentence, what would it be?

Step 3: Moat Assessment — Buffett's "Economic Moat"

Verify the five types of moats one by one:

Moat Type Verification Method
Brand/Pricing Power Can it raise prices without losing sales volume?
Switching Costs How high is the cost for customers to migrate to a competitor?
Network Effects Does the product get better as there are more users?
Scale Effects How large is the cost advantage brought by scale?
Technology/Patent Barriers How many years ahead is the technology? Can it be replicated?

Analyze the moat trend: Has it widened or narrowed over the past 5 years? Predict the next 5 years.

Buffett-style Follow-up Question:Will this moat still exist in 10 years? What could destroy it?

Step 4: Reverse Thinking and Risk Checklist — Munger's "Invert, always invert"

  • List "all the paths by which this company could fail" (table: path/probability/degree of impact)
  • Historical analogy: Find companies in similar positions in history; how did they end up?
  • Interdisciplinary analysis: Cross-validate using models such as network effect theory, technology adoption curve, and competitive game theory
  • Bias self-check: narrative bias, anchoring effect, survivorship bias
  • Collect the core arguments of the short sellers

Munger-style Follow-up Question:Where am I most likely to make a mistake? Why would smart people choose not to buy or to short this company?

Step 5: Management Assessment — Duan Yongping's "the right people" + Buffett's "management integrity"

  • Review key decisions of the CEO/founder (table: time/decision/result/score)
  • Capital allocation capability: R&D return rate, M&A success rate, timing of buybacks
  • Alignment with shareholder interests: management shareholding, compensation structure, record of share reductions
  • Organizational capability: team stability, key talent risk
  • Corporate culture characteristics

Duan Yongping-style Follow-up Question:If the CEO retires, can this company still remain competitive?

Step 6: Industry and Civilizational Trends — Li Lu's "civilizational evolution framework"

  • Determine whether the industry is in a "civilization-level paradigm shift"
  • Historical analogy of technological revolutions (steam engine/electricity/internet/AI)
  • TAM growth curve and ceiling analysis
  • The company's position in the industry value chain
  • Technology route risk
  • Customer/supplier concentration analysis

Li Lu-style Follow-up Question:Looking back 20 years from now, will this company be "the Standard Oil of this era" or "a fleeting 3Com"?

Step 7: Valuation and Margin of Safety — Buffett's "intrinsic value" + Duan Yongping's "the right price"

  • Current market pricing (table of key valuation metrics) — Must be verified with tools
  • Reverse DCF: What growth expectations are implied by the current stock price?
  • Three-scenario valuation — Must be calculated precisely with tools; mental math is prohibited:
python3 tools/financial_rigor.py three-scenario \
  --price {股价} --eps {EPS} --shares {总股本亿} \
  --growth {乐观增速} {中性增速} {悲观增速} \
  --pe {乐观PE} {中性PE} {悲观PE} --years 3 --currency {币种}
  • Compare with its own historical valuation
  • Compare with peer valuations

Long-term discounted valuation (10-year horizon, must be performed)

Three-year three-scenario answers "expensive or not", ten-year discounting answers "worth a heavy position or not".Any research that gives a ten-year IRR or terminal value multiple must go through this process, using tools/terminal_value.py。

The terminal value multiple has only one legitimate source—the perpetual growth model,peer analogy is not allowed:

$$PE_{terminal} = \frac{1 - g/ROIC}{r - g}$$

"Diageo is at 13x so Moutai should be given 16x" is circular reasoning: using someone else's price today to prove that the price I assume is reasonable. If the market as a whole is expensive today, the analogy method carries that expensiveness over to ten years from now unchanged.

Step 1 — Set the three inputs, writing out the rationale for each one by one (this step is all judgment, not calculation, and must be explained in the report):

Input How to set it Common mistake
r Cost of capital Risk-free rate + β × ERP.The currency must be consistent with the cash flows: RMB basis 6%–9% (mainly 8%), USD/HKD basis 9%–11.5% (mainly 10%) Following the government bond yield. A PE discounted from China's 1.70% government bond would reach above 50x; that is not valuation but magnified bias
ROIC Steady-state incremental return on capital Sandwiched between the stock ROIC (including off-balance-sheet intangible moats, on the high side) and the implied incremental ROIC backed out from dividends (assuming capex returns are zero, on the low side) Using stock ROIC directly. That amounts to assuming every new dollar invested can replicate the returns from building WeChat
g Perpetual growth rate It is not the growth rate of the next ten years(that is already in the terminal-year profit), but from after the terminal year to forever. The hard ceiling is long-term nominal GDP: RMB basis baseline tier ≤2%, USD basis ≤4% Using a USD g with an RMB r. 3% nominal growth is 0.5% real in the US (conservative), but 2% real in China (aggressive)

g does not change with r—g is a judgment about the economy after the terminal year, r is the return you require; the two are independent matters. When doing sensitivity, move only r.

Step 2 — Three hard-constraint pass checks (if they do not pass, the valuation must not be written into the report):

python3 tools/terminal_value.py audit \
  --currency {CNY|USD|HKD} --r {资本成本} --roic {稳态ROIC} \
  --g {悲观g},{基准g},{乐观g} --rf {无风险利率} --beta 1.0 \
  --discrete-risks "{风险名}:{情景|尾部档|概率|未建模},..."

The content of the three checks and the rejection conditions:

# Check Rejection condition
C1 r and g must be in the same currency r falls in another currency's range, or the baseline-tier g exceeds the local-currency ceiling. The tool will directly point out "this is USD magnitude—r used local currency while g used foreign currency"
C2 Denominator r−g ≥ 5 percentage points Any tier is less than 5pct. The narrower the denominator, the more a tiny move in g flips the valuation; if the denominator ≤0, the model is directly judged invalid. When an upside/downside scenario really must be done, add --upside-only an explicit declaration, but the report must state "this is a scenario, not a valuation"
C3 Discrete risks must not enter r or β If any risk attribution is written as 折现率/r/beta it is rejected outright. Delisting, VIE failure, geopolitical supply cutoff, and severe regulatory crackdowns must be attributed to 情景 or 尾部档. A β deviation from 1.0 must be given --beta-justification

Why C3 is hard: raising r by three percentage points penalizes year-10 cash flow by 2.6 times as much as year-1 cash flow; while delisting risk is a roughly uniform or even front-loaded annual hazard rate.Using the discount rate to handle discrete risks systematically reverses the time distribution of risk. The correct approach is to list a separate tail scenario and assign it a probability.

For the complete arguments of C1/C2/C3, see reports/7公司10年投资价值横评-确定性调整后回报-20260814.md Sections 3.4–3.6—all three are pitfalls that the report actually fell into.

Step 3 — Produce numbers (can only be run after passing the release check):

# 单点退出 PE,打印完整算式(留存率/分子/分母全部展开,便于报告引用)
python3 tools/terminal_value.py pe --roic {ROIC} --g {g} --r {r}

# 从零算 IRR
python3 tools/terminal_value.py irr \
  --profit {终值年利润} --mcap {今日市值} --pe {退出PE} \
  --years 10 --payout {股息率-稀释率}

For multi-company side-by-side comparison, write the parameters as JSON and pass them to --config, then use table / sweep / check。

Step 4 — Four things that must be written in the report:

  1. the value of r, the currency, and the paired upper limit of g. If r is not stated, then reporting IRR reports your own preference.
  2. Sensitivity to at least two levels of r, and whether the ranking is stable under each level. Absolute numbers are dominated by r; the ranking is the robust conclusion.
  3. The width of the r−g denominator for each level, and anything below 5pct must be labeled "for scenario reference only".
  4. List of unmodeled discrete risks(those marked in the audit as 未建模 ), written into the "Limitations" section.

Buffett-style follow-up question: If this r is off by 2 percentage points, will my conclusion flip? If so, is my conclusion buying the company or the discount rate?

Duan Yongping-style follow-up question: If the stock market closed tomorrow for 5 years, would you be willing to hold at this price?

Step 8: Comprehensive Decision Memorandum

Summary table:

Dimension Conclusion Confidence level
Business quality (Duan Yongping)
Moat (Buffett)
Management (Duan Yongping + Buffett)
Biggest risk (Munger)
Civilizational trend (Li Lu)
Valuation (Buffett + Duan Yongping)

Final decision table:

Strategy Recommendation
Those with no position
Those holding a position
Sell signal
Add-position signal

Simulated commentary from the four masters (in quote format).

Output requirements

  1. All analysis must be supported by data, with data sources attached
  2. Use Markdown tables to present key data
  3. At the end of each module, there must be a corresponding master's "follow-up question"
  4. Finally, write the complete report to ~/[公司名]投资研究报告.md
  5. The conclusion must be clear and must not avoid giving a buy/watch/avoid recommendation
  6. The valuation section must give a specific price range
  7. At the beginning of the reportMust include an "information richness rating" (A/B/C) and an "AI research limitations statement"
  8. At the end of the reportMust distinguish between "AI analysis confidence" and "investment certainty"—the former depends on the amount of material, the latter depends on the nature of the business. Clearly tell readers: which conclusions in this report are based on sufficient data, and which are based on reasoning from limited information
  9. If the company is Class C (scarce information), the end of the report must list a "list of questions requiring first-hand verification"—recommending that readers supplement the AI's blind spots through field research, product experience, supply chain interviews, etc.

Data spot check (release check process)

After the report is written to the file,mustperform a data spot check, and only after passing may it be published:

Step 1 — Extract the spot-check list (15% random sampling):

python3 tools/report_audit.py extract \
  --report <报告文件路径>

Output a JSON template, each item containing fetched_value(to be filled).

Step 2 — Data retrieval verification: For each data point in the checklist, retrieve data from reliable sources according to the skills/financial-data.md specifications (US stocks: macrotrends+stockanalysis; Hong Kong stocks: aastocks+macrotrends; A-shares: East Money+CNINFO), fill in fetched_value / fetched_source / fetched_value2 / fetched_source2。

Step 3 — Output verdict:

python3 tools/report_audit.py verdict \
  --results '<填好的JSON>' \
  --report <报告文件名>
  • [Pass]: deviation at all spot-check points ≤ 1% → the report can be published
  • [Reject]: any point with deviation > 1% → correct the corresponding data and re-run spot checks until it passes

Step 4 — Valuation basis recheck (mandatory for reports containing ten-year discounted valuation):

If a ten-year IRR or terminal value multiple appears in the report, run the audit again with the parameters used in the final draft to confirm that the numbers written into the report match those at the time it passed:

python3 tools/terminal_value.py audit \
  --currency {币种} --r {r} --roic {ROIC} --g {三档g} --rf {无风险利率} \
  --beta {β} --discrete-risks "{风险归属清单}"
  • [Pass](exit code 0) → the report can be published
  • [Reject](exit code 1) → correct and rerun until it passes

The reason this step cannot be skipped: the audit in Step 7 was done before the calculations, and during the report-writing process g or r is often adjusted again.The last audit before passing is the one that is accountable for the report.