earnings-preview-single by anthropics/financial-services-plugins
npx skills add https://github.com/anthropics/financial-services-plugins --skill earnings-preview-single生成一份简洁、专业的单公司股票研究财报预览。输出是一个独立的 HTML 文件,目标为 4-5 个打印页。报告包含大量图表和数据,叙述紧凑,直击要点。
数据源(零例外): 唯一允许的数据源是 Kensho Grounding MCP (search) 和 S &P Global MCP (kfinance)。绝对禁止使用任何其他工具、数据源或任何形式的网络访问。具体来说:
WebSearch、WebFetch、web_search、brave_search、google_search 或任何通用的网络/互联网搜索工具——即使 Kensho 速度慢、无结果或暂时不可用。kfinance MCP 函数调用或 Kensho 调用。如果无法追溯到这两者之一,则不得出现在报告中。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
search关键规则: 在开始撰写报告的任何部分之前,必须完成所有研究和数据收集(阶段 1-5)。
中间文件规则: 来自 MCP 工具调用的所有原始数据必须在每个工具调用返回后立即写入 /tmp/earnings-preview/ 目录下的文件中——然后再进行下一个调用。这可以防止数据因上下文窗口压缩而丢失。请勿仅将数据保存在内存中。在阶段 1 开始时,运行 mkdir -p /tmp/earnings-preview 来创建目录。在生成 HTML 报告(阶段 7)之前,必须使用 cat 命令将所有中间文件读回上下文。这些文件——而不是你对之前对话的记忆——是报告中每个数字、引用和来源 URL 的唯一事实来源。如果跳过读取文件,报告将包含错误。
财季规则: 切勿根据日历报告日期推断财季。许多公司有非标准财年(例如,沃尔玛的财年于 1 月 31 日结束,因此 2026 年 2 月的报告涵盖的是 FY2026 年第四季度,而不是 2025 年第四季度或 2026 年第一季度)。始终严格按照 get_next_earnings_from_identifiers 或 get_earnings_from_identifiers 返回的财报电话会议名称中所述的财季和财年来使用(例如,“Walmart Q4 FY2026 Earnings Call” 意味着财季是 Q4 FY2026)。在报告标题、页眉、表格和所有引用中逐字使用该表述。如果电话会议名称不明确,请与 get_financial_line_item_from_identifiers 的期间标签进行交叉引用。
长度规则: 报告必须简洁。目标为打印时 4-5 页。请勿撰写冗长的多段落叙述。使用紧凑、有力的要点。每个句子都必须有其存在的价值。如果能用更少的词表达,请务必这样做。
逐字引用规则: 当在 <blockquote> 标签中引用管理层言论时,文本必须逐字从文字记录中复制——包括填充词和句子片段。请勿意译、重新排列、组合来自文字记录不同部分的句子,或“清理”引用。如果你在文字记录中找不到确切的短语,请勿将其作为直接引用呈现。相反,请用自己的叙述性语言进行意译,不使用 blockquote 格式(例如,“管理层指出数据中心需求仍然强劲”)。每个 blockquote 都必须是可对照文字记录验证的逐字复制粘贴摘录。
计算完整性规则: 对于任何多步骤计算(根据年度指引推算的季度数据、LTM P/E、同比增长率、业务部门同比变化),请明确写出每个步骤,并在下一步使用之前验证中间结果。如果你陈述 A + B + C = X,在后续公式中使用 X 之前,请验证 X 在算术上是正确的。如果附录中显示的总和与其所述组成部分不相等,则报告是错误的。如有疑问,请根据原始数据重新计算,而不是重用先前计算的中间结果。
比率命名规则: 所有估值比率必须明确标注为 LTM(过去十二个月)或 NTM(未来十二个月)。切勿使用“trailing”或“forward”——始终使用 LTM 或 NTM。LTM 比率使用最近 4 个已报告季度的总和。NTM 比率使用来自 get_consensus_estimates_from_identifiers 的未来 4 个季度共识平均 EPS 估计值的总和——而不是单个年度数字。LTM 和 NTM P/E 都必须计算并显示在竞争对手比较表中。
超链接规则(严格执行): 报告中的每一项主张——无论是数字还是非数字——都必须包装在指向附录中相应条目的 <a href="#ref-N" class="data-ref"> 超链接中。这是强制性的。报告中的每一个数字都必须是可点击的链接。 这包括:收入数据、EPS、利润率、增长率、市值、P/E 比率、股票回报率、目标价、业务部门收入以及任何其他财务指标。也包括来自文字记录或 Kensho 搜索的定性主张。如果你将其陈述为事实,则必须链接到一个来源。为每个唯一的主张分配一个顺序引用 ID(ref-1、ref-2 等)。超链接样式是微妙的——海军蓝色,无下划线,悬停时显示虚线。请勿在报告正文中书写任何没有包装在 <a> 标签内的数字。 例如:写 <a href="#ref-1" class="data-ref">$152.3B</a>,切勿将 $152.3B 写成纯文本。
$ARGUMENTS 解析单个公司股票代码(去除空格)。mkdir -p /tmp/earnings-preview 创建工作目录。get_latest() 建立当前报告期间上下文。get_info_from_identifiers —— 记录市值、行业。get_company_summary_from_identifiers —— 记录业务描述。get_next_earnings_from_identifiers —— 记录即将到来的财报日期和财季名称。立即写入 /tmp/earnings-preview/company-info.txt:
TICKER: [股票代码]
COMPANY: [全名]
INDUSTRY: [行业]
MARKET_CAP: [数值] (截至 [日期])
NEXT_EARNINGS_DATE: [日期]
NEXT_EARNINGS_QUARTER: [Q# FY#### 完全按照 API 返回的格式]
BUSINESS_DESCRIPTION: [2-3 句摘要]
get_latest_earnings_from_identifiers 获取最近一次已完成的财报电话会议 key_dev_id。get_transcript_from_key_dev_id 获取该文字记录。/tmp/earnings-preview/transcript-extracts.txt,包含以下部分。在文字记录仍在上下文中时写入此文件——不要等待:TRANSCRIPT_SOURCE: [电话会议名称,例如 "Q3 2025 Earnings Call"]
KEY_DEV_ID: [key_dev_id]
CALL_DATE: [日期]
FISCAL_QUARTER: [Q# FY####]
=== 逐字引用(精确复制粘贴——请勿意译) ===
QUOTE_1: "[来自文字记录的确切文本]"
SPEAKER_1: [姓名], [职位]
CONTEXT_1: [1 句话说明此言论出现的位置——准备好的发言或问答环节]
QUOTE_2: "[来自文字记录的确切文本]"
SPEAKER_2: [姓名], [职位]
CONTEXT_2: [上下文]
QUOTE_3: "[来自文字记录的确切文本]"
SPEAKER_3: [姓名], [职位]
CONTEXT_3: [上下文]
QUOTE_4: "[来自文字记录的确切文本]"
SPEAKER_4: [姓名], [职位]
CONTEXT_4: [上下文]
=== 指引(仅限定量) ===
- [指标]: [管理层所述的范围或点估计]
- [指标]: [范围或点估计]
=== 关键驱动因素 ===
- [驱动因素 1 及支持数据点]
- [驱动因素 2 及支持数据点]
- [驱动因素 3 及支持数据点]
=== 逆风与风险 ===
- [风险 1,如有可能请量化]
- [风险 2]
=== 分析师问答主题 ===
- [主题 1:分析师关注的重点]
- [主题 2]
- [主题 3]
=== 综合:下季度需关注的主题 ===
- [主题 1]
- [主题 2]
- [主题 3]
competitor_source="all" 调用 get_competitors_from_identifiers。get_prices_from_identifiers,参数 periodicity="day",最近 12 个月get_financial_line_item_from_identifiers,参数 diluted_eps,period_type="quarterly",num_periods=8get_capitalization_from_identifiers,参数 capitalization="market_cap"(最新)get_consensus_estimates_from_identifiers,参数 period_type="quarterly",num_periods_forward=4 —— 这将返回未来 4 个季度的共识平均 EPS 估计值,用于计算 NTM EPS每个工具调用返回后,立即将原始数据追加到相应的中间文件:
写入 /tmp/earnings-preview/prices.csv —— 每行对应(股票代码,日期,收盘价)。包含 source 列,记录确切的 MCP 函数调用。首先写入目标公司的价格,然后依次写入每个竞争对手的价格:
ticker,date,close,source
D,2025-02-19,55.67,get_prices_from_identifiers(identifier='D',periodicity='day')
D,2025-02-20,55.82,get_prices_from_identifiers(identifier='D',periodicity='day')
...
DUK,2025-02-19,111.79,get_prices_from_identifiers(identifier='DUK',periodicity='day')
...
注意:来自单个调用的所有行的 source 值相同——在每一行都写入,以便始终可用。
写入 /tmp/earnings-preview/peer-eps.csv —— 每行对应(股票代码,期间,eps)。每次 diluted_eps 调用后立即写入:
ticker,period,diluted_eps,source
D,Q4 2024,1.09,get_financial_line_item_from_identifiers(identifier='D',line_item='diluted_eps',period_type='quarterly')
D,Q1 2025,-0.11,get_financial_line_item_from_identifiers(identifier='D',line_item='diluted_eps',period_type='quarterly')
...
DUK,Q4 2024,1.52,get_financial_line_item_from_identifiers(identifier='DUK',line_item='diluted_eps',period_type='quarterly')
...
写入 /tmp/earnings-preview/peer-market-caps.csv —— 每行对应一个股票代码。每次 market_cap 调用后立即写入:
ticker,market_cap,retrieval_date,source
D,55900000000,2026-02-19,get_capitalization_from_identifiers(identifier='D',capitalization='market_cap')
DUK,98300000000,2026-02-19,get_capitalization_from_identifiers(identifier='DUK',capitalization='market_cap')
...
写入 /tmp/earnings-preview/consensus-eps.csv —— 每行对应(股票代码,期间,共识平均 EPS)。每次 get_consensus_estimates_from_identifiers 调用后立即写入:
ticker,period,consensus_mean_eps,num_estimates,source
D,Q4 2025,0.88,12,get_consensus_estimates_from_identifiers(identifier='D',period_type='quarterly',num_periods_forward=4)
D,Q1 2026,0.72,10,get_consensus_estimates_from_identifiers(identifier='D',period_type='quarterly',num_periods_forward=4)
D,Q2 2026,0.91,9,get_consensus_estimates_from_identifiers(identifier='D',period_type='quarterly',num_periods_forward=4)
D,Q3 2026,1.05,8,get_consensus_estimates_from_identifiers(identifier='D',period_type='quarterly',num_periods_forward=4)
DUK,Q4 2025,1.48,14,get_consensus_estimates_from_identifiers(identifier='DUK',period_type='quarterly',num_periods_forward=4)
...
4. 现在不要计算 P/E 或回报率。 原始数据现已存储在磁盘上。计算将在阶段 6(验证)中进行,从这些文件读取。
日期一致性规则(股票回报率): 在计算比较股票回报率(年初至今 %、1 年 %、30 天 %、90 天 %)时,所有股票代码必须使用完全相同的起始和结束日期。将所有价格数据写入 prices.csv 后,确定出现在所有股票代码数据中的第一个交易日,并将其用作共同基准日期。请勿为不同的股票代码使用不同的基准日期(例如,目标公司从 2 月 19 日开始,竞争对手从 2 月 28 日开始)。如果某个股票代码的数据开始日期晚于其他股票,请使用第一个重叠日期进行所有计算。在附录中说明每个回报率计算使用的共同基准日期。
P/E 货币规则(LTM P/E): 在计算每家公司的 LTM P/E 时,使用该公司来自 peer-eps.csv 的最近 4 个已报告季度——而不是应用于所有公司的固定日历窗口。如果某个竞争对手已经报告了 Q4 2025,而目标公司只报告到 Q3 2025,则该竞争对手的 LTM EPS 应包含 Q4 2025。检查每家公司的最近报告期间,并按照每家公司使用其最近的 4 个期间。在附录中注明每家公司 P/E 计算使用了哪 4 个季度。
市值日期戳: 报告市值时,使用 peer-market-caps.csv 中的 retrieval_date。如果与报告日期不同,请在附录中注明。
为以下每个类别运行这些 search 查询。请勿跳过任何类别。
关键——捕获来源 URL: 每个 Kensho search 结果都包含一个指向基础文章、报告或数据页面的来源 URL。你必须记录每个发现的 URL。
每次搜索调用后,立即将结果追加到 /tmp/earnings-preview/kensho-findings.txt,使用以下格式。请勿等到所有搜索完成——每次搜索后立即写入:
=== 搜索: "[使用的查询]" ===
DATE_RUN: [今天的日期]
CATEGORY: [estimates|analyst_ratings|risks|news|sector]
FINDING_1: [关键发现或摘录]
URL_1: [来自搜索结果的原 URL]
SOURCE_1: [出版物名称,如果可用则包含日期]
FINDING_2: [关键发现或摘录]
URL_2: [来源 URL]
SOURCE_2: [出版物名称,日期]
[... 继续列出此搜索的所有相关结果 ...]
财报估计与分析师情绪:
search 查询 "[股票代码] earnings estimates consensus EPS revenue upcoming quarter"
search 查询 "[股票代码] analyst ratings price target upgrades downgrades"
search 查询 "[股票代码] risks bear case concerns investors"
近期新闻(强制——请勿跳过): 4. search 查询 "[股票代码] [公司名称] recent news developments"
行业背景: 5. search 查询 "[公司行业/板块] sector outlook trends"
季度财务数据(最近 8 个季度): 调用 get_financial_line_item_from_identifiers,参数 period_type="quarterly",num_periods=8,获取以下指标:revenue、gross_profit、operating_income、ebitda、net_income、diluted_eps
每个指标调用返回后,立即追加到 /tmp/earnings-preview/financials.csv。按原样写入原始值——暂时不要四舍五入或转换。包含 source 列,记录确切的 MCP 函数调用和参数:
ticker,period,line_item,value,source
D,Q4 2024,revenue,3941000000,get_financial_line_item_from_identifiers(identifier='D',line_item='revenue',period_type='quarterly')
D,Q1 2025,revenue,3400000000,get_financial_line_item_from_identifiers(identifier='D',line_item='revenue',period_type='quarterly')
D,Q2 2025,revenue,4076000000,get_financial_line_item_from_identifiers(identifier='D',line_item='revenue',period_type='quarterly')
D,Q3 2025,revenue,3810000000,get_financial_line_item_from_identifiers(identifier='D',line_item='revenue',period_type='quarterly')
D,Q4 2024,diluted_eps,1.09,get_financial_line_item_from_identifiers(identifier='D',line_item='diluted_eps',period_type='quarterly')
D,Q1 2025,diluted_eps,-0.11,get_financial_line_item_from_identifiers(identifier='D',line_item='diluted_eps',period_type='quarterly')
...
现在不要计算利润率或增长率。 仅写入原始数据。计算将在阶段 6 进行。
业务部门数据:
get_segments_from_identifiers,参数 segment_type="business",period_type="quarterly",num_periods=8立即写入 /tmp/earnings-preview/segments.csv:
ticker,period,segment_name,revenue,source
D,Q3 2024,Dominion Energy Virginia,2762000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')
D,Q3 2024,Dominion Energy South Carolina,848000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')
D,Q3 2024,Contracted Energy,260000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')
D,Q3 2025,Dominion Energy Virginia,3311000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')
D,Q3 2025,Dominion Energy South Carolina,945000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')
D,Q3 2025,Contracted Energy,297000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')
...
财报历史(用于股票图表标注):
调用 get_earnings_from_identifiers —— 收集 12 个月价格窗口内的过去财报日期。
立即写入 /tmp/earnings-preview/earnings-dates.csv:
ticker,earnings_date,call_name,source D,2025-05-02,Q1 2025 Earnings Call,get_earnings_from_identifiers(identifier='D') D,2025-08-01,Q2 2025 Earnings Call,get_earnings_from_identifiers(identifier='D') D,2025-10-31,Q3 2025 Earnings Call,get_earnings_from_identifiers(identifier='D') ...
在生成报告之前,读取所有中间文件并根据干净的数据执行计算。此阶段通过从文件而非压缩的对话上下文工作来确保数据完整性。
读取所有中间文件,使用 bash cat 命令:
cat /tmp/earnings-preview/company-info.txtcat /tmp/earnings-preview/transcript-extracts.txtcat /tmp/earnings-preview/financials.csvcat /tmp/earnings-preview/segments.csvcat /tmp/earnings-preview/prices.csvcat /tmp/earnings-preview/peer-eps.csvcat /tmp/earnings-preview/peer-market-caps.csvcat /tmp/earnings-preview/consensus-eps.csvcat /tmp/earnings-preview/kensho-findings.txtcat /tmp/earnings-preview/earnings-dates.csv根据现在上下文中的原始数据计算衍生指标:
peer-eps.csv 检查每个股票代码可用的 4 个季度)consensus-eps.csv 的未来 4 个季度共识平均 EPS 估计值的总和。为每个股票代码添加所有 4 个季度的 consensus_mean_eps 值。如果某个竞争对手可用的未来季度少于 4 个,则将 NTM P/E 标记为“n/a”。在附录中注明汇总了哪 4 个季度。prices.csv 中找到所有股票代码的共同起始日期,然后从该日期开始计算回报率交叉检查:
segments.csv 中是否有实际的去年同期行。如果没有,标记“同比数据不可用”。transcript-extracts.txt 中的所有逐字引用都是精确的复制粘贴(而非意译)。写入 /tmp/earnings-preview/calculations.csv,包含所有衍生值:
ticker,metric,value,formula,components
D,gross_margin_Q3_2025,32.5%,gross_profit/revenue,"gross_profit=1238100000,revenue=3810000000"
D,revenue_yoy_Q3_2025,+9.3%,(Q3_2025-Q3_2024)/Q3_2024,"Q3_2025=3810000000,Q3_2024=3486000000"
D,ltm_pe,24.2x,price/ltm_eps,"price=65.46,ltm_eps=2.70,quarters=Q4_2024+Q1_2025+Q2_2025+Q3_2025"
D,ntm_pe,18.5x,price/ntm_eps,"price=65.46,ntm_eps=3.56,quarters=Q4_2025(0.88)+Q1_2026(0.72)+Q2_2026(0.91)+Q3_2026(1.05),source=get_consensus_estimates_from_identifiers"
D,yoy_return,+17.6%,(end-start)/start,"end=65.46,start=55.67,base_date=2025-02-19"
DUK,yoy_return,+13.0%,(end-start)/start,"end=126.32,start=111.79,base_date=2025-02-19"
...
此文件成为报告中所有数字的唯一事实来源。
停止——在撰写任何 HTML 之前,必须读取所有中间文件。这是一个阻塞性先决条件。
这不是可选的。你必须将下面的每个 cat 命令作为单独的 bash 工具调用运行(不要合并成一个)。这确保每个文件的内容被单独加载并显示在对话中。请勿将它们合并到一个命令中。请勿跳过任何文件。
逐个运行这些命令,每个作为其自己的 bash 调用:
cat /tmp/earnings-preview/company-info.txtcat /tmp/earnings-preview/transcript-extracts.txtcat /tmp/earnings-preview/financials.csvcat /tmp/earnings-preview/segments.csvcat /tmp/earnings-preview/prices.csvcat /tmp/earnings-preview/peer-eps.csvcat /tmp/earnings-preview/peer-market-caps.csvcat /tmp/earnings-preview/consensus-eps.csvcat /tmp/earnings-preview/kensho-findings.txtcat /tmp/earnings-preview/earnings-dates.csvcat /tmp/earnings-preview/calculations.csv读取所有文件后,必须向用户打印一条摘要消息,列出每个文件及其状态。请完全使用此格式:
--- 数据文件验证 ---
1. company-info.txt ✓ 已加载 ([N] 行)
2. transcript-extracts.txt ✓ 已加载 ([N] 行)
3. financials.csv ✓ 已加载 ([N] 行)
4. segments.csv ✓ 已加载 ([N] 行)
5. prices.csv ✓ 已加载 ([N] 行)
6. peer-eps.csv ✓ 已加载 ([N] 行)
7. peer-market-caps.csv ✓ 已加载 ([N] 行)
8. consensus-eps.csv ✓ 已加载 ([N] 行)
9. kensho-findings.txt ✓ 已加载 ([N] 行)
10. earnings-dates.csv ✓ 已加载 ([N] 行)
11. calculations.csv ✓ 已加载 ([N] 行)
所有中间数据文件已成功加载。
正在使用文件数据作为唯一事实来源生成报告。
---
如果任何文件缺失或为空,请停止并告知用户哪个文件失败。请勿在数据缺失的情况下继续生成报告。
HTML 报告中的每个数字、引用、来源 URL 和 MCP 函数调用引用都必须来自这些文件——而不是来自你对早期对话轮次的记忆。 这些文件是唯一的事实来源。早期的对话上下文可能已被压缩或总结,如果依赖它们,将包含错误。如果一个数据点不在文件中,则不应出现在报告中。
请参阅 report-template.md 获取完整的 HTML 模板、CSS 和 Chart.js 配置。
强制——对图表使用模板辅助函数: report-template.md 提供了预构建、经过调试的 Chart.js 辅助函数。必须使用这些确切的函数来创建图表。请勿编写自定义的内联 Chart.js 代码。辅助函数包括:
createRevEpsChart(canvasId, labels, revenueData, epsData, revLabel) —— 用于图 1createMarginChart(canvasId, labels, grossMargins, opMargins) —— 用于图 2createRevGrowthChart(canvasId, labels, growthData) —— 用于图 3createAnnotatedPriceChart(canvasId, labels, prices, earningsDates, ticker) —— 用于图 5createCompPerfChart(canvasId, labels, datasets) —— 用于图 6createPEChart(canvasId, companies) —— 用于图 7每个图表调用必须在其自己的 <script> 标签中,并用 try-catch 块包装。这确保一个图表的错误不会阻止其他图表渲染。示例:
<script>
try {
createRevEpsChart('chart-rev-eps', [...], [...], [...], 'Revenue ($B)');
} catch(e) { console.error('Figure 1 error:', e); }
</script>
<script>
try {
createMarginChart('chart-margins', [...], [...], [...]);
} catch(e) { console.error('Figure 2 error:', e); }
</script>
报告分为两部分:叙述(第 1-2 页)和图表(第 3-5 页)。保持这两部分紧密集成。
AI 免责声明(强制——必须在 3 个位置出现): 必须在报告 HTML 中包含以下免责声明文本。这不是可选的——没有它,报告是不完整的:
“分析由 AI 生成——请确认所有输出”
它必须出现在以下 3 个确切位置:
<div class="ai-disclaimer">Analysis is AI-generated — please confirm all outputs</div><div class="footer-disclaimer">Analysis is AI-generated — please confirm all outputs</div><div class="ai-disclaimer">Analysis is AI-generated — please confirm all outputs</div>第 1 页:封面与论点
第 2 页:估计、主题与新闻
共识估计表(单个表格,标记为图表):
class="neg"(红色)。如果为正,使用 class="pos"(绿色)。如果为零或 N/A,使用 class="neutral"。数字的符号决定类别——请勿基于解释进行覆盖。-1.1% 总是红色,即使下降幅度很小。除头条 EPS 外的关键指标(要点列表,3-5 项):
需关注的主题(3-5 个要点):
近期新闻与动态(3-5 个要点):
第 3-5 页:图表(所有图表和表格)
所有图表按顺序编号。每个图表都有标题和来源行。
Generate a concise, professional equity research earnings preview for a single company. The output is a self-contained HTML file targeting 4-5 printed pages. The report is dense with figures and data, with tight narrative that gets straight to the point.
Data Sources (ZERO EXCEPTIONS): The ONLY permitted data sources are Kensho Grounding MCP (search) and S &P Global MCP (kfinance). Absolutely NO other tools, data sources, or web access of any kind. Specifically:
WebSearch, WebFetch, web_search, brave_search, google_search, or ANY generic web/internet search tool — even if Kensho is slow, returns no results, or is temporarily unavailable.kfinance MCP function call or a Kensho search call. If it cannot be sourced to one of these two, it must not appear in the report.Critical Rule: You MUST complete ALL research and data collection (Phases 1-5) BEFORE writing any part of the report.
Intermediate File Rule: All raw data from MCP tool calls MUST be written to files in /tmp/earnings-preview/ immediately after each tool call returns — before moving to the next call. This protects data from context window compression. Do NOT hold data only in memory. At the start of Phase 1, run mkdir -p /tmp/earnings-preview to create the directory. Before generating the HTML report (Phase 7), you MUST read ALL intermediate files back into context usingcat commands. The files — not your memory of earlier conversation — are the single source of truth for every number, quote, and source URL in the report. If you skip reading the files, the report WILL contain errors.
Fiscal Quarter Rule: NEVER infer the fiscal quarter from the calendar report date. Many companies have non-standard fiscal years (e.g., Walmart's FY ends Jan 31, so a Feb 2026 report covers Q4 FY2026, not Q4 2025 or Q1 2026). Always use the fiscal quarter and fiscal year exactly as stated in the earnings call name returned by get_next_earnings_from_identifiers or get_earnings_from_identifiers (e.g., "Walmart Q4 FY2026 Earnings Call" means the quarter is Q4 FY2026). Use that verbatim in the report title, headers, tables, and all references. If the call name is ambiguous, cross-reference with get_financial_line_item_from_identifiers period labels.
Length Rule: The report must be concise. Target 4-5 pages when printed. Do NOT write long multi-paragraph narratives. Use tight, punchy bullet points. Every sentence must earn its place. If you can say it in fewer words, do so.
Verbatim Quote Rule: When quoting management in <blockquote> tags, the text MUST be copied exactly from the transcript — word for word, including filler words and sentence fragments. Do NOT paraphrase, rearrange, combine sentences from different parts of the transcript, or "clean up" quotes. If you cannot find the exact phrase in the transcript, do NOT present it as a direct quote. Instead, paraphrase in your own narrative voice without blockquote formatting (e.g., "Management noted that data center demand remains significant"). Every blockquote must be a verbatim, copy-paste excerpt that can be verified against the transcript.
Calculation Integrity Rule: For any multi-step calculation (implied quarterly figures from annual guidance, LTM P/E, y/y growth rates, segment y/y changes), write out each step explicitly and verify intermediate results before using them in the next step. If you state A + B + C = X, verify X is arithmetically correct before using X in a subsequent formula. If the appendix shows a sum that does not equal its stated components, the report is wrong. When in doubt, recompute from raw data rather than reusing a previously calculated intermediate.
Ratio Nomenclature Rule: All valuation ratios must be explicitly labeled as LTM (Last Twelve Months) or NTM (Next Twelve Months). Never use "trailing" or "forward" — always use LTM or NTM. LTM ratios use the sum of the most recent 4 reported quarters. NTM ratios use the sum of the next 4 quarterly consensus mean EPS estimates from get_consensus_estimates_from_identifiers — NOT a single annual figure. Both LTM and NTM P/E must be computed and displayed in the competitor comparison table.
Hyperlink Rule (STRICTLY ENFORCED): Every claim in the report — numeric AND non-numeric — MUST be wrapped in an <a href="#ref-N" class="data-ref"> hyperlink pointing to the corresponding entry in the Appendix. This is not optional. Every single number in the report must be a clickable link. This includes: revenue figures, EPS, margins, growth rates, market caps, P/E ratios, stock returns, price targets, segment revenue, and any other financial metric. It also includes qualitative claims from transcripts or Kensho searches. If you state it as fact, it must link to a source. Assign each unique claim a sequential reference ID (ref-1, ref-2, etc.). The hyperlink style is subtle — navy color, no underline, dotted underline on hover. Do NOT write any number in the report body without wrapping it in an<a> tag. Example: write <a href="#ref-1" class="data-ref">$152.3B</a>, NEVER write $152.3B as plain text.
$ARGUMENTS (strip whitespace).mkdir -p /tmp/earnings-preview to create the working directory.get_latest() to establish current reporting period context.get_info_from_identifiers — record market cap, industry.get_company_summary_from_identifiers — record business description.get_next_earnings_from_identifiers — record upcoming earnings date and fiscal quarter name.Immediately write /tmp/earnings-preview/company-info.txt:
TICKER: [ticker]
COMPANY: [full name]
INDUSTRY: [industry]
MARKET_CAP: [value] (as of [date])
NEXT_EARNINGS_DATE: [date]
NEXT_EARNINGS_QUARTER: [Q# FY#### exactly as returned by API]
BUSINESS_DESCRIPTION: [2-3 sentence summary]
get_latest_earnings_from_identifiers to get the most recent completed earnings call key_dev_id.get_transcript_from_key_dev_id for that transcript./tmp/earnings-preview/transcript-extracts.txt with the following sections. Write this file WHILE you still have the transcript in context — do not wait:TRANSCRIPT_SOURCE: [Call Name, e.g., "Q3 2025 Earnings Call"]
KEY_DEV_ID: [key_dev_id]
CALL_DATE: [date]
FISCAL_QUARTER: [Q# FY####]
=== VERBATIM QUOTES (copy-paste exactly — do NOT paraphrase) ===
QUOTE_1: "[exact text from transcript]"
SPEAKER_1: [Name], [Title]
CONTEXT_1: [1 sentence on where this appeared — prepared remarks or Q&A]
QUOTE_2: "[exact text from transcript]"
SPEAKER_2: [Name], [Title]
CONTEXT_2: [context]
QUOTE_3: "[exact text from transcript]"
SPEAKER_3: [Name], [Title]
CONTEXT_3: [context]
QUOTE_4: "[exact text from transcript]"
SPEAKER_4: [Name], [Title]
CONTEXT_4: [context]
=== GUIDANCE (quantitative only) ===
- [metric]: [range or point estimate as stated by management]
- [metric]: [range or point estimate]
=== KEY DRIVERS ===
- [driver 1 with supporting data point]
- [driver 2 with supporting data point]
- [driver 3 with supporting data point]
=== HEADWINDS & RISKS ===
- [risk 1 with quantification if available]
- [risk 2]
=== ANALYST Q&A THEMES ===
- [theme 1: what analysts pushed on]
- [theme 2]
- [theme 3]
=== SYNTHESIS: THEMES TO WATCH NEXT QUARTER ===
- [theme 1]
- [theme 2]
- [theme 3]
get_competitors_from_identifiers with competitor_source="all".get_prices_from_identifiers with periodicity="day", last 12 monthsget_financial_line_item_from_identifiers for diluted_eps, period_type="quarterly", num_periods=8get_capitalization_from_identifiers with (latest)After each tool call returns, immediately append the raw data to the appropriate intermediate file:
Write /tmp/earnings-preview/prices.csv — one row per (ticker, date, close). Include the source column with the exact MCP function call. Write the subject company's prices first, then each competitor's as you fetch them:
ticker,date,close,source
D,2025-02-19,55.67,get_prices_from_identifiers(identifier='D',periodicity='day')
D,2025-02-20,55.82,get_prices_from_identifiers(identifier='D',periodicity='day')
...
DUK,2025-02-19,111.79,get_prices_from_identifiers(identifier='DUK',periodicity='day')
...
Note: the source value is the same for all rows from a single call — write it on every row so it's always available.
Write /tmp/earnings-preview/peer-eps.csv — one row per (ticker, period, eps). Write immediately after each diluted_eps call:
ticker,period,diluted_eps,source
D,Q4 2024,1.09,get_financial_line_item_from_identifiers(identifier='D',line_item='diluted_eps',period_type='quarterly')
D,Q1 2025,-0.11,get_financial_line_item_from_identifiers(identifier='D',line_item='diluted_eps',period_type='quarterly')
...
DUK,Q4 2024,1.52,get_financial_line_item_from_identifiers(identifier='DUK',line_item='diluted_eps',period_type='quarterly')
...
Write /tmp/earnings-preview/peer-market-caps.csv — one row per ticker. Write immediately after each market_cap call:
ticker,market_cap,retrieval_date,source
D,55900000000,2026-02-19,get_capitalization_from_identifiers(identifier='D',capitalization='market_cap')
DUK,98300000000,2026-02-19,get_capitalization_from_identifiers(identifier='DUK',capitalization='market_cap')
...
Write /tmp/earnings-preview/consensus-eps.csv — one row per (ticker, period, consensus mean EPS). Write immediately after each get_consensus_estimates_from_identifiers call:
ticker,period,consensus_mean_eps,num_estimates,source
D,Q4 2025,0.88,12,get_consensus_estimates_from_identifiers(identifier='D',period_type='quarterly',num_periods_forward=4)
D,Q1 2026,0.72,10,get_consensus_estimates_from_identifiers(identifier='D',period_type='quarterly',num_periods_forward=4)
D,Q2 2026,0.91,9,get_consensus_estimates_from_identifiers(identifier='D',period_type='quarterly',num_periods_forward=4)
D,Q3 2026,1.05,8,get_consensus_estimates_from_identifiers(identifier='D',period_type='quarterly',num_periods_forward=4)
DUK,Q4 2025,1.48,14,get_consensus_estimates_from_identifiers(identifier='DUK',period_type='quarterly',num_periods_forward=4)
...
4. Do NOT calculate P/E or returns yet. The raw data is now on disk. Calculations happen in Phase 6 (Verification), reading from these files.
Date Consistency Rule (stock returns): When computing comparative stock returns (YTD %, 1-yr %, 30d %, 90d %), ALL tickers MUST use the exact same start and end dates. After writing all price data to prices.csv, identify the first trading date that appears in ALL tickers' data and use that as the common base date. Do NOT use different base dates for different tickers (e.g., the subject from Feb 19 and peers from Feb 28). If a ticker's data starts later than others, use the first overlapping date for ALL calculations. State the common base date in the appendix for every return calculation.
P/E Currency Rule (LTM P/E): When computing LTM P/E for each company, use that company's most recent 4 reported quarters from peer-eps.csv — not a fixed calendar window applied to all. If a peer has already reported Q4 2025 while the subject company has only reported through Q3 2025, the peer's LTM EPS should include Q4 2025. Check the latest reported period for each company and use the 4 most recent periods per company. Note in the appendix which 4 quarters were used for each P/E calculation.
Market Cap Date-Stamp: When reporting market cap, use the retrieval_date from peer-market-caps.csv. If it differs from the report date, note this in the appendix.
Run these search queries for each category below. Do NOT skip any.
CRITICAL — Capture Source URLs: Every Kensho search result includes a source URL for the underlying article, report, or data page. You MUST record the URL alongside each finding.
After EACH search call, immediately append the results to /tmp/earnings-preview/kensho-findings.txt using the format below. Do NOT wait until all searches are done — write after each one:
=== SEARCH: "[query used]" ===
DATE_RUN: [today's date]
CATEGORY: [estimates|analyst_ratings|risks|news|sector]
FINDING_1: [key finding or excerpt]
URL_1: [source URL from search result]
SOURCE_1: [publication name, date if available]
FINDING_2: [key finding or excerpt]
URL_2: [source URL]
SOURCE_2: [publication name, date]
[...continue for all relevant results from this search...]
Earnings estimates & analyst sentiment:
search for "[TICKER] earnings estimates consensus EPS revenue upcoming quarter"
search for "[TICKER] analyst ratings price target upgrades downgrades"
search for "[TICKER] risks bear case concerns investors"
Recent news (MANDATORY — do not skip): 4. search for "[TICKER] [company name] recent news developments"
Sector context: 5. search for "[company industry/sector] sector outlook trends"
Quarterly financials (last 8 quarters): get_financial_line_item_from_identifiers with period_type="quarterly", num_periods=8 for: revenue, gross_profit, operating_income, ebitda, net_income, diluted_eps
After each line item call returns, immediately append to /tmp/earnings-preview/financials.csv. Write the raw values exactly as returned — do NOT round or convert yet. Include the source column with the exact MCP function call and parameters:
ticker,period,line_item,value,source
D,Q4 2024,revenue,3941000000,get_financial_line_item_from_identifiers(identifier='D',line_item='revenue',period_type='quarterly')
D,Q1 2025,revenue,3400000000,get_financial_line_item_from_identifiers(identifier='D',line_item='revenue',period_type='quarterly')
D,Q2 2025,revenue,4076000000,get_financial_line_item_from_identifiers(identifier='D',line_item='revenue',period_type='quarterly')
D,Q3 2025,revenue,3810000000,get_financial_line_item_from_identifiers(identifier='D',line_item='revenue',period_type='quarterly')
D,Q4 2024,diluted_eps,1.09,get_financial_line_item_from_identifiers(identifier='D',line_item='diluted_eps',period_type='quarterly')
D,Q1 2025,diluted_eps,-0.11,get_financial_line_item_from_identifiers(identifier='D',line_item='diluted_eps',period_type='quarterly')
...
Do NOT calculate margins or growth rates yet. Write raw data only. Calculations happen in Phase 6.
Segment data:
get_segments_from_identifiers with segment_type="business", period_type="quarterly", num_periods=8Immediately write /tmp/earnings-preview/segments.csv:
ticker,period,segment_name,revenue,source
D,Q3 2024,Dominion Energy Virginia,2762000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')
D,Q3 2024,Dominion Energy South Carolina,848000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')
D,Q3 2024,Contracted Energy,260000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')
D,Q3 2025,Dominion Energy Virginia,3311000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')
D,Q3 2025,Dominion Energy South Carolina,945000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')
D,Q3 2025,Contracted Energy,297000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')
...
Earnings history (for stock chart annotations):
get_earnings_from_identifiers — collect past earnings dates within the 12-month price window.
Immediately write /tmp/earnings-preview/earnings-dates.csv:
ticker,earnings_date,call_name,source D,2025-05-02,Q1 2025 Earnings Call,get_earnings_from_identifiers(identifier='D') D,2025-08-01,Q2 2025 Earnings Call,get_earnings_from_identifiers(identifier='D') D,2025-10-31,Q3 2025 Earnings Call,get_earnings_from_identifiers(identifier='D') ...
Before generating the report, read back ALL intermediate files and perform calculations from the clean data. This phase ensures data integrity by working from files rather than compressed conversation context.
Read all intermediate files using bash cat commands:
cat /tmp/earnings-preview/company-info.txtcat /tmp/earnings-preview/transcript-extracts.txtcat /tmp/earnings-preview/financials.csvcat /tmp/earnings-preview/segments.csvcat /tmp/earnings-preview/prices.csvcat /tmp/earnings-preview/peer-eps.csvcat /tmp/earnings-preview/peer-market-caps.csvticker,metric,value,formula,components
D,gross_margin_Q3_2025,32.5%,gross_profit/revenue,"gross_profit=1238100000,revenue=3810000000"
D,revenue_yoy_Q3_2025,+9.3%,(Q3_2025-Q3_2024)/Q3_2024,"Q3_2025=3810000000,Q3_2024=3486000000"
D,ltm_pe,24.2x,price/ltm_eps,"price=65.46,ltm_eps=2.70,quarters=Q4_2024+Q1_2025+Q2_2025+Q3_2025"
D,ntm_pe,18.5x,price/ntm_eps,"price=65.46,ntm_eps=3.56,quarters=Q4_2025(0.88)+Q1_2026(0.72)+Q2_2026(0.91)+Q3_2026(1.05),source=get_consensus_estimates_from_identifiers"
D,yoy_return,+17.6%,(end-start)/start,"end=65.46,start=55.67,base_date=2025-02-19"
DUK,yoy_return,+13.0%,(end-start)/start,"end=126.32,start=111.79,base_date=2025-02-19"
...
This file becomes the single source of truth for all numbers in the report.
STOP — BEFORE WRITING ANY HTML, YOU MUST READ ALL INTERMEDIATE FILES. THIS IS A BLOCKING PREREQUISITE.
This is not optional. You MUST run each cat command below as a separate bash tool call (not combined into one). This ensures each file's contents are individually loaded and visible in the conversation. Do NOT combine them into a single command. Do NOT skip any file.
Run these commands one at a time, each as its own bash call :
cat /tmp/earnings-preview/company-info.txtcat /tmp/earnings-preview/transcript-extracts.txtcat /tmp/earnings-preview/financials.csvcat /tmp/earnings-preview/segments.csvcat /tmp/earnings-preview/prices.csvcat /tmp/earnings-preview/peer-eps.csvcat /tmp/earnings-preview/peer-market-caps.csvcat /tmp/earnings-preview/consensus-eps.csvcat /tmp/earnings-preview/kensho-findings.txtAfter reading ALL files, you MUST print a summary message to the user that lists every file and its status. Use exactly this format:
--- DATA FILE VERIFICATION ---
1. company-info.txt ✓ loaded ([N] lines)
2. transcript-extracts.txt ✓ loaded ([N] lines)
3. financials.csv ✓ loaded ([N] rows)
4. segments.csv ✓ loaded ([N] rows)
5. prices.csv ✓ loaded ([N] rows)
6. peer-eps.csv ✓ loaded ([N] rows)
7. peer-market-caps.csv ✓ loaded ([N] rows)
8. consensus-eps.csv ✓ loaded ([N] rows)
9. kensho-findings.txt ✓ loaded ([N] lines)
10. earnings-dates.csv ✓ loaded ([N] rows)
11. calculations.csv ✓ loaded ([N] rows)
All intermediate data files loaded successfully.
Generating report using file data as the single source of truth.
---
If any file is missing or empty, STOP and tell the user which file failed. Do NOT proceed to generate the report with missing data.
Every number, quote, source URL, and MCP function call reference in the HTML report must come from these files — not from your memory of earlier conversation turns. The files are the single source of truth. Earlier conversation context may have been compressed or summarized and WILL contain errors if relied upon. If a data point is not in the files, it should not appear in the report.
See report-template.md for the complete HTML template, CSS, and Chart.js configuration.
MANDATORY — Use Template Helper Functions for Charts: The report-template.md provides pre-built, debugged Chart.js helper functions. You MUST use these exact functions to create charts. Do NOT write custom inline Chart.js code. The helpers are:
createRevEpsChart(canvasId, labels, revenueData, epsData, revLabel) — for Figure 1createMarginChart(canvasId, labels, grossMargins, opMargins) — for Figure 2createRevGrowthChart(canvasId, labels, growthData) — for Figure 3createAnnotatedPriceChart(canvasId, labels, prices, earningsDates, ticker) — for Figure 5createCompPerfChart(canvasId, labels, datasets) — for Figure 6createPEChart(canvasId, companies) — for Figure 7Each chart call MUST be in its own <script> tag wrapped in a try-catch block. This ensures a bug in one chart does not prevent other charts from rendering. Example:
<script>
try {
createRevEpsChart('chart-rev-eps', [...], [...], [...], 'Revenue ($B)');
} catch(e) { console.error('Figure 1 error:', e); }
</script>
<script>
try {
createMarginChart('chart-margins', [...], [...], [...]);
} catch(e) { console.error('Figure 2 error:', e); }
</script>
The report has two halves: narrative (pages 1-2) and figures (pages 3-5). Keep these tightly integrated.
AI DISCLAIMER (MANDATORY — must appear in 3 places): You MUST include the following disclaimer text in the report HTML. This is not optional — the report is incomplete without it:
"Analysis is AI-generated — please confirm all outputs"
It must appear in exactly these 3 locations:
<div class="ai-disclaimer">Analysis is AI-generated — please confirm all outputs</div><div class="footer-disclaimer">Analysis is AI-generated — please confirm all outputs</div><div class="ai-disclaimer">Analysis is AI-generated — please confirm all outputs</div>PAGE 1: Cover & Thesis
PAGE 2: Estimates, Themes & News
Consensus Estimates Table (single table, labeled as a figure):
class="neg" (red). If positive, use class="pos" (green). If zero or N/A, use class="neutral". The sign of the number determines the class — do NOT override based on interpretation. A -1.1% is ALWAYS red, even if the decline is small.Key Metrics Beyond Headline EPS (bulleted list, 3-5 items):
Themes to Watch (3-5 bullets):
PAGES 3-5: Figures (all charts and tables)
All figures are numbered sequentially. Every figure has a title and source line.
APPENDIX: Data Sources & Calculations (MANDATORY — DO NOT SKIP OR ABBREVIATE)
The appendix MUST begin with the AI disclaimer banner: <div class="ai-disclaimer">Analysis is AI-generated — please confirm all outputs</div>
The final page(s) of the report MUST include an Appendix table that documents every claim — numeric and non-numeric — cited in the report. Every number that appears in the report body must have a corresponding row in this appendix, and every such number in the report body must be a clickable<a href="#ref-N"> hyperlink that scrolls to its appendix row. If a number appears in the report without a hyperlink to the appendix, the report is incomplete.
Table columns : Ref # | Fact | Value | Source & Derivation
Ref # : Sequential ID matching the hyperlink anchors in the report body (ref-1, ref-2, etc.). Each row has an id="ref-N" attribute so hyperlinks scroll to it.
Fact : Human-readable label (e.g., "Q3 FY2026 Revenue", "LTM P/E — WMT", "Management flagged tariff headwinds", "Barclays upgraded to Overweight")
Value : The exact figure as displayed in the report (e.g., "$152.3B", "24.5%", "28.1x"). For non-numeric facts, leave blank or write "N/A".
Source & Derivation: This is the critical column. Every row must have a specific, detailed source — not just a label. Follow these rules strictly:
For raw financial data from S &P Capital IQ (revenue, EPS, gross profit, operating income, net income, EBITDA, prices, market cap, etc.):
* State the MCP function used and its key parameters. Format: `S&P Capital IQ — [function_name](identifier='[TICKER]', line_item='[item]', period_type='[type]', period='[Q# FY####]')`
* Examples:
* `S&P Capital IQ — get_financial_line_item_from_identifiers(identifier='WMT', line_item='revenue', period_type='quarterly', period='Q3 FY2026')`
* `S&P Capital IQ — get_financial_line_item_from_identifiers(identifier='WMT', line_item='diluted_eps', period_type='quarterly', period='Q3 FY2026')`
* `S&P Capital IQ — get_prices_from_identifiers(identifier='WMT', periodicity='day')`
* `S&P Capital IQ — get_capitalization_from_identifiers(identifier='WMT', capitalization='market_cap')`
* **Do NOT just write "S &P Capital IQ" with no detail.** The reader must know exactly which data point from which tool call produced this number.
For calculated values (margins, growth rates, P/E, returns, y/y changes):
* Show the full formula with **hyperlinked components** — each component must be an `<a href="#ref-N">` link back to the appendix row for that raw data point. This is critical: the reader must be able to click through from the calculated value to each of its inputs.
* Example: `Gross Margin = <a href='#ref-5'>Gross Profit $37.2B</a> / <a href='#ref-1'>Revenue $152.3B</a> = 24.4%. Source: S&P Capital IQ (calculated)`
* Example: `LTM P/E = <a href='#ref-20'>Price $172.35</a> / (<a href='#ref-8'>Q1 EPS $1.47</a> + <a href='#ref-9'>Q2 EPS $1.84</a> + <a href='#ref-10'>Q3 EPS $1.53</a> + <a href='#ref-11'>Q4 EPS $1.80</a>) = $172.35 / $6.64 = 25.9x`
* Example: `Revenue y/y growth = (<a href='#ref-12'>Q3 FY26 Rev $165.8B</a> - <a href='#ref-3'>Q3 FY25 Rev $160.8B</a>) / <a href='#ref-3'>Q3 FY25 Rev $160.8B</a> = +3.1%`
* **Every formula component must be a clickable hyperlink.** Do NOT write formulas with plain-text numbers.
For transcript-sourced claims (quotes, management commentary, guidance):
* Write the **verbatim excerpt sentence** from the transcript.
* Reference the transcript by its full name and the `key_dev_id` used to fetch it.
* Format: `"[verbatim quote]" — [Speaker], [Title]. Source: [Q# FY#### Earnings Call Transcript] (key_dev_id: [ID])`
* Example: `"We expect comp sales growth of 3-4% in Q4" — CEO John Furner. Source: Q3 FY2026 Earnings Call Transcript (key_dev_id: 12345678)`
For Kensho Grounding search results (news, analyst ratings, consensus estimates):
* Write the key finding or excerpt from the search result.
* **MANDATORY: Include the source URL** returned by the Kensho `search` tool as a clickable `<a href="[URL]" target="_blank">` hyperlink. This is the most important part — readers must be able to click through to the original source.
* Format: `"[finding/excerpt]" — <a href="[URL]" target="_blank">[Source Title or Publication]</a>. Query: search("[query used]")`
* Example: `"Barclays upgraded WMT to Overweight with $210 price target on Jan 15, 2026." — <a href="https://www.investing.com/news/barclays-upgrades-wmt" target="_blank">Investing.com, Jan 15 2026</a>. Query: search("WMT analyst ratings price target upgrades downgrades")`
* If no URL was returned for a particular result, write "Source URL not available" and still include the search query.
Completeness check: Before finalizing the report, scan every number in the report body. If any number is not wrapped in <a href="#ref-N" class="data-ref">, fix it. If any appendix row has a Source & Derivation that is just a bare label like "S&P Capital IQ" with no function call detail, fix it. If any calculated value's formula lacks hyperlinked components, fix it. If any Kensho-sourced claim lacks a source URL, fix it.
Group the appendix rows by section (Financials, Valuation, Estimates & Consensus, Transcript Claims, News & Analyst Commentary, Stock Performance) with subheadings. Use smaller font size (10-11px).
earnings-preview-[TICKER]-YYYY-MM-DD.html in the current working directory.open earnings-preview-[TICKER]-YYYY-MM-DD.html<a class="data-ref"> tag linking to its appendix entry. Numbers: <a href="#ref-1" class="data-ref">$152.3B</a>. Qualitative: <a href="#ref-25" class="data-ref">management flagged tariff headwinds as the primary margin risk</a>. No fact should appear without a traceable source in the appendix.Weekly Installs
50
Repository
GitHub Stars
5.6K
First Seen
13 days ago
Security Audits
Gen Agent Trust HubPassSocketWarnSnykWarn
Installed on
opencode49
gemini-cli49
github-copilot49
amp49
codex49
kimi-cli49
Python PDF处理教程:合并拆分、提取文本表格、创建PDF文件
59,800 周安装
Loom视频转录获取器 - 自动提取Loom视频字幕与文本,支持GraphQL API
163 周安装
bioRxiv数据库Python工具:高效搜索下载预印本,支持关键词/作者/日期/类别筛选
163 周安装
Magento 2 Hyvä CMS 组件创建器 - 快速构建自定义CMS组件
163 周安装
项目文档协调器 - 自动化文档生成与上下文管理工具
163 周安装
GPUI 布局与样式:Rust 类型安全的 CSS 样式库,Flexbox 布局与链式 API
163 周安装
Telegram自动化指南:通过Rube MCP与Composio实现消息发送、聊天管理
163 周安装
capitalization="market_cap"get_consensus_estimates_from_identifiers with period_type="quarterly", num_periods_forward=4 — this returns consensus mean EPS estimates for the next 4 quarters, which are summed to compute NTM EPScat /tmp/earnings-preview/consensus-eps.csvcat /tmp/earnings-preview/kensho-findings.txtcat /tmp/earnings-preview/earnings-dates.csvCalculate derived metrics from the raw data now in context:
peer-eps.csv)consensus-eps.csv. Add all 4 quarters' consensus_mean_eps values for each ticker. If fewer than 4 forward quarters are available for a peer, mark NTM P/E as "n/a". Note in the appendix which 4 quarters were summed.prices.csv, then compute returns from that dateCross-check :
segments.csv. If not, mark "y/y not available."transcript-extracts.txt are exact copy-pastes (not paraphrases).Write /tmp/earnings-preview/calculations.csv with all derived values:
cat /tmp/earnings-preview/earnings-dates.csvcat /tmp/earnings-preview/calculations.csvRecent News & Developments (3-5 bullets):