3182/earnings-surprise-detector/SKILL.md
Verify actual quarterly earnings (扣非归母净利润同比/营收同比/EPS) against analyst/research expectations BEFORE acting on a stock recommendation. Pulls real data via mx-data (东方财富), compares to expected growth, gates with PASS/WARN/FAIL. Use when evaluating any A-share recommendation that cites expected earnings growth, before stating entry prices or position sizing. Prevents expensive failures (太辰光 actual -17% vs research +80-120%, 英维克 -82% vs +150%).
npx skillsauth add starchild-ai-agent/community-skills @3182/earnings-surprise-detectorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You see a research report or hear a thesis: "X will grow earnings 80-120% this quarter." You build a position plan on that number. Then the actual earnings come in at -17%. You're now holding a bag based on a fantasy.
This happened. Multiple times. 太辰光: research said +80-120%, actual was -17%. 英维克: research said +150%, actual was -82%. 欧陆通: research said +180%, actual was a loss.
The fix is simple: verify before you act. Pull the actual number from an authoritative source (东方财富 via mx-data), compare to the expectation, and let the gap govern your action.
Do NOT skip this step. "The research said X" is not verification. "I pulled the actual number from 东方财富 and it confirms Y" is verification.
Extract from the recommendation/thesis:
If no specific growth number is cited, the thesis is too vague to verify — flag this and either pin down the number or treat the thesis as ungrounded.
Run the verification script:
python3 skills/earnings-surprise-detector/scripts/verify_earnings.py \
--stock "太辰光" \
--code 300570 \
--expected-min 80 \
--expected-max 120 \
--metric 扣非归母净利润同比
The script calls mx-data (东方财富) to fetch the latest quarterly 扣非归母净利润同比 growth, parses the result, and compares to the expected range.
Supported metrics:
扣非归母净利润同比 (default — the most important for A-share verification)营收同比净利润同比EPSIf mx-data API quota exhausted (status=113): The script will report this. Switch to manual verification — do NOT proceed without actuals. Use the linqi-data skill as a backup source if available.
The script outputs one of three verdicts:
| Verdict | Condition | Action | |---------|-----------|--------| | ✅ PASS | Actual ≥ expected-min | Proceed with recommendation. Earnings confirm the thesis. | | ⚠️ WARN | Actual is within -20% of expected-min (e.g., expected 80%, actual 65%) | Size down 50%. Thesis partially confirmed but momentum weaker than expected. Recheck thesis logic. | | ❌ FAIL | Actual < expected-min × 0.8 (e.g., expected 80%, actual < 64%) OR actual is negative when positive expected | Exclude or downweight. Do not recommend entry. If already holding, reassess immediately. |
Hard rule: When verdict is FAIL, do NOT generate entry prices, target prices, or 9-column execution tables. The thesis is broken at the earnings level — no amount of technical analysis fixes that.
Every stock recommendation that passed through this skill should include:
### Earnings Verification
- Stock: [name] ([code])
- Expected: [metric] [expected range] (source: [research/analyst])
- Actual: [metric] [actual value] (source: 东方财富 via mx-data, [report date])
- Verdict: [PASS/WARN/FAIL]
- Impact on recommendation: [proceed / size down / exclude]
If the verdict is FAIL, the recommendation section should state: "Earnings verification FAILED — actual [X]% vs expected [Y]%. Recommendation withdrawn pending thesis re-evaluation."
| Gap | What it usually means | What to do | |-----|----------------------|------------| | Actual >> expected | Earnings momentum stronger than consensus | Good signal — but check if it's a one-off (asset sale, tax benefit). If recurring, thesis is underpriced. | | Actual ≈ expected | Thesis is on track | Proceed normally. | | Actual slightly below | Momentum fading but direction right | Size down. Watch next quarter closely. | | Actual significantly below or negative | Thesis is broken at the fundamental level | Exit/exclude. Do not "wait for it to recover." The earnings were the thesis. | | Actual positive but growth decelerating vs prior quarters | Trend peak may be passing | Check if the thesis assumed accelerating growth. If so, size down even if actual > expected-min. |
Research reports often cite 净利润同比 (headline) which can be misleading. Always verify on 扣非 basis. If the research cited 净利润同比, pull both and compare — a large gap between 净利润 and 扣非 is itself a red flag (earnings quality issue).
Wrong stock code: Always verify code + name against user's exact text. 赛微 300456 ≠ 赛维 688418 — different companies, different fundamentals. The script takes both name and code; mismatch is a hard stop.
Wrong period: Research might cite Q1 2026 expectations but mx-data returns the latest available quarter. Check the report date in the output. If the latest quarter is different from what the expectation refers to, note the mismatch — you may be comparing apples to oranges.
One-off inflators: If 扣非同比 is strong but 净利润同比 is much stronger, the gap is non-recurring items. The 扣非 number is the real one.
Negative base year: If the prior year had a loss (negative base), even a small profit produces an astronomical 同比 growth (e.g., -0.01 → +0.01 = +100%). Check if the base was near-zero — if so, the growth % is meaningless and you should look at absolute profit instead.
API quota: mx-data has daily call limits. If you hit the limit, don't skip verification — switch to linqi-data or note "unverified, do not act."
If the script fails or mx-data is unavailable, you can verify manually:
# Pull earnings directly via mx-data CLI
python3 skills/mx-data/mx_data.py "太辰光 扣非归母净利润同比 最新报告期"
Read the output, find the 扣非归母净利润同比 value, and compare to expectations yourself. The script just automates this — the principle is the same: pull the actual number, compare, then act.
references/expected-growth-sources.md — where to find analyst consensus and research expectationstools
TQX (tqx.trade) HK/US stock quant workflow via tqx-cli: cross-sectional factor analysis, event-driven strategy backtests on the panda_backtest engine, and agent-driven automated paper trading. Use when the user wants to run factor IC/IR analysis, backtest a Python trading strategy on Hong Kong or US stocks, or set up agent-automated trading (e.g. "backtest a moving-average strategy on AAPL", "analyze a momentum factor on HK stocks", "let the agent trade my paper account").
tools
中学物理实验教学参赛方案套件。包含四个完整实验(单摆测g、声悬浮测声速、向心力定量演示仪、电磁阻尼定量研究),每套含固件源码、3D打印图纸、教学PPT、教学文稿、采购清单、调试手册、视频分镜脚本、模拟器。Use when a teacher/student needs a complete, classroom-ready physics experiment package for competition or teaching.
development
End-to-end blog management for AI agents. Write, import, build, preview, and publish articles using the blog template. Covers draft workflow, article import, SEO, OG images, and deployment.
development
ESP8266/ESP32 + 磁簧开关/霍尔传感器 单摆测重力加速度实验套件。 硬件搭建→固件烧录→数据采集→Web仪表盘→g值计算→教学文档,一站式完成。 Use when the user wants to build a pendulum g-measurement experiment, measure gravity with a micro-controller, or needs a complete physics experiment package with hardware + firmware + dashboard + teaching materials.