
Rq Earnings Preview
Generate a structured pre-earnings preview memo from local RiceQuant JSON exports before a target quarter disclosure.
Overview
rq-earnings-preview is an agent skill for the Idea phase that turns RiceQuant JSON exports into a structured pre-earnings preview report with forecasts, expectations, scenarios, and trade setup.
Install
npx skills add https://github.com/ricequant/ricequant-skills --skill rq-earnings-previewWhat is this skill?
- Fills a fixed markdown report template (executive summary through appendix) from templated section placeholders
- Reads five JSON contracts from --data-dir: company_info, industry, historical_financials, roe_history, price_recent
- Computes historical trends, YoY margins, fee ratios, cash conversion, and ~3-month price/volume context from exports
- Margin logic prefers gross_profit, falls back to profit_from_operation, then net margin for financial/insurance names
- Includes forecast framework, sell-side expectations, announcements, scenario reactions, pre-earnings trade setup, and ri
- 5 JSON input files in the earnings-preview data contract
- Report template spans executive summary through appendix with dedicated scenario and trading-setup sections
Adoption & trust: 1 installs on skills.sh; 26 GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
You have quarterly fundamentals and recent prices on disk but no consistent pre-earnings write-up that links forecasts, market pricing, and risk checks before disclosure.
Who is it for?
Solo builders automating equity research memos from RiceQuant --data-dir bundles ahead of a known target quarter earnings date.
Skip if: Builders who need live streaming market data, broker execution, or full post-earnings recap workflows without preparing the five JSON input files first.
When should I use this skill?
Before a target quarter earnings disclosure when RiceQuant JSON files are available under --data-dir for generate_report.py.
What do I get? / Deliverables
You get a completed earnings-preview markdown report with scenario analysis, trading setup, and risk verification points ready for the disclosure window.
- Markdown earnings-preview report from the SKILL template
- Scenario analysis and pre-earnings trading setup section
- Historical operating and financial trend appendix with metric fallbacks documented
Recommended Skills
Journey fit
Canonical shelf is pre-event equity research: assembling forecasts, expectations, and positioning before the company reports. Fits idea/research because the deliverable is discovery and framing (not shipping code or running production ops).
How it compares
Use as a local JSON-driven report generator tied to RiceQuant exports, not as a real-time market data MCP or generic chat equity summary.
Common Questions / FAQ
Who is rq-earnings-preview for?
It is for solo quant-oriented builders and indie traders who maintain RiceQuant JSON snapshots and want agent-assisted, sectioned earnings preview reports before quarterly disclosures.
When should I use rq-earnings-preview?
Use it during Idea-phase research when you know the stock, target quarter, and report date and have populated company_info, industry, historical_financials, roe_history, and price_recent under --data-dir.
Is rq-earnings-preview safe to install?
Treat it like any third-party agent skill: review the Security Audits panel on this Prism page and inspect generate_report.py and data paths before running on sensitive machines.
SKILL.md
READMESKILL.md - Rq Earnings Preview
# 财报预览报告 - 报告日期:[[REPORT_DATE]] - 公司:[[COMPANY_NAME]](`[[STOCK_CODE]]`) - 目标季度:`[[TARGET_QUARTER]]` - 预计披露信息:[[EARNINGS_EVENT_CONTEXT]] ## 执行摘要 [[EXEC_SUMMARY]] ## 预览季度预测框架 [[FORECAST_FRAMEWORK]] ## 卖方预期与市场定价 [[EXPECTATION_SECTION]] ## 公告与管理层线索 [[ANNOUNCEMENT_SECTION]] ## 情景分析与市场反应 [[SCENARIO_SECTION]] ## 财报前交易定位 [[TRADING_SETUP]] ## 关键风险与验证点 [[RISK_SECTION]] ## 历史经营与财务趋势 [[HISTORICAL_TREND]] ## 附录:口径说明 [[APPENDIX]] # earnings-preview 数据契约 `earnings-preview/scripts/generate_report.py` 默认从 `--data-dir` 读取以下 JSON 文件。 ## 1. `company_info.json` 典型字段: - `order_book_id` - `symbol` - `listed_date` - `sector_code_name` 用途: - 获取公司名称、股票代码和基础元数据 ## 2. `industry.json` 典型字段: - `order_book_id` - `first_industry_code` - `first_industry_name` 用途: - 补充行业信息 ## 3. `historical_financials.json` 典型字段: - `order_book_id` - `quarter` - `info_date` - `revenue` - `net_profit` - `gross_profit` - `profit_from_operation`(可选) - `operating_expense` - `cash_from_operating_activities` 用途: - 历史趋势分析 - 计算同比、利润率、费用率、现金转化率 - 作为目标季度预测锚点 说明: - 若 `gross_profit` 可用,则优先使用毛利率 - 若 `gross_profit` 缺失但 `profit_from_operation` 可用,则回退到营业利润率 - 若两者都缺失,则回退到 `net_profit / revenue` 的净利率 - 金融股、保险股等样本常见 `gross_profit` 缺失,不应因此整段利润率分析退化为“无数据” ## 4. `roe_history.json` 典型字段: - `order_book_id` - `date` - `return_on_equity_weighted_average` 用途: - 分析资本效率趋势 ## 5. `price_recent.json` 典型字段: - `order_book_id` - `datetime` - `close` - `volume` - `total_turnover` 用途: - 计算近 3 个月股价涨跌幅 - 估算财报前 realized volatility - 分析成交额变化 说明: - `close` 应使用未复权现价口径(例如 `adjust_type=none`) - 若使用后复权价格,和卖方目标价直接比较会导致隐含空间失真 ## 6. `hs300_recent.json` 典型字段: - `order_book_id` - `datetime` - `close` 用途: - 计算相对沪深300的超额收益 ## 7. `consensus.json` 典型字段: - `date` - `create_tm` - `con_targ_price` - `comp_con_operating_revenue_t1` - `comp_con_operating_revenue_t2` - `comp_con_operating_revenue_t3` - `comp_con_net_profit_t1` - `comp_con_net_profit_t2` - `comp_con_net_profit_t3` 用途: - 获取最新一致预期快照 - 作为 market expectations 的结构化参考 注意: - `t1/t2/t3` 是 RQData 提供的 forward buckets,不应直接假装成目标季度预测值 ## 8. `research_reports.json` 典型字段: - `date` - `create_tm` - `data_source` - `report_title` - `institute` - `author` - `summary` - `summaries.core_view` - `targ_price` - `net_profit_t` - `net_profit_t1` - `revenue_t` - `revenue_t1` 用途: - 获取近期研报标题、摘要、目标价和年度利润口径 - 形成卖方预期与市场定价章节 - `summaries.core_view` 保存面向最终报告的精炼观点摘要 注意: - 若存在 `data_source`,应优先保留 `data_source=0` 的样本作为公司报告主样本 - `data_source!=0` 的记录可能混入行业、策略或其他公司内容,不应直接进入近期研报样本表 - 最终报告不应直接截断原始 `summary`;若要展示研报观点,应优先读取 `summaries.core_view` ## 9. `peers_financials.json` / `peers_instruments.json` 可选文件。 用途: - 若已提供可比公司列表,可对比最新收入、利润和可用利润率水平 ## 10. `announcement_raw.json` 可选文件。 典型字段: - `info_date` - `title` - `info_type` - `media` - `file_type` - `announcement_link` 用途: - 保留近期正式财报、主要经营数据公告、业绩说明会等原文链接 - 为财报前预览补充管理层近期沟通与经营线索 ## 11. `announcement_extracts.json` 可选文件,可由 `earnings-preview/scripts/extract_announcements.py` 生成。 典型字段: - `records[].title` - `records[].info_date` - `records[].announcement_link` - `records[].is_annual_or_interim_report` - `records[].fetch_status` - `records[].extract_status` - `records[].raw_sections.company_intro` - `records[].raw_sections.management_discussion` - `records[].raw_sections.risk_warning` - `records[].raw_sections.outlook` - `records[].summaries.company_intro` - `records[].summaries.management_discussion` - `records[].summaries.risk_warning` - `records[].summaries.outlook` 用途: - `raw_sections` 保存较长原文段落,供后续总结使用 - `summaries` 保存可直接进入最终报告的精炼片段 - `company_intro` / `management_discussion` / `outlook` 主要面向年报、半年报正文;季报和临时公告默认以链接留痕为主 - 若源站拦截或 PDF 不可读,也必须保留失败状态和原文链接 ## 解析约定 - 所有文件都允许 `{"data": [...]}`、`{"data": {...}}`、`[...]`、`{...}` 四种包装方式 - 同一股票同一季度若存在多条财务记录,脚本会按 `info_date` 选择最新披露版本 - 若卖方预期文件缺失,报告必须明确说明“未提供卖方口径数据” - 若公告提炼文件缺失,报告仍应保留相关公告原文链接 ## 12. `web_search_findings.json` 可选文件。 典型字段: - `query` - `source_name` - `source_type` - `title` - `url` - `published_at` - `retrieved_at` - `summary` - `why_rele