Single-Company Earnings Preview 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 ( ) and S&P Global MCP ( ). Absolutely NO other tools, data sources, or web access of any kind. Specifically: - Do NOT use , , , , , or ANY generic web/internet search tool — even if Kensho is slow, returns no results, or i…

+ ctx.raw.toFixed(2) } }\n }\n }\n });\n}\n\n// ── Helper: Competitor Indexed Performance Chart ──\n// datasets: [{ label: 'TICKER', data: [price1, price2, ...], color: '#xxx', isSubject: true/false }, ...]\nfunction createCompPerfChart(canvasId, labels, datasets) {\n const ctx = document.getElementById(canvasId);\n if (!ctx) return;\n const chartDatasets = datasets.map((ds, i) => {\n const base = ds.data[0] || 1;\n return {\n label: ds.label,\n data: ds.data.map(v => (v / base) * 100),\n borderColor: ds.color || COMP_COLORS[i % COMP_COLORS.length],\n backgroundColor: 'transparent',\n borderWidth: ds.isSubject ? 3 : 1.5,\n borderDash: ds.isSubject ? [] : [4, 2],\n pointRadius: 0,\n tension: 0.2\n };\n });\n new Chart(ctx, {\n type: 'line',\n data: { labels: labels, datasets: chartDatasets },\n options: {\n responsive: true,\n interaction: { mode: 'index', intersect: false },\n scales: {\n y: { title: { display: true, text: 'Indexed (100 = Start)', font: { size: 11 } }, grid: { color: '#eee' } },\n x: { ticks: { maxTicksLimit: 12 } }\n },\n plugins: {\n tooltip: { callbacks: { label: ctx => ctx.dataset.label + ': ' + ctx.raw.toFixed(1) } }\n }\n }\n });\n}\n\n// ── Helper: LTM P/E Horizontal Bar Chart ──\n// companies: [{ label: 'TICKER', pe: 25.3, isSubject: true/false }, ...]\nfunction createPEChart(canvasId, companies) {\n const ctx = document.getElementById(canvasId);\n if (!ctx) return;\n companies.sort((a, b) => b.pe - a.pe);\n new Chart(ctx, {\n type: 'bar',\n data: {\n labels: companies.map(c => c.label),\n datasets: [{\n label: 'LTM P/E',\n data: companies.map(c => c.pe),\n backgroundColor: companies.map(c => c.isSubject ? COLORS.navy : COLORS.lightBlue),\n borderColor: companies.map(c => c.isSubject ? COLORS.navy : COLORS.blue),\n borderWidth: 1\n }]\n },\n options: {\n indexAxis: 'y',\n responsive: true,\n scales: {\n x: {\n title: { display: true, text: 'LTM P/E', font: { size: 11 } },\n grid: { color: '#eee' }\n },\n y: {\n ticks: { font: { size: 12, weight: 'bold' } }\n }\n },\n plugins: {\n legend: { display: false },\n tooltip: {\n callbacks: { label: ctx => 'P/E: ' + ctx.raw.toFixed(1) + 'x' }\n }\n }\n }\n });\n}\n\n// ═══════════════════════════════════════════════\n// HELPER FUNCTIONS DEFINED ABOVE — DO NOT REWRITE THEM.\n// Use ONLY these functions to create charts.\n// DO NOT write custom inline Chart.js code.\n// ═══════════════════════════════════════════════\n\n\u003c/script>\n\n\u003c!-- ═══════════════════════════════════════════════════════════ -->\n\u003c!-- CHART DATA — EACH CHART IN ITS OWN SCRIPT + TRY-CATCH -->\n\u003c!-- A syntax error in one chart must NOT break the others. -->\n\u003c!-- MANDATORY: Use the helper functions above. No custom code. -->\n\u003c!-- ═══════════════════════════════════════════════════════════ -->\n\n\u003c!-- Figure 1: Revenue & EPS -->\n\u003cscript>\ntry {\n createRevEpsChart('chart-rev-eps',\n ['Q1 FY24','Q2 FY24','Q3 FY24','Q4 FY24','Q1 FY25','Q2 FY25','Q3 FY25','Q4 FY25'],\n [152.3, 161.6, 160.8, 173.4, 161.5, 169.3, 165.8, 178.0], // revenue in $B\n [1.47, 1.84, 1.53, 1.80, 1.56, 1.92, 1.60, 1.90], // diluted EPS\n 'Revenue ($B)'\n );\n} catch(e) { console.error('Figure 1 error:', e); }\n\u003c/script>\n\n\u003c!-- Figure 2: Margin Trends -->\n\u003cscript>\ntry {\n createMarginChart('chart-margins',\n ['Q1 FY24','Q2 FY24','Q3 FY24','Q4 FY24','Q1 FY25','Q2 FY25','Q3 FY25','Q4 FY25'],\n [24.0, 24.4, 24.2, 23.8, 24.5, 24.8, 24.6, 24.1], // gross margin %\n [4.2, 5.1, 4.5, 4.8, 4.6, 5.3, 4.7, 5.0] // operating margin %\n );\n} catch(e) { console.error('Figure 2 error:', e); }\n\u003c/script>\n\n\u003c!-- Figure 3: Revenue Growth y/y — ONLY quarters where y/y can be computed (most recent 4) -->\n\u003cscript>\ntry {\n createRevGrowthChart('chart-rev-growth',\n ['Q1 FY25','Q2 FY25','Q3 FY25','Q4 FY25'], // Only 4 labels — quarters with y/y data\n [6.0, 4.8, 3.1, 2.7] // y/y revenue growth % for those 4 quarters\n );\n} catch(e) { console.error('Figure 3 error:', e); }\n\u003c/script>\n\n\u003c!-- Figure 5: Annotated Stock Price -->\n\u003cscript>\ntry {\n createAnnotatedPriceChart('chart-price-annotated',\n ['2025-02-18','2025-02-19'], // ... daily date labels for 1 year\n [170.5, 171.2], // ... daily closing prices\n [\n { date: '2025-05-15', label: 'Q1 FY26', move: '+3.2%' },\n { date: '2025-08-15', label: 'Q2 FY26', move: '-1.8%' }\n ],\n 'WMT'\n );\n} catch(e) { console.error('Figure 5 error:', e); }\n\u003c/script>\n\n\u003c!-- Figure 6: Competitor Indexed Performance -->\n\u003cscript>\ntry {\n createCompPerfChart('chart-comp-perf',\n ['2025-02-18','2025-03-18'], // ... date labels\n [\n { label: 'WMT', data: [170.5, 172.3], isSubject: true },\n { label: 'COST', data: [580.2, 595.1], isSubject: false },\n { label: 'TGT', data: [142.0, 138.5], isSubject: false }\n ]\n );\n} catch(e) { console.error('Figure 6 error:', e); }\n\u003c/script>\n\n\u003c!-- Figure 7: LTM P/E Comparison -->\n\u003cscript>\ntry {\n createPEChart('chart-pe-comp', [\n { label: 'COST', pe: 52.3, isSubject: false },\n { label: 'WMT', pe: 28.1, isSubject: true },\n { label: 'TGT', pe: 15.6, isSubject: false },\n { label: 'BJ', pe: 22.4, isSubject: false }\n ]);\n} catch(e) { console.error('Figure 7 error:', e); }\n\u003c/script>\n\n\u003c/body>\n\u003c/html>\n```\n\n## Chart.js Implementation Notes\n\n### Figure 2: Revenue & EPS Chart\n- **Type**: Combo bar + line\n- **Bars**: Quarterly revenue on left y-axis\n- **Line**: Diluted EPS on right y-axis\n- **Labels**: Quarter identifiers (e.g., \"Q1 FY24\")\n- Use 8 quarters of data\n\n### Figure 3: Margin Trend Chart\n- **Type**: Dual line chart\n- **Lines**: Gross margin % and operating margin %\n- **Y-axis**: Percentage with 1 decimal place\n\n### Figure 3: Revenue Growth Chart\n- **Type**: Bar chart with conditional coloring\n- **Green bars**: Positive growth quarters\n- **Red bars**: Negative growth quarters\n- **IMPORTANT**: Only include quarters where y/y growth can be computed (i.e., where both the current quarter AND the year-ago quarter exist in `financials.csv`). With 8 quarters of raw data, this typically yields 4 bars — NOT 8. Do not pass labels for quarters without y/y data.\n- No legend needed (self-explanatory)\n\n### Figure 4: Business Segment Revenue\n- Use HTML table (not a chart)\n- Columns: Segment | Latest Q Rev ($M) | % of Total | y/y Change\n- Color-code y/y change cells with pos/neg classes\n\n### Figure 5: Earnings-Annotated Stock Price Chart\n- **Type**: Line chart with annotation plugin vertical lines\n- **Data**: 1 year of daily closing prices\n- **Annotations**: Vertical dashed lines at each earnings date\n- **Labels**: Quarter name + 1-day post-earnings stock move\n- **Colors**: Green for positive reactions, red for negative\n- **Calculating the 1-day move**: Compare closing price on earnings date to next trading day close\n- **CRITICAL**: The annotation plugin MUST be registered before creating charts: `Chart.register(window['chartjs-plugin-annotation'])` — this is already in the template script block\n\n### Figure 7: Competitor Indexed Performance Chart\n- **Type**: Multi-line chart, rebased to 100\n- **Subject company**: Solid thick line (borderWidth: 3)\n- **Competitors**: Thinner dashed lines (borderWidth: 1.5, borderDash)\n- This visual hierarchy makes the subject company immediately identifiable\n\n### Figure 8: LTM P/E Comparison Chart\n- **Type**: Horizontal bar chart\n- **Subject company**: Highlighted in navy (#1a1a4e)\n- **Competitors**: Light blue (#85c1e9)\n- **Sorted**: Descending by P/E\n- Shows at a glance whether the company trades at a premium or discount to peers\n\n### Figure 8: Competitor Comparison Table\n- HTML table with highlight-row for subject company\n- Columns: Ticker | Company | Mkt Cap ($B) | LTM P/E | NTM P/E | YTD % | 1-Yr %\n- Color-code returns with pos/neg classes\n\n## Formatting Conventions\n\n### Numbers\n- Revenue: 1 decimal place for $B (e.g., \"$152.3B\"), no decimals for $M (e.g., \"$4,521M\")\n- EPS: 2 decimal places (e.g., \"$1.47\")\n- Margins: 1 decimal place with % sign (e.g., \"24.5%\")\n- Growth rates: 1 decimal place with +/- sign (e.g., \"+5.2%\", \"-3.1%\")\n- Market cap: 1 decimal place for $B (e.g., \"$562.1B\")\n- Stock prices: 2 decimal places (e.g., \"$172.35\")\n- P/E ratios: 1 decimal place with 'x' suffix (e.g., \"25.3x\")\n\n### Color Coding\n- Positive values: `class=\"pos\"` -- green (#0d7a3e)\n- Negative values: `class=\"neg\"` -- red (#c0392b)\n- Neutral/flat: `class=\"neutral\"` -- gray (#555)\n- Subject company row: `class=\"highlight-row\"` -- light blue background\n\n### Figure Labels\n- Number all figures sequentially: \"Figure 1:\", \"Figure 2:\", etc.\n- Figures 1-8 are on Pages 3-5 (the Consensus Estimates table on Page 2 is not numbered)\n- Include source attribution under every chart and table: \"Source: S&P Capital IQ\"\n\n### Hyperlinked Claims\n- Every factual claim in the report body — numbers AND qualitative statements — must be wrapped in `\u003ca href=\"#ref-N\" class=\"data-ref\">CLAIM TEXT\u003c/a>`\n- The `ref-N` ID must match a row in the Appendix table\n- This applies to: narrative text, bullet points, table cells, blockquotes — anywhere a fact appears\n- Chart axis labels and tooltips do NOT need hyperlinks (only report body text)\n- Assign reference IDs sequentially (`ref-1`, `ref-2`, ...) as you write the report\n- Multiple references to the same underlying claim should share the same ref ID\n- For qualitative claims, wrap the key phrase: `\u003ca href=\"#ref-25\" class=\"data-ref\">management flagged tariff headwinds\u003c/a>`\n\n### Appendix\n- **MUST begin with**: `\u003cdiv class=\"ai-disclaimer\">Analysis is AI-generated — please confirm all outputs\u003c/div>`\n- The Appendix is the final section of the report, after all figures\n- **4 columns**: Ref # | Fact | Value | Source & Derivation\n- One row per unique claim referenced in the report (numeric and non-numeric)\n- **Every number in the report body must be a clickable `\u003ca href=\"#ref-N\">` link to its appendix row. No exceptions.**\n- Group rows by category: Quarterly Financials, Valuation, Transcript Claims, Estimates & Consensus, News & Analyst Commentary, Stock Performance\n- Use subheading rows (`appendix-group` class) to separate groups\n- **Source & Derivation column** must include specific, detailed sourcing for EVERY row:\n - For raw S&P data (revenue, EPS, prices, market cap, etc.): `\u003cspan class=\"src-label\">S&P Capital IQ\u003c/span>` followed by the specific MCP function call with parameters (e.g., `get_financial_line_item_from_identifiers(identifier='WMT', line_item='revenue', period_type='quarterly', period='Q3 FY2026')`). **Never write just \"S&P Capital IQ\" with no detail.**\n - For calculated values (margins, growth rates, P/E, returns): the full formula with `\u003ca class=\"data-ref\">` hyperlinks to each component row (use `formula` CSS class). **Every number in the formula must be a clickable link to its own appendix row.**\n - For transcript claims: the verbatim excerpt sentence in italics (`excerpt` CSS class) + transcript name with `transcript-ref` class + `key_dev_id`\n - For Kensho results: the key finding (`excerpt` class) + **clickable source URL** as `\u003ca href=\"[URL]\" target=\"_blank\" class=\"src-url\">[Source Title]\u003c/a>` + the search query used. **Every Kensho-sourced claim must have a clickable URL to the original source.**\n- Source labels use the `src-label` CSS class (bold navy)\n- External source URLs use the `src-url` CSS class (blue, underlined, clickable)\n\n### Style Rules\n- **NO EMOJIS** anywhere in the report. No emoji in headings, tables, chart labels, or body text. This is a professional research document.\n- Font: Arial Narrow throughout (body, headings, tables, charts).\n- Management quotes: Integrate as `\u003cblockquote>` elements within the executive thesis narrative. Never under a separate heading.\n- Keep all text concise. Target 4-5 printed pages total (appendix is additional).\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":45686,"content_sha256":"8e2000571c615a4b6b66c85d487007ee2bf2e7fd3463103070eb6b174e6a64be"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Single-Company Earnings Preview","type":"text"}]},{"type":"paragraph","content":[{"text":"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.","type":"text"}]},{"type":"paragraph","content":[{"text":"Data Sources (ZERO EXCEPTIONS):","type":"text","marks":[{"type":"strong"}]},{"text":" The ONLY permitted data sources are ","type":"text"},{"text":"Kensho Grounding MCP","type":"text","marks":[{"type":"strong"}]},{"text":" (","type":"text"},{"text":"search","type":"text","marks":[{"type":"code_inline"}]},{"text":") and ","type":"text"},{"text":"S&P Global MCP","type":"text","marks":[{"type":"strong"}]},{"text":" (","type":"text"},{"text":"kfinance","type":"text","marks":[{"type":"code_inline"}]},{"text":"). Absolutely NO other tools, data sources, or web access of any kind. Specifically:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do NOT use ","type":"text"},{"text":"WebSearch","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"WebFetch","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"web_search","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"brave_search","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"google_search","type":"text","marks":[{"type":"code_inline"}]},{"text":", or ANY generic web/internet search tool — even if Kensho is slow, returns no results, or is temporarily unavailable.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do NOT use any browser, URL fetch, or web scraping tool.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If Kensho Grounding returns no results for a query, try rephrasing the query or note \"data not available\" in the report. ","type":"text"},{"text":"NEVER fall back to web search as an alternative.","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Every piece of information in the report must be traceable to either a ","type":"text"},{"text":"kfinance","type":"text","marks":[{"type":"code_inline"}]},{"text":" MCP function call or a Kensho ","type":"text"},{"text":"search","type":"text","marks":[{"type":"code_inline"}]},{"text":" call. If it cannot be sourced to one of these two, it must not appear in the report.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Critical Rule:","type":"text","marks":[{"type":"strong"}]},{"text":" You MUST complete ALL research and data collection (Phases 1-5) BEFORE writing any part of the report.","type":"text"}]},{"type":"paragraph","content":[{"text":"Intermediate File Rule:","type":"text","marks":[{"type":"strong"}]},{"text":" All raw data from MCP tool calls MUST be written to files in ","type":"text"},{"text":"/tmp/earnings-preview/","type":"text","marks":[{"type":"code_inline"}]},{"text":" ","type":"text"},{"text":"immediately after each tool call returns","type":"text","marks":[{"type":"strong"}]},{"text":" — 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 ","type":"text"},{"text":"mkdir -p /tmp/earnings-preview","type":"text","marks":[{"type":"code_inline"}]},{"text":" to create the directory. ","type":"text"},{"text":"Before generating the HTML report (Phase 7), you MUST read ALL intermediate files back into context using ","type":"text","marks":[{"type":"strong"}]},{"text":"cat","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" 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.","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"Fiscal Quarter Rule:","type":"text","marks":[{"type":"strong"}]},{"text":" 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 ","type":"text"},{"text":"get_next_earnings_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"get_earnings_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" (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 ","type":"text"},{"text":"get_financial_line_item_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" period labels.","type":"text"}]},{"type":"paragraph","content":[{"text":"Length Rule:","type":"text","marks":[{"type":"strong"}]},{"text":" 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.","type":"text"}]},{"type":"paragraph","content":[{"text":"Verbatim Quote Rule:","type":"text","marks":[{"type":"strong"}]},{"text":" When quoting management in ","type":"text"},{"text":"\u003cblockquote>","type":"text","marks":[{"type":"code_inline"}]},{"text":" tags, the text MUST be copied ","type":"text"},{"text":"exactly","type":"text","marks":[{"type":"strong"}]},{"text":" 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.","type":"text"}]},{"type":"paragraph","content":[{"text":"Calculation Integrity Rule:","type":"text","marks":[{"type":"strong"}]},{"text":" 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.","type":"text"}]},{"type":"paragraph","content":[{"text":"Ratio Nomenclature Rule:","type":"text","marks":[{"type":"strong"}]},{"text":" All valuation ratios must be explicitly labeled as ","type":"text"},{"text":"LTM","type":"text","marks":[{"type":"strong"}]},{"text":" (Last Twelve Months) or ","type":"text"},{"text":"NTM","type":"text","marks":[{"type":"strong"}]},{"text":" (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 ","type":"text"},{"text":"sum of the next 4 quarterly consensus mean EPS estimates","type":"text","marks":[{"type":"strong"}]},{"text":" from ","type":"text"},{"text":"get_consensus_estimates_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" — NOT a single annual figure. Both LTM and NTM P/E must be computed and displayed in the competitor comparison table.","type":"text"}]},{"type":"paragraph","content":[{"text":"Hyperlink Rule (STRICTLY ENFORCED):","type":"text","marks":[{"type":"strong"}]},{"text":" Every claim in the report — numeric AND non-numeric — MUST be wrapped in an ","type":"text"},{"text":"\u003ca href=\"#ref-N\" class=\"data-ref\">","type":"text","marks":[{"type":"code_inline"}]},{"text":" hyperlink pointing to the corresponding entry in the Appendix. ","type":"text"},{"text":"This is not optional. Every single number in the report must be a clickable link.","type":"text","marks":[{"type":"strong"}]},{"text":" 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 (","type":"text"},{"text":"ref-1","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"ref-2","type":"text","marks":[{"type":"code_inline"}]},{"text":", etc.). The hyperlink style is subtle — navy color, no underline, dotted underline on hover. ","type":"text"},{"text":"Do NOT write any number in the report body without wrapping it in an ","type":"text","marks":[{"type":"strong"}]},{"text":"\u003ca>","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" tag.","type":"text","marks":[{"type":"strong"}]},{"text":" Example: write ","type":"text"},{"text":"\u003ca href=\"#ref-1\" class=\"data-ref\">$152.3B\u003c/a>","type":"text","marks":[{"type":"code_inline"}]},{"text":", NEVER write ","type":"text"},{"text":"$152.3B","type":"text","marks":[{"type":"code_inline"}]},{"text":" as plain text.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 1: Company Profile & Setup","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Parse the single company ticker from ","type":"text"},{"text":"$ARGUMENTS","type":"text","marks":[{"type":"code_inline"}]},{"text":" (strip whitespace).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run ","type":"text"},{"text":"mkdir -p /tmp/earnings-preview","type":"text","marks":[{"type":"code_inline"}]},{"text":" to create the working directory.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Call ","type":"text"},{"text":"get_latest()","type":"text","marks":[{"type":"code_inline"}]},{"text":" to establish current reporting period context.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Call ","type":"text"},{"text":"get_info_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" — record market cap, industry.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Call ","type":"text"},{"text":"get_company_summary_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" — record business description.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Call ","type":"text"},{"text":"get_next_earnings_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" — record upcoming earnings date and fiscal quarter name.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Immediately write","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/tmp/earnings-preview/company-info.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":":","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"TICKER: [ticker]\nCOMPANY: [full name]\nINDUSTRY: [industry]\nMARKET_CAP: [value] (as of [date])\nNEXT_EARNINGS_DATE: [date]\nNEXT_EARNINGS_QUARTER: [Q# FY#### exactly as returned by API]\nBUSINESS_DESCRIPTION: [2-3 sentence summary]","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 2: Earnings Transcript Analysis (MANDATORY — COMPLETE BEFORE WRITING)","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Call ","type":"text"},{"text":"get_latest_earnings_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" to get the most recent completed earnings call ","type":"text"},{"text":"key_dev_id","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Call ","type":"text"},{"text":"get_transcript_from_key_dev_id","type":"text","marks":[{"type":"code_inline"}]},{"text":" for that transcript.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Immediately write","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/tmp/earnings-preview/transcript-extracts.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" with the following sections. Write this file WHILE you still have the transcript in context — do not wait:","type":"text"}]}]}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"TRANSCRIPT_SOURCE: [Call Name, e.g., \"Q3 2025 Earnings Call\"]\nKEY_DEV_ID: [key_dev_id]\nCALL_DATE: [date]\nFISCAL_QUARTER: [Q# FY####]\n\n=== VERBATIM QUOTES (copy-paste exactly — do NOT paraphrase) ===\nQUOTE_1: \"[exact text from transcript]\"\nSPEAKER_1: [Name], [Title]\nCONTEXT_1: [1 sentence on where this appeared — prepared remarks or Q&A]\n\nQUOTE_2: \"[exact text from transcript]\"\nSPEAKER_2: [Name], [Title]\nCONTEXT_2: [context]\n\nQUOTE_3: \"[exact text from transcript]\"\nSPEAKER_3: [Name], [Title]\nCONTEXT_3: [context]\n\nQUOTE_4: \"[exact text from transcript]\"\nSPEAKER_4: [Name], [Title]\nCONTEXT_4: [context]\n\n=== GUIDANCE (quantitative only) ===\n- [metric]: [range or point estimate as stated by management]\n- [metric]: [range or point estimate]\n\n=== KEY DRIVERS ===\n- [driver 1 with supporting data point]\n- [driver 2 with supporting data point]\n- [driver 3 with supporting data point]\n\n=== HEADWINDS & RISKS ===\n- [risk 1 with quantification if available]\n- [risk 2]\n\n=== ANALYST Q&A THEMES ===\n- [theme 1: what analysts pushed on]\n- [theme 2]\n- [theme 3]\n\n=== SYNTHESIS: THEMES TO WATCH NEXT QUARTER ===\n- [theme 1]\n- [theme 2]\n- [theme 3]","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 3: Competitor Analysis","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Call ","type":"text"},{"text":"get_competitors_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" with ","type":"text"},{"text":"competitor_source=\"all\"","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Select ","type":"text"},{"text":"top 5-7 most relevant public competitors","type":"text","marks":[{"type":"strong"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"For the company AND all selected competitors, gather:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"get_prices_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" with ","type":"text"},{"text":"periodicity=\"day\"","type":"text","marks":[{"type":"code_inline"}]},{"text":", last 12 months","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"get_financial_line_item_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" for ","type":"text"},{"text":"diluted_eps","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"period_type=\"quarterly\"","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"num_periods=8","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"get_capitalization_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" with ","type":"text"},{"text":"capitalization=\"market_cap\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" (latest)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"get_consensus_estimates_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" with ","type":"text"},{"text":"period_type=\"quarterly\"","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"num_periods_forward=4","type":"text","marks":[{"type":"code_inline"}]},{"text":" — this returns consensus mean EPS estimates for the next 4 quarters, which are summed to compute NTM EPS","type":"text"}]}]}]}]}]},{"type":"paragraph","content":[{"text":"After each tool call returns, immediately append the raw data to the appropriate intermediate file:","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"Write","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/tmp/earnings-preview/prices.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":" — one row per (ticker, date, close). Include the ","type":"text"},{"text":"source","type":"text","marks":[{"type":"code_inline"}]},{"text":" column with the exact MCP function call. Write the subject company's prices first, then each competitor's as you fetch them:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"ticker,date,close,source\nD,2025-02-19,55.67,get_prices_from_identifiers(identifier='D',periodicity='day')\nD,2025-02-20,55.82,get_prices_from_identifiers(identifier='D',periodicity='day')\n...\nDUK,2025-02-19,111.79,get_prices_from_identifiers(identifier='DUK',periodicity='day')\n...","type":"text"}]},{"type":"paragraph","content":[{"text":"Note: the ","type":"text"},{"text":"source","type":"text","marks":[{"type":"code_inline"}]},{"text":" value is the same for all rows from a single call — write it on every row so it's always available.","type":"text"}]},{"type":"paragraph","content":[{"text":"Write","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/tmp/earnings-preview/peer-eps.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":" — one row per (ticker, period, eps). Write immediately after each ","type":"text"},{"text":"diluted_eps","type":"text","marks":[{"type":"code_inline"}]},{"text":" call:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"ticker,period,diluted_eps,source\nD,Q4 2024,1.09,get_financial_line_item_from_identifiers(identifier='D',line_item='diluted_eps',period_type='quarterly')\nD,Q1 2025,-0.11,get_financial_line_item_from_identifiers(identifier='D',line_item='diluted_eps',period_type='quarterly')\n...\nDUK,Q4 2024,1.52,get_financial_line_item_from_identifiers(identifier='DUK',line_item='diluted_eps',period_type='quarterly')\n...","type":"text"}]},{"type":"paragraph","content":[{"text":"Write","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/tmp/earnings-preview/peer-market-caps.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":" — one row per ticker. Write immediately after each ","type":"text"},{"text":"market_cap","type":"text","marks":[{"type":"code_inline"}]},{"text":" call:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"ticker,market_cap,retrieval_date,source\nD,55900000000,2026-02-19,get_capitalization_from_identifiers(identifier='D',capitalization='market_cap')\nDUK,98300000000,2026-02-19,get_capitalization_from_identifiers(identifier='DUK',capitalization='market_cap')\n...","type":"text"}]},{"type":"paragraph","content":[{"text":"Write","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/tmp/earnings-preview/consensus-eps.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":" — one row per (ticker, period, consensus mean EPS). Write immediately after each ","type":"text"},{"text":"get_consensus_estimates_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" call:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"ticker,period,consensus_mean_eps,num_estimates,source\nD,Q4 2025,0.88,12,get_consensus_estimates_from_identifiers(identifier='D',period_type='quarterly',num_periods_forward=4)\nD,Q1 2026,0.72,10,get_consensus_estimates_from_identifiers(identifier='D',period_type='quarterly',num_periods_forward=4)\nD,Q2 2026,0.91,9,get_consensus_estimates_from_identifiers(identifier='D',period_type='quarterly',num_periods_forward=4)\nD,Q3 2026,1.05,8,get_consensus_estimates_from_identifiers(identifier='D',period_type='quarterly',num_periods_forward=4)\nDUK,Q4 2025,1.48,14,get_consensus_estimates_from_identifiers(identifier='DUK',period_type='quarterly',num_periods_forward=4)\n...","type":"text"}]},{"type":"ordered_list","attrs":{"order":4,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do NOT calculate P/E or returns yet.","type":"text","marks":[{"type":"strong"}]},{"text":" The raw data is now on disk. Calculations happen in Phase 6 (Verification), reading from these files.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Date Consistency Rule (stock returns):","type":"text","marks":[{"type":"strong"}]},{"text":" When computing comparative stock returns (YTD %, 1-yr %, 30d %, 90d %), ALL tickers MUST use the ","type":"text"},{"text":"exact same start and end dates","type":"text","marks":[{"type":"strong"}]},{"text":". After writing all price data to ","type":"text"},{"text":"prices.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":", 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.","type":"text"}]},{"type":"paragraph","content":[{"text":"P/E Currency Rule (LTM P/E):","type":"text","marks":[{"type":"strong"}]},{"text":" When computing LTM P/E for each company, use that company's ","type":"text"},{"text":"most recent 4 reported quarters","type":"text","marks":[{"type":"strong"}]},{"text":" from ","type":"text"},{"text":"peer-eps.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":" — 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.","type":"text"}]},{"type":"paragraph","content":[{"text":"Market Cap Date-Stamp:","type":"text","marks":[{"type":"strong"}]},{"text":" When reporting market cap, use the ","type":"text"},{"text":"retrieval_date","type":"text","marks":[{"type":"code_inline"}]},{"text":" from ","type":"text"},{"text":"peer-market-caps.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":". If it differs from the report date, note this in the appendix.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 4: News, Estimates & Sector Intelligence (via Kensho Grounding)","type":"text"}]},{"type":"paragraph","content":[{"text":"Run these ","type":"text"},{"text":"search","type":"text","marks":[{"type":"code_inline"}]},{"text":" queries for ","type":"text"},{"text":"each","type":"text","marks":[{"type":"strong"}]},{"text":" category below. Do NOT skip any.","type":"text"}]},{"type":"paragraph","content":[{"text":"CRITICAL — Capture Source URLs:","type":"text","marks":[{"type":"strong"}]},{"text":" Every Kensho ","type":"text"},{"text":"search","type":"text","marks":[{"type":"code_inline"}]},{"text":" result includes a ","type":"text"},{"text":"source URL","type":"text","marks":[{"type":"strong"}]},{"text":" for the underlying article, report, or data page. You MUST record the URL alongside each finding.","type":"text"}]},{"type":"paragraph","content":[{"text":"After EACH search call, immediately append the results to","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/tmp/earnings-preview/kensho-findings.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" using the format below. Do NOT wait until all searches are done — write after each one:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"=== SEARCH: \"[query used]\" ===\nDATE_RUN: [today's date]\nCATEGORY: [estimates|analyst_ratings|risks|news|sector]\n\nFINDING_1: [key finding or excerpt]\nURL_1: [source URL from search result]\nSOURCE_1: [publication name, date if available]\n\nFINDING_2: [key finding or excerpt]\nURL_2: [source URL]\nSOURCE_2: [publication name, date]\n\n[...continue for all relevant results from this search...]","type":"text"}]},{"type":"paragraph","content":[{"text":"Earnings estimates & analyst sentiment:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"search","type":"text","marks":[{"type":"code_inline"}]},{"text":" for \"[TICKER] earnings estimates consensus EPS revenue upcoming quarter\"","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Record: consensus EPS, consensus revenue, estimate revision direction over last 90 days.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Append to kensho-findings.txt immediately.","type":"text","marks":[{"type":"strong"}]}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"search","type":"text","marks":[{"type":"code_inline"}]},{"text":" for \"[TICKER] analyst ratings price target upgrades downgrades\"","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Record: recent upgrades/downgrades, price target range, bull/bear thesis summaries.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Append to kensho-findings.txt immediately.","type":"text","marks":[{"type":"strong"}]}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"search","type":"text","marks":[{"type":"code_inline"}]},{"text":" for \"[TICKER] risks bear case concerns investors\"","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Record: key debates, bear arguments, swing factors for the upcoming print.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Append to kensho-findings.txt immediately.","type":"text","marks":[{"type":"strong"}]}]}]}]}]}]},{"type":"paragraph","content":[{"text":"Recent news (MANDATORY — do not skip):","type":"text","marks":[{"type":"strong"}]},{"text":" 4. ","type":"text"},{"text":"search","type":"text","marks":[{"type":"code_inline"}]},{"text":" for \"[TICKER] [company name] recent news developments\"","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Record: material news from the last 60 days — M&A, product launches, executive changes, regulatory actions, partnerships, legal developments, tariffs, or any event that could affect the upcoming earnings print or forward guidance.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"For each item, note the date, headline, potential earnings impact.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Append to kensho-findings.txt immediately.","type":"text","marks":[{"type":"strong"}]}]}]}]},{"type":"paragraph","content":[{"text":"Sector context:","type":"text","marks":[{"type":"strong"}]},{"text":" 5. ","type":"text"},{"text":"search","type":"text","marks":[{"type":"code_inline"}]},{"text":" for \"[company industry/sector] sector outlook trends\"","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Record: sector-level tailwinds/headwinds, macro data, competitive dynamics.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Append to kensho-findings.txt immediately.","type":"text","marks":[{"type":"strong"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 5: Financial Data Collection","type":"text"}]},{"type":"paragraph","content":[{"text":"Quarterly financials (last 8 quarters):","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"get_financial_line_item_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" with ","type":"text"},{"text":"period_type=\"quarterly\"","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"num_periods=8","type":"text","marks":[{"type":"code_inline"}]},{"text":" for: ","type":"text"},{"text":"revenue","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"gross_profit","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"operating_income","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"ebitda","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"net_income","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"diluted_eps","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"After each line item call returns, immediately append to","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/tmp/earnings-preview/financials.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":". Write the raw values exactly as returned — do NOT round or convert yet. Include the ","type":"text"},{"text":"source","type":"text","marks":[{"type":"code_inline"}]},{"text":" column with the exact MCP function call and parameters:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"ticker,period,line_item,value,source\nD,Q4 2024,revenue,3941000000,get_financial_line_item_from_identifiers(identifier='D',line_item='revenue',period_type='quarterly')\nD,Q1 2025,revenue,3400000000,get_financial_line_item_from_identifiers(identifier='D',line_item='revenue',period_type='quarterly')\nD,Q2 2025,revenue,4076000000,get_financial_line_item_from_identifiers(identifier='D',line_item='revenue',period_type='quarterly')\nD,Q3 2025,revenue,3810000000,get_financial_line_item_from_identifiers(identifier='D',line_item='revenue',period_type='quarterly')\nD,Q4 2024,diluted_eps,1.09,get_financial_line_item_from_identifiers(identifier='D',line_item='diluted_eps',period_type='quarterly')\nD,Q1 2025,diluted_eps,-0.11,get_financial_line_item_from_identifiers(identifier='D',line_item='diluted_eps',period_type='quarterly')\n...","type":"text"}]},{"type":"paragraph","content":[{"text":"Do NOT calculate margins or growth rates yet.","type":"text","marks":[{"type":"strong"}]},{"text":" Write raw data only. Calculations happen in Phase 6.","type":"text"}]},{"type":"paragraph","content":[{"text":"Segment data:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"get_segments_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" with ","type":"text"},{"text":"segment_type=\"business\"","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"period_type=\"quarterly\"","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"num_periods=8","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"You need 8 quarters (not 4) so you have the year-ago quarter for y/y comparisons. To calculate y/y for Q3 2025, you need Q3 2024 — which is the 5th quarter back. ","type":"text"},{"text":"If the prior-year quarter's segment data is not available in the API response, do NOT estimate or fabricate it. State \"y/y not available\" in the report.","type":"text","marks":[{"type":"strong"}]}]}]}]},{"type":"paragraph","content":[{"text":"Immediately write","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/tmp/earnings-preview/segments.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":":","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"ticker,period,segment_name,revenue,source\nD,Q3 2024,Dominion Energy Virginia,2762000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')\nD,Q3 2024,Dominion Energy South Carolina,848000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')\nD,Q3 2024,Contracted Energy,260000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')\nD,Q3 2025,Dominion Energy Virginia,3311000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')\nD,Q3 2025,Dominion Energy South Carolina,945000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')\nD,Q3 2025,Contracted Energy,297000000,get_segments_from_identifiers(identifier='D',segment_type='business',period_type='quarterly')\n...","type":"text"}]},{"type":"paragraph","content":[{"text":"Earnings history (for stock chart annotations):","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"get_earnings_from_identifiers","type":"text","marks":[{"type":"code_inline"}]},{"text":" — collect past earnings dates within the 12-month price window.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Immediately write","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/tmp/earnings-preview/earnings-dates.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":":","type":"text"}]}]}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"ticker,earnings_date,call_name,source\nD,2025-05-02,Q1 2025 Earnings Call,get_earnings_from_identifiers(identifier='D')\nD,2025-08-01,Q2 2025 Earnings Call,get_earnings_from_identifiers(identifier='D')\nD,2025-10-31,Q3 2025 Earnings Call,get_earnings_from_identifiers(identifier='D')\n...","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 6: Verification & Calculations (MANDATORY — DO NOT SKIP)","type":"text"}]},{"type":"paragraph","content":[{"text":"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.","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Read all intermediate files","type":"text","marks":[{"type":"strong"}]},{"text":" using bash ","type":"text"},{"text":"cat","type":"text","marks":[{"type":"code_inline"}]},{"text":" commands:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/company-info.txt","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/transcript-extracts.txt","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/financials.csv","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/segments.csv","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/prices.csv","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/peer-eps.csv","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/peer-market-caps.csv","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/consensus-eps.csv","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/kensho-findings.txt","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/earnings-dates.csv","type":"text","marks":[{"type":"code_inline"}]}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Calculate derived metrics","type":"text","marks":[{"type":"strong"}]},{"text":" from the raw data now in context:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Gross margin % = gross_profit / revenue (per quarter)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Operating margin % = operating_income / revenue (per quarter)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Revenue y/y growth % = (current Q revenue - year-ago Q revenue) / year-ago Q revenue","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"EPS y/y growth % = same logic; use \"n.m.\" if base is negative","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Segment y/y growth % = match segment by name to year-ago Q; if missing, note \"y/y not available\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"LTM P/E per company = latest price / sum of most recent 4 quarterly EPS (check which 4 quarters are available per ticker using ","type":"text"},{"text":"peer-eps.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"NTM P/E per company = latest price / NTM EPS, where ","type":"text"},{"text":"NTM EPS = sum of the next 4 quarterly consensus mean EPS estimates","type":"text","marks":[{"type":"strong"}]},{"text":" from ","type":"text"},{"text":"consensus-eps.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":". 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.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Stock returns (YTD, 1-yr, 30d, 90d) = find the ","type":"text"},{"text":"common first date across all tickers","type":"text","marks":[{"type":"strong"}]},{"text":" in ","type":"text"},{"text":"prices.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":", then compute returns from that date","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cross-check","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Verify every segment y/y has the actual prior-year row in ","type":"text"},{"text":"segments.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":". If not, mark \"y/y not available.\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Verify all stock return base dates are identical across tickers.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Verify any multi-step calculation by re-summing components (e.g., LTM EPS sum matches the 4 quarterly values).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Verify all verbatim quotes in ","type":"text"},{"text":"transcript-extracts.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" are exact copy-pastes (not paraphrases).","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Write","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/tmp/earnings-preview/calculations.csv","type":"text","marks":[{"type":"code_inline"}]},{"text":" with all derived values:","type":"text"}]}]}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"ticker,metric,value,formula,components\nD,gross_margin_Q3_2025,32.5%,gross_profit/revenue,\"gross_profit=1238100000,revenue=3810000000\"\nD,revenue_yoy_Q3_2025,+9.3%,(Q3_2025-Q3_2024)/Q3_2024,\"Q3_2025=3810000000,Q3_2024=3486000000\"\nD,ltm_pe,24.2x,price/ltm_eps,\"price=65.46,ltm_eps=2.70,quarters=Q4_2024+Q1_2025+Q2_2025+Q3_2025\"\nD,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\"\nD,yoy_return,+17.6%,(end-start)/start,\"end=65.46,start=55.67,base_date=2025-02-19\"\nDUK,yoy_return,+13.0%,(end-start)/start,\"end=126.32,start=111.79,base_date=2025-02-19\"\n...","type":"text"}]},{"type":"paragraph","content":[{"text":"This file becomes the single source of truth for all numbers in the report.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 7: Generate the HTML Report","type":"text"}]},{"type":"paragraph","content":[{"text":"STOP — BEFORE WRITING ANY HTML, YOU MUST READ ALL INTERMEDIATE FILES. THIS IS A BLOCKING PREREQUISITE.","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"This is not optional. You MUST run each ","type":"text"},{"text":"cat","type":"text","marks":[{"type":"code_inline"}]},{"text":" command below as a ","type":"text"},{"text":"separate bash tool call","type":"text","marks":[{"type":"strong"}]},{"text":" (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.","type":"text"}]},{"type":"paragraph","content":[{"text":"Run these commands ","type":"text"},{"text":"one at a time, each as its own bash call","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/company-info.txt","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/transcript-extracts.txt","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/financials.csv","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/segments.csv","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/prices.csv","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/peer-eps.csv","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/peer-market-caps.csv","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/consensus-eps.csv","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/kensho-findings.txt","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/earnings-dates.csv","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cat /tmp/earnings-preview/calculations.csv","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"After reading ALL files, you MUST print a summary message to the user","type":"text","marks":[{"type":"strong"}]},{"text":" that lists every file and its status. Use exactly this format:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"--- DATA FILE VERIFICATION ---\n1. company-info.txt ✓ loaded ([N] lines)\n2. transcript-extracts.txt ✓ loaded ([N] lines)\n3. financials.csv ✓ loaded ([N] rows)\n4. segments.csv ✓ loaded ([N] rows)\n5. prices.csv ✓ loaded ([N] rows)\n6. peer-eps.csv ✓ loaded ([N] rows)\n7. peer-market-caps.csv ✓ loaded ([N] rows)\n8. consensus-eps.csv ✓ loaded ([N] rows)\n9. kensho-findings.txt ✓ loaded ([N] lines)\n10. earnings-dates.csv ✓ loaded ([N] rows)\n11. calculations.csv ✓ loaded ([N] rows)\n\nAll intermediate data files loaded successfully.\nGenerating report using file data as the single source of truth.\n---","type":"text"}]},{"type":"paragraph","content":[{"text":"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.","type":"text"}]},{"type":"paragraph","content":[{"text":"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.","type":"text","marks":[{"type":"strong"}]},{"text":" 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.","type":"text"}]},{"type":"paragraph","content":[{"text":"See ","type":"text"},{"text":"report-template.md","type":"text","marks":[{"type":"link","attrs":{"href":"report-template.md","title":null}}]},{"text":" for the complete HTML template, CSS, and Chart.js configuration.","type":"text"}]},{"type":"paragraph","content":[{"text":"MANDATORY — Use Template Helper Functions for Charts:","type":"text","marks":[{"type":"strong"}]},{"text":" 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:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"createRevEpsChart(canvasId, labels, revenueData, epsData, revLabel)","type":"text","marks":[{"type":"code_inline"}]},{"text":" — for Figure 1","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"createMarginChart(canvasId, labels, grossMargins, opMargins)","type":"text","marks":[{"type":"code_inline"}]},{"text":" — for Figure 2","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"createRevGrowthChart(canvasId, labels, growthData)","type":"text","marks":[{"type":"code_inline"}]},{"text":" — for Figure 3","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"createAnnotatedPriceChart(canvasId, labels, prices, earningsDates, ticker)","type":"text","marks":[{"type":"code_inline"}]},{"text":" — for Figure 5","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"createCompPerfChart(canvasId, labels, datasets)","type":"text","marks":[{"type":"code_inline"}]},{"text":" — for Figure 6","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"createPEChart(canvasId, companies)","type":"text","marks":[{"type":"code_inline"}]},{"text":" — for Figure 7","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Each chart call MUST be in its own ","type":"text"},{"text":"\u003cscript>","type":"text","marks":[{"type":"code_inline"}]},{"text":" tag wrapped in a try-catch block. This ensures a bug in one chart does not prevent other charts from rendering. Example:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"html"},"content":[{"text":"\u003cscript>\ntry {\n createRevEpsChart('chart-rev-eps', [...], [...], [...], 'Revenue ($B)');\n} catch(e) { console.error('Figure 1 error:', e); }\n\u003c/script>\n\u003cscript>\ntry {\n createMarginChart('chart-margins', [...], [...], [...]);\n} catch(e) { console.error('Figure 2 error:', e); }\n\u003c/script>","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Report Structure (4-5 pages total)","type":"text"}]},{"type":"paragraph","content":[{"text":"The report has two halves: ","type":"text"},{"text":"narrative","type":"text","marks":[{"type":"strong"}]},{"text":" (pages 1-2) and ","type":"text"},{"text":"figures","type":"text","marks":[{"type":"strong"}]},{"text":" (pages 3-5). Keep these tightly integrated.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"paragraph","content":[{"text":"AI DISCLAIMER (MANDATORY — must appear in 3 places):","type":"text","marks":[{"type":"strong"}]},{"text":" You MUST include the following disclaimer text in the report HTML. This is not optional — the report is incomplete without it:","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"\"Analysis is AI-generated — please confirm all outputs\"","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"paragraph","content":[{"text":"It must appear in exactly these 3 locations:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Header banner","type":"text","marks":[{"type":"strong"}]},{"text":" — immediately before the cover header, as a centered yellow banner: ","type":"text"},{"text":"\u003cdiv class=\"ai-disclaimer\">Analysis is AI-generated — please confirm all outputs\u003c/div>","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Footer","type":"text","marks":[{"type":"strong"}]},{"text":" — inside the page-footer div, as a prominent yellow banner: ","type":"text"},{"text":"\u003cdiv class=\"footer-disclaimer\">Analysis is AI-generated — please confirm all outputs\u003c/div>","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Appendix","type":"text","marks":[{"type":"strong"}]},{"text":" — as the first line of the appendix section, before the table: ","type":"text"},{"text":"\u003cdiv class=\"ai-disclaimer\">Analysis is AI-generated — please confirm all outputs\u003c/div>","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"paragraph","content":[{"text":"PAGE 1: Cover & Thesis","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"AI disclaimer banner","type":"text","marks":[{"type":"strong"}]},{"text":" (yellow, centered — see AI DISCLAIMER rule above)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Header","type":"text","marks":[{"type":"strong"}]},{"text":": Company name (TICKER) | Industry | Report date","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Title","type":"text","marks":[{"type":"strong"}]},{"text":": Thematic, specific to the quarter (e.g., \"Walmart Inc. (WMT) Q4 FY2026 Earnings Preview: Holiday Harvest — Can Furner's First Print Confirm the $1T Thesis?\")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Executive thesis","type":"text","marks":[{"type":"strong"}]},{"text":" (2-3 short paragraphs max with bullet points):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"What we expect from this print in 1-2 sentences","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"4-6 bullet points covering: our EPS estimate vs consensus, guidance expectations, key metrics to watch, what would move the stock, key debates","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Keep it direct and opinionated — take a view, don't hedge everything","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Key management quotes","type":"text","marks":[{"type":"strong"}]},{"text":" from the most recent earnings call woven into the narrative where relevant. Do NOT put these under a separate heading. Integrate them naturally as supporting evidence for your thesis points. Format as indented blockquotes.","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"paragraph","content":[{"text":"PAGE 2: Estimates, Themes & News","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Consensus Estimates Table","type":"text","marks":[{"type":"strong"}]},{"text":" (single table, labeled as a figure):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Columns: Metric | Consensus | Our Estimate | y/y Change","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Rows: Revenue, EPS, Gross Margin, Operating Income, and 2-3 company-specific KPIs that matter (e.g., comp sales, eComm growth, membership revenue — whatever the Street cares about for THIS company)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Color-coding is strictly mechanical:","type":"text","marks":[{"type":"strong"}]},{"text":" If the y/y change value is negative, use ","type":"text"},{"text":"class=\"neg\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" (red). If positive, use ","type":"text"},{"text":"class=\"pos\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" (green). If zero or N/A, use ","type":"text"},{"text":"class=\"neutral\"","type":"text","marks":[{"type":"code_inline"}]},{"text":". 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.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"This is the ONLY guidance/estimates section. Do not repeat estimate data elsewhere.","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Key Metrics Beyond Headline EPS","type":"text","marks":[{"type":"strong"}]},{"text":" (bulleted list, 3-5 items):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The specific metrics that will determine if this is a good or bad quarter beyond the EPS number","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"For each: what the metric is, what consensus/management expects, why it matters","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Be specific: \"Walmart Connect ad revenue growth (consensus ~30% y/y, 3Q was 33%)\"","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Themes to Watch","type":"text","marks":[{"type":"strong"}]},{"text":" (3-5 bullets):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Forward-looking items for the upcoming report","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"What management needs to deliver on, what could surprise, what the bears are focused on","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Each theme: 1-2 sentences max","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Recent News & Developments","type":"text","marks":[{"type":"strong"}]},{"text":" (3-5 bullets):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Material news from the last 60 days, one line each","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Date + headline + brief impact assessment","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Only include items that could affect the upcoming print or guidance","type":"text"}]}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"paragraph","content":[{"text":"PAGES 3-5: Figures (all charts and tables)","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"All figures are numbered sequentially. Every figure has a title and source line.","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Figure 1: Quarterly Revenue & Diluted EPS","type":"text","marks":[{"type":"strong"}]},{"text":" — Bar/line combo, 8 quarters","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Figure 2: Margin Trends (Gross & Operating %)","type":"text","marks":[{"type":"strong"}]},{"text":" — Dual line chart, 8 quarters","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Figure 3: Revenue Growth y/y %","type":"text","marks":[{"type":"strong"}]},{"text":" — Bar chart with green/red conditional coloring. ","type":"text"},{"text":"Only include quarters where both current and year-ago data exist","type":"text","marks":[{"type":"strong"}]},{"text":" (typically the most recent 4 quarters from the 8 fetched). Do NOT include quarters where y/y cannot be computed — the chart should have 4 bars, not 8.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Figure 4: Business Segment Revenue","type":"text","marks":[{"type":"strong"}]},{"text":" — Table: Segment | Latest Q Rev ($M) | % of Total | y/y Change","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Figure 5: 1-Year Stock Price with Earnings Dates","type":"text","marks":[{"type":"strong"}]},{"text":" — Price line with vertical annotation lines at earnings dates, labeled with quarter and 1-day post-earnings move","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Figure 6: Stock Performance vs. Competitors (Indexed to 100)","type":"text","marks":[{"type":"strong"}]},{"text":" — Multi-line chart, subject company as thick solid line, competitors as thinner dashed lines","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Figure 7: LTM P/E vs. Competitors","type":"text","marks":[{"type":"strong"}]},{"text":" — Horizontal bar chart, subject company highlighted in navy","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Figure 8: Competitor Comparison Table","type":"text","marks":[{"type":"strong"}]},{"text":" — Ticker | Company | Mkt Cap | LTM P/E | NTM P/E | YTD % | 1-Yr %","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"paragraph","content":[{"text":"APPENDIX: Data Sources & Calculations (MANDATORY — DO NOT SKIP OR ABBREVIATE)","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"The appendix MUST begin with the AI disclaimer banner: ","type":"text"},{"text":"\u003cdiv class=\"ai-disclaimer\">Analysis is AI-generated — please confirm all outputs\u003c/div>","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"The final page(s) of the report MUST include an Appendix table that documents ","type":"text"},{"text":"every claim","type":"text","marks":[{"type":"strong"}]},{"text":" — numeric and non-numeric — cited in the report. ","type":"text"},{"text":"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 ","type":"text","marks":[{"type":"strong"}]},{"text":"\u003ca href=\"#ref-N\">","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" hyperlink that scrolls to its appendix row.","type":"text","marks":[{"type":"strong"}]},{"text":" If a number appears in the report without a hyperlink to the appendix, the report is incomplete.","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Table columns","type":"text","marks":[{"type":"strong"}]},{"text":": Ref # | Fact | Value | Source & Derivation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Ref #","type":"text","marks":[{"type":"strong"}]},{"text":": Sequential ID matching the hyperlink anchors in the report body (","type":"text"},{"text":"ref-1","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"ref-2","type":"text","marks":[{"type":"code_inline"}]},{"text":", etc.). Each row has an ","type":"text"},{"text":"id=\"ref-N\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" attribute so hyperlinks scroll to it.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Fact","type":"text","marks":[{"type":"strong"}]},{"text":": Human-readable label (e.g., \"Q3 FY2026 Revenue\", \"LTM P/E — WMT\", \"Management flagged tariff headwinds\", \"Barclays upgraded to Overweight\")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Value","type":"text","marks":[{"type":"strong"}]},{"text":": 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\".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Source & Derivation","type":"text","marks":[{"type":"strong"}]},{"text":": This is the critical column. ","type":"text"},{"text":"Every row must have a specific, detailed source — not just a label.","type":"text","marks":[{"type":"strong"}]},{"text":" Follow these rules strictly:","type":"text"}]},{"type":"paragraph","content":[{"text":"For raw financial data from S&P Capital IQ (revenue, EPS, gross profit, operating income, net income, EBITDA, prices, market cap, etc.):","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"State the MCP function used and its key parameters. Format: ","type":"text"},{"text":"S&P Capital IQ — [function_name](identifier='[TICKER]', line_item='[item]', period_type='[type]', period='[Q# FY####]')","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Examples:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"S&P Capital IQ — get_financial_line_item_from_identifiers(identifier='WMT', line_item='revenue', period_type='quarterly', period='Q3 FY2026')","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"S&P Capital IQ — get_financial_line_item_from_identifiers(identifier='WMT', line_item='diluted_eps', period_type='quarterly', period='Q3 FY2026')","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"S&P Capital IQ — get_prices_from_identifiers(identifier='WMT', periodicity='day')","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"S&P Capital IQ — get_capitalization_from_identifiers(identifier='WMT', capitalization='market_cap')","type":"text","marks":[{"type":"code_inline"}]}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do NOT just write \"S&P Capital IQ\" with no detail.","type":"text","marks":[{"type":"strong"}]},{"text":" The reader must know exactly which data point from which tool call produced this number.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"For calculated values (margins, growth rates, P/E, returns, y/y changes):","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Show the full formula with ","type":"text"},{"text":"hyperlinked components","type":"text","marks":[{"type":"strong"}]},{"text":" — each component must be an ","type":"text"},{"text":"\u003ca href=\"#ref-N\">","type":"text","marks":[{"type":"code_inline"}]},{"text":" 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.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Example: ","type":"text"},{"text":"Gross Margin = \u003ca href='#ref-5'>Gross Profit $37.2B\u003c/a> / \u003ca href='#ref-1'>Revenue $152.3B\u003c/a> = 24.4%. Source: S&P Capital IQ (calculated)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Example: ","type":"text"},{"text":"LTM P/E = \u003ca href='#ref-20'>Price $172.35\u003c/a> / (\u003ca href='#ref-8'>Q1 EPS $1.47\u003c/a> + \u003ca href='#ref-9'>Q2 EPS $1.84\u003c/a> + \u003ca href='#ref-10'>Q3 EPS $1.53\u003c/a> + \u003ca href='#ref-11'>Q4 EPS $1.80\u003c/a>) = $172.35 / $6.64 = 25.9x","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Example: ","type":"text"},{"text":"Revenue y/y growth = (\u003ca href='#ref-12'>Q3 FY26 Rev $165.8B\u003c/a> - \u003ca href='#ref-3'>Q3 FY25 Rev $160.8B\u003c/a>) / \u003ca href='#ref-3'>Q3 FY25 Rev $160.8B\u003c/a> = +3.1%","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Every formula component must be a clickable hyperlink.","type":"text","marks":[{"type":"strong"}]},{"text":" Do NOT write formulas with plain-text numbers.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"For transcript-sourced claims (quotes, management commentary, guidance):","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Write the ","type":"text"},{"text":"verbatim excerpt sentence","type":"text","marks":[{"type":"strong"}]},{"text":" from the transcript.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Reference the transcript by its full name and the ","type":"text"},{"text":"key_dev_id","type":"text","marks":[{"type":"code_inline"}]},{"text":" used to fetch it.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Format: ","type":"text"},{"text":"\"[verbatim quote]\" — [Speaker], [Title]. Source: [Q# FY#### Earnings Call Transcript] (key_dev_id: [ID])","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Example: ","type":"text"},{"text":"\"We expect comp sales growth of 3-4% in Q4\" — CEO John Furner. Source: Q3 FY2026 Earnings Call Transcript (key_dev_id: 12345678)","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"For Kensho Grounding search results (news, analyst ratings, consensus estimates):","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Write the key finding or excerpt from the search result.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"MANDATORY: Include the source URL","type":"text","marks":[{"type":"strong"}]},{"text":" returned by the Kensho ","type":"text"},{"text":"search","type":"text","marks":[{"type":"code_inline"}]},{"text":" tool as a clickable ","type":"text"},{"text":"\u003ca href=\"[URL]\" target=\"_blank\">","type":"text","marks":[{"type":"code_inline"}]},{"text":" hyperlink. This is the most important part — readers must be able to click through to the original source.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Format: ","type":"text"},{"text":"\"[finding/excerpt]\" — \u003ca href=\"[URL]\" target=\"_blank\">[Source Title or Publication]\u003c/a>. Query: search(\"[query used]\")","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Example: ","type":"text"},{"text":"\"Barclays upgraded WMT to Overweight with $210 price target on Jan 15, 2026.\" — \u003ca href=\"https://www.investing.com/news/barclays-upgrades-wmt\" target=\"_blank\">Investing.com, Jan 15 2026\u003c/a>. Query: search(\"WMT analyst ratings price target upgrades downgrades\")","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If no URL was returned for a particular result, write \"Source URL not available\" and still include the search query.","type":"text"}]}]}]}]}]},{"type":"paragraph","content":[{"text":"Completeness check:","type":"text","marks":[{"type":"strong"}]},{"text":" Before finalizing the report, scan every number in the report body. If any number is not wrapped in ","type":"text"},{"text":"\u003ca href=\"#ref-N\" class=\"data-ref\">","type":"text","marks":[{"type":"code_inline"}]},{"text":", 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.","type":"text"}]},{"type":"paragraph","content":[{"text":"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).","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 8: Output","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Write the complete HTML file to ","type":"text"},{"text":"earnings-preview-[TICKER]-YYYY-MM-DD.html","type":"text","marks":[{"type":"code_inline"}]},{"text":" in the current working directory.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Open it in the browser: ","type":"text"},{"text":"open earnings-preview-[TICKER]-YYYY-MM-DD.html","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Tell the user the file has been created and summarize the key findings.","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Writing Guidelines","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"NO EMOJIS","type":"text","marks":[{"type":"strong"}]},{"text":": Do not use any emojis anywhere in the report. This is a professional research document.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"CONCISE","type":"text","marks":[{"type":"strong"}]},{"text":": Target 4-5 printed pages. Every sentence must carry weight. Use bullets, not paragraphs, wherever possible. If a section feels long, cut it.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Be specific with numbers","type":"text","marks":[{"type":"strong"}]},{"text":": \"$52.4B revenue, up 5.2% y/y\" not \"strong revenue growth.\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Take a view","type":"text","marks":[{"type":"strong"}]},{"text":": This is an earnings preview, not a summary. State what you expect, what matters, and why. Be opinionated but back it with data.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Management quotes without headers","type":"text","marks":[{"type":"strong"}]},{"text":": Weave 3-4 key management quotes from the most recent call directly into the narrative as blockquotes. Do not create a \"Key Management Quotes\" section heading — let them flow naturally as supporting evidence.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Professional tone","type":"text","marks":[{"type":"strong"}]},{"text":": Sell-side equity research style — analytical, direct, data-driven.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Charts must use real data","type":"text","marks":[{"type":"strong"}]},{"text":": Every chart populated with actual MCP data. Never fabricate.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Competitor context","type":"text","marks":[{"type":"strong"}]},{"text":": Frame valuation relative to peers. A 25x P/E means nothing without knowing peers trade at 20x or 35x.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Hyperlinked claims","type":"text","marks":[{"type":"strong"}]},{"text":": Every factual claim — numeric or qualitative — must be an ","type":"text"},{"text":"\u003ca class=\"data-ref\">","type":"text","marks":[{"type":"code_inline"}]},{"text":" tag linking to its appendix entry. Numbers: ","type":"text"},{"text":"\u003ca href=\"#ref-1\" class=\"data-ref\">$152.3B\u003c/a>","type":"text","marks":[{"type":"code_inline"}]},{"text":". Qualitative: ","type":"text"},{"text":"\u003ca href=\"#ref-25\" class=\"data-ref\">management flagged tariff headwinds as the primary margin risk\u003c/a>","type":"text","marks":[{"type":"code_inline"}]},{"text":". No fact should appear without a traceable source in the appendix.","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"earnings-preview-single","author":"@skillopedia","source":{"stars":29255,"repo_name":"financial-services","origin_url":"https://github.com/anthropics/financial-services/blob/HEAD/plugins/partner-built/spglobal/skills/earnings-preview-beta/SKILL.md","repo_owner":"anthropics","body_sha256":"2a429398d9fa965ff6eefb8a4e4752db04c2406cde5186a065b549c9505275af","cluster_key":"f6dc6e752cf4a130b8677158d78466729ee0b82f5853947c02c630f35c8a436e","clean_bundle":{"format":"clean-skill-bundle-v1","source":"anthropics/financial-services/plugins/partner-built/spglobal/skills/earnings-preview-beta/SKILL.md","attachments":[{"id":"4efa6925-ffa7-5972-b8f3-d57b2ce3977d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4efa6925-ffa7-5972-b8f3-d57b2ce3977d/attachment.md","path":"report-template.md","size":45686,"sha256":"8e2000571c615a4b6b66c85d487007ee2bf2e7fd3463103070eb6b174e6a64be","contentType":"text/markdown; charset=utf-8"}],"bundle_sha256":"de12a942e7b9a0cd5ded519bf2156bff051b5f7d01b3754a2e7ec54b7dfd6e72","attachment_count":1,"text_attachments":1,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":2,"skill_md_path":"plugins/partner-built/spglobal/skills/earnings-preview-beta/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"web-development","category_label":"Web"},"exact_dupes_collapsed_into_this":1},"version":"v1","category":"web-development","import_tag":"clean-skills-v1","description":"Generate a concise 4-5 page equity research earnings preview for a single company. Analyzes the most recent earnings transcript, competitor landscape, valuation, and recent news to produce a professional HTML report."}},"renderedAt":1782981130562}

Single-Company Earnings Preview 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 ( ) and S&P Global MCP ( ). Absolutely NO other tools, data sources, or web access of any kind. Specifically: - Do NOT use , , , , , or ANY generic web/internet search tool — even if Kensho is slow, returns no results, or i…