Codex adapter note
This skill is generated from skills/financial-data.md so Claude Code and Codex users share one canonical workflow.
- Treat
$ARGUMENTSas 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 likepython3 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
datecommand 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.
This specification applies to all research involving corporate financial data.Each key data point must come from two independent sources; a discrepancy >1% must be flagged.
Data source priority
US stocks (PDD, Tencent ADR, NetEase ADR, etc.)
| Priority | Source | URL | Access method |
|---|---|---|---|
| 1 (primary) | macrotrends | macrotrends.net/stocks/charts/{ticker} | Direct access, no registration required |
| 2 (secondary) | stockanalysis | stockanalysis.com/stocks/{ticker}/financials | Direct access, no registration required |
| Original primary source | SEC EDGAR | sec.gov/cgi-bin/browse-edgar | 10-K / 10-Q original text |
Hong Kong stocks (Tencent 0700, NetEase 9999, Meituan 3690, etc.)
| Priority | Source | URL | Access method |
|---|---|---|---|
| 1 (primary) | aastocks | aastocks.com/tc/stocks/analysis/company-fundamental | Direct access |
| 2 (secondary) | macrotrends(ADR code) | Tencent uses TCEHY, NetEase uses NTES | Direct access |
| Original primary source | HKEXnews | hkexnews.hk | Annual report PDF |
A-shares (37 Interactive Entertainment, G-bits, etc.)
| Priority | Source | URL | Access method |
|---|---|---|---|
| 1 (primary) | East Money | eastmoney.com → search stock code → financial statements | Direct access |
| 2 (secondary) | CNINFO | cninfo.com.cn | Original annual/quarterly report PDF |
Taiwan stocks (TSMC 2330, MediaTek 2454, Largan Precision 3008, etc.)
| Priority | Source | URL | Access method |
|---|---|---|---|
| 1 (primary) | FinMind API | api.finmindtrade.com | tools/twstock_data.py(zero-dependency script, see below) |
| 2 (secondary) | Goodinfo Taiwan Stock Market Information Network | goodinfo.tw/tw/StockDetail.asp?STOCK_ID={code} | Direct access |
| Original primary source | Market Observation Post System (MOPS) | mops.twse.com.tw | Financial report original text/monthly revenue announcements |
FinMind data retrieval tool(call this first when analyzing Taiwan stocks; output includes market cap verification):
python3 tools/twstock_data.py quote 2330 # 最新行情 + PER/PBR/殖利率 + 市值验算
python3 tools/twstock_data.py valuation 2330 # 估值指标 + PER一年区间 + 52周高低
python3 tools/twstock_data.py financials 2330 # 近5年年度核心财务(营收/毛利率/归母净利/EPS/ROE)
python3 tools/twstock_data.py revenue 2330 # 近13个月月营收及同比
python3 tools/twstock_data.py dividend 2330 # 近年股利政策(现金/股票股利、除息日)
python3 tools/twstock_data.py search 台積 # 搜索股票代码(注意台股名称为繁体)
Special notes for Taiwan stocks:
- The currency unit is New Taiwan dollars (TWD), and when mixed with Hong Kong dollars/renminbi/US dollars it must be explicitly labeled; before cross-market comparison, first convert to a common currency
- Monthly revenue is an advantage unique to Taiwan stocks: listed and OTC companies are required to disclose the previous month's revenue by the 10th of each month; it is the fastest public signal for tracking fundamental turning points, and earnings-review/thesis-tracker type analyses should make priority use of it (
revenuesubcommand) - The FinMind income statement isa single-quarter value, and the tool has automatically summed it into annual values; years with fewer than 4 quarters will be labeled "only cumulative for the first N quarters"
- FinMind can be used directly without registration (there is an hourly limit). The API token after registration must only be stored locally and strictly must not be committed to git, and the tool reads it automatically in priority order: ① environment variable
FINMIND_TOKEN; ② local filelocal/finmind_token.txt(local/has been.gitignorePermanently excluded; simply write the token on its own line in that file). The token must not appear in reports, skills, or commits - Cross-validation: compare FinMind values against Goodinfo (or the ADR on macrotrends, such as TSM); the error rules are the same as below; for companies with ADRs such as TSMC, note the exchange rate/depositary ratio differences between the ADR and the original Taiwan stock (1 TSM ADR = 5 shares of 2330)
Execution Standards
Step 1: Obtain Data
For each financial metric (revenue, net profit, gross margin, operating cash flow, debt-to-asset ratio, etc.), separately fromSource 1andSource 2obtain the figures.
Step 2: Error Calculation and Marking
误差率 = |来源1数值 - 来源2数值| / 来源1数值 × 100%
| Error | Handling Method |
|---|---|
| ≤ 1% | ✅ Consistent; use the Source 1 value and label both sources |
| 1% ~ 5% | ⚠️ Mark "data discrepancy"; note both values and explain possible causes (exchange rate/accounting basis) |
| > 5% | ❌ Mark "major data discrepancy"; must verify against the original financial report and must not be used directly |
Step 3: Data Presentation Format
Each key data point must be labeled in the following format:
收入:1,239亿元 ✅
- macrotrends: 1,241亿元
- stockanalysis: 1,237亿元
- 误差: 0.3%
Discrepancy example:
净利润:245亿元 ⚠️ 数据存在差异
- macrotrends: 245亿元(GAAP)
- stockanalysis: 278亿元(Non-GAAP)
- 误差: 13.5% — 原因:会计口径不同(GAAP vs Non-GAAP)
Common causes of discrepancies (not necessarily data errors)
| Cause | Description |
|---|---|
| GAAP vs Non-GAAP | Most common, especially for profit-related data |
| Exchange rate conversion | Different timing for HKD/RMB/USD conversion |
| Fiscal year definition | Calendar year vs fiscal year (e.g., Apple's fiscal year ends in October) |
| Consolidation basis | Whether minority interests are included |
| Delayed data updates | A platform has not yet updated the latest financial report |
Special Rules
- Unlisted companies(miHoYo, Lilith, etc.): when there is only a primary data source, mark before the data
[估计], and do not perform cross-validation - Quarterly data vs annual data: prioritize annual data for cross-validation; some sources of quarterly data may lag
- Original financial reports take precedence: if both sources do not match the original financial report (10-K/annual report PDF), the original financial report shall prevail, and the sources shall be marked as erroneous
Stock Price and Adjustment (Required Reading for Historical Series)
There are three price bases; mixing them will distort historical stock price positions, long-term gains, and historical valuation percentiles:
| Basis | Meaning | Use |
|---|---|---|
| Unadjusted | Actual transaction price, with gaps on ex-rights/ex-dividend dates | Only for "current point-in-time" snapshots |
| Forward-adjusted | Adjust historical prices based on the latest price | Use it for all historical stock price comparisons, N-year gains, and historical PE bands |
| Backward-adjusted | Project forward based on the first day of listing | Calculate historical total return/annualized return |
Rules:
- Analyses involving historical prices shall uniformly useforward-adjusted, and within the same analysismust not mixadjusted and unadjusted sources.
- For current market cap/current PE, usecurrent actual stock price × current total sharesis sufficient; it is unrelated to adjustment—adjustment only affects historical series.
- Per-share metrics spanning stock splits/large stock dividends (historical EPS, historical share price) must be adjusted back before making year-over-year comparisons.
- Total return/annualized return needs to include dividends (already included in backward adjustment); looking only at price gains will understate it.
- After additional issuance/buyback, market cap verification is based on the latest total share capital (
financial_rigor.py verify-market-capdeviation >5% will prompt verification).
Quick index
| Scenario | Primary source | Alternative source |
|---|---|---|
| PDD / Pinduoduo | macrotrends.net/stocks/charts/PDD | stockanalysis.com/stocks/pdd |
| Tencent | macrotrends.net/stocks/charts/TCEHY | aastocks(0700.HK) |
| NetEase | macrotrends.net/stocks/charts/NTES | aastocks(9999.HK) |
| 37 Interactive Entertainment | eastmoney.com(002555) | cninfo.com.cn |
| G-bits | eastmoney.com(603444) | cninfo.com.cn |
| Nintendo | macrotrends.net/stocks/charts/NTDOY | stockanalysis.com/stocks/ntdoy |
| Capcom | macrotrends(CCOEY) | stockanalysis(CCOEY) |
| TSMC | tools/twstock_data.py(2330) | goodinfo.tw / macrotrends (TSM, note 1 ADR = 5 shares) |
| MediaTek | tools/twstock_data.py(2454) | goodinfo.tw |