
Earnings Preview Single
- 953 installs
- 33.8k repo stars
- Updated July 22, 2026
- anthropics/financial-services-plugins
earnings-preview-single generates a 4-5 page equity earnings preview for one company.
About
The earnings-preview-single skill generates a concise four-to-five page equity research earnings preview for one company analyzing recent earnings transcripts, competitor landscape, valuation, and news into a self-contained HTML report. Output targets printed page density with figures and sourced data rather than vague narrative. Agents synthesize qualitative and quantitative signals ahead of the upcoming print. The skill suits research analysts producing single-name preview notes before quarterly results. Single-company 4-5 page earnings preview HTML report. Uses recent transcript, comps, valuation, and news inputs. Dense figures and data-driven preview narrative. Self-contained HTML suitable for print or PDF. Pre-earnings single-name equity research workflow. Generate 4-5 page single-company equity earnings preview HTML from transcripts and news.
- Single-company 4-5 page earnings preview HTML report.
- Uses recent transcript, comps, valuation, and news inputs.
- Dense figures and data-driven preview narrative.
- Self-contained HTML suitable for print or PDF.
- Pre-earnings single-name equity research workflow.
Earnings Preview Single by the numbers
- 953 all-time installs (skills.sh)
- +23 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Ranked #148 of 1,136 Finance & Trading skills by installs in the Skillselion catalog
- Security screen: MEDIUM risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
What earnings-preview-single says it does
Generate a concise 4-5 page equity research earnings preview for a single company.
npx skills add https://github.com/anthropics/financial-services-plugins --skill earnings-preview-singleAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 953 |
|---|---|
| repo stars | ★ 33.8k |
| Security audit | 1 / 3 scanners passed |
| Last updated | July 22, 2026 |
| Repository | anthropics/financial-services-plugins ↗ |
What should investors watch in this company's upcoming earnings?
Generate 4-5 page single-company equity earnings preview HTML from transcripts and news.
Who is it for?
Equity analysts writing single-name pre-earnings preview notes.
Skip if: Skip for post-earnings recap after results are published.
When should I use this skill?
User requests single-company earnings preview or pre-print equity note.
What you get
HTML earnings preview with transcript, valuation, and competitor context.
- 4–5 page HTML earnings preview
- /tmp/earnings-preview/ data files
- Consensus and transcript analysis sections
By the numbers
- Mandatory 7-phase workflow ending in HTML report generation
- Targets 4–5 printed pages in the final self-contained HTML output
- Stores intermediate MCP data under /tmp/earnings-preview/
Files
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 (search) and S&P Global MCP (kfinance). Absolutely NO other tools, data sources, or web access of any kind. Specifically:
- Do NOT use
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. - Do NOT use any browser, URL fetch, or web scraping tool.
- If Kensho Grounding returns no results for a query, try rephrasing the query or note "data not available" in the report. NEVER fall back to web search as an alternative.
- Every piece of information in the report must be traceable to either a
kfinanceMCP function call or a Kenshosearchcall. 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 using `cat` 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.
---
Phase 1: Company Profile & Setup
1. Parse the single company ticker from $ARGUMENTS (strip whitespace). 2. Run mkdir -p /tmp/earnings-preview to create the working directory. 3. Call get_latest() to establish current reporting period context. 4. Call get_info_from_identifiers — record market cap, industry. 5. Call get_company_summary_from_identifiers — record business description. 6. Call 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]---
Phase 2: Earnings Transcript Analysis (MANDATORY — COMPLETE BEFORE WRITING)
1. Call get_latest_earnings_from_identifiers to get the most recent completed earnings call key_dev_id. 2. Call get_transcript_from_key_dev_id for that transcript. 3. Immediately write /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]---
Phase 3: Competitor Analysis
1. Call get_competitors_from_identifiers with competitor_source="all". 2. Select top 5-7 most relevant public competitors. 3. For the company AND all selected competitors, gather:
get_prices_from_identifierswithperiodicity="day", last 12 monthsget_financial_line_item_from_identifiersfordiluted_eps,period_type="quarterly",num_periods=8get_capitalization_from_identifierswithcapitalization="market_cap"(latest)get_consensus_estimates_from_identifierswithperiod_type="quarterly",num_periods_forward=4— this returns consensus mean EPS estimates for the next 4 quarters, which are summed to compute NTM EPS
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.
---
Phase 4: News, Estimates & Sector Intelligence (via Kensho Grounding)
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: 1. search for "[TICKER] earnings estimates consensus EPS revenue upcoming quarter"
- Record: consensus EPS, consensus revenue, estimate revision direction over last 90 days.
- Append to kensho-findings.txt immediately.
2. search for "[TICKER] analyst ratings price target upgrades downgrades"
- Record: recent upgrades/downgrades, price target range, bull/bear thesis summaries.
- Append to kensho-findings.txt immediately.
3. search for "[TICKER] risks bear case concerns investors"
- Record: key debates, bear arguments, swing factors for the upcoming print.
- Append to kensho-findings.txt immediately.
Recent news (MANDATORY — do not skip): 4. search for "[TICKER] [company name] recent news developments"
- 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.
- For each item, note the date, headline, potential earnings impact.
- Append to kensho-findings.txt immediately.
Sector context: 5. search for "[company industry/sector] sector outlook trends"
- Record: sector-level tailwinds/headwinds, macro data, competitive dynamics.
- Append to kensho-findings.txt immediately.
---
Phase 5: Financial Data Collection
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_identifierswithsegment_type="business",period_type="quarterly",num_periods=8- 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. 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.
Immediately 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')
...---
Phase 6: Verification & Calculations (MANDATORY — DO NOT SKIP)
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.
1. 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.csvcat /tmp/earnings-preview/consensus-eps.csvcat /tmp/earnings-preview/kensho-findings.txtcat /tmp/earnings-preview/earnings-dates.csv
2. Calculate derived metrics from the raw data now in context:
- Gross margin % = gross_profit / revenue (per quarter)
- Operating margin % = operating_income / revenue (per quarter)
- Revenue y/y growth % = (current Q revenue - year-ago Q revenue) / year-ago Q revenue
- EPS y/y growth % = same logic; use "n.m." if base is negative
- Segment y/y growth % = match segment by name to year-ago Q; if missing, note "y/y not available"
- LTM P/E per company = latest price / sum of most recent 4 quarterly EPS (check which 4 quarters are available per ticker using
peer-eps.csv) - NTM P/E per company = latest price / NTM EPS, where NTM EPS = sum of the next 4 quarterly consensus mean EPS estimates from
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. - Stock returns (YTD, 1-yr, 30d, 90d) = find the common first date across all tickers in
prices.csv, then compute returns from that date
3. Cross-check:
- Verify every segment y/y has the actual prior-year row in
segments.csv. If not, mark "y/y not available." - Verify all stock return base dates are identical across tickers.
- Verify any multi-step calculation by re-summing components (e.g., LTM EPS sum matches the 4 quarterly values).
- Verify all verbatim quotes in
transcript-extracts.txtare exact copy-pastes (not paraphrases).
4. Write /tmp/earnings-preview/calculations.csv with all derived values:
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"
...This file becomes the single source of truth for all numbers in the report.
---
Phase 7: Generate the HTML 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:
1. cat /tmp/earnings-preview/company-info.txt 2. cat /tmp/earnings-preview/transcript-extracts.txt 3. cat /tmp/earnings-preview/financials.csv 4. cat /tmp/earnings-preview/segments.csv 5. cat /tmp/earnings-preview/prices.csv 6. cat /tmp/earnings-preview/peer-eps.csv 7. cat /tmp/earnings-preview/peer-market-caps.csv 8. cat /tmp/earnings-preview/consensus-eps.csv 9. cat /tmp/earnings-preview/kensho-findings.txt 10. cat /tmp/earnings-preview/earnings-dates.csv 11. cat /tmp/earnings-preview/calculations.csv
After 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 7
Each 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>Report Structure (4-5 pages total)
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: 1. Header banner — immediately before the cover header, as a centered yellow banner: <div class="ai-disclaimer">Analysis is AI-generated — please confirm all outputs</div> 2. Footer — inside the page-footer div, as a prominent yellow banner: <div class="footer-disclaimer">Analysis is AI-generated — please confirm all outputs</div> 3. Appendix — as the first line of the appendix section, before the table: <div class="ai-disclaimer">Analysis is AI-generated — please confirm all outputs</div>
---
PAGE 1: Cover & Thesis
- AI disclaimer banner (yellow, centered — see AI DISCLAIMER rule above)
- Header: Company name (TICKER) | Industry | Report date
- Title: 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?")
- Executive thesis (2-3 short paragraphs max with bullet points):
- What we expect from this print in 1-2 sentences
- 4-6 bullet points covering: our EPS estimate vs consensus, guidance expectations, key metrics to watch, what would move the stock, key debates
- Keep it direct and opinionated — take a view, don't hedge everything
- Key management quotes 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.
---
PAGE 2: Estimates, Themes & News
- Consensus Estimates Table (single table, labeled as a figure):
- Columns: Metric | Consensus | Our Estimate | y/y Change
- 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)
- Color-coding is strictly mechanical: If the y/y change value is negative, use
class="neg"(red). If positive, useclass="pos"(green). If zero or N/A, useclass="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. - This is the ONLY guidance/estimates section. Do not repeat estimate data elsewhere.
- Key Metrics Beyond Headline EPS (bulleted list, 3-5 items):
- The specific metrics that will determine if this is a good or bad quarter beyond the EPS number
- For each: what the metric is, what consensus/management expects, why it matters
- Be specific: "Walmart Connect ad revenue growth (consensus ~30% y/y, 3Q was 33%)"
- Themes to Watch (3-5 bullets):
- Forward-looking items for the upcoming report
- What management needs to deliver on, what could surprise, what the bears are focused on
- Each theme: 1-2 sentences max
- Recent News & Developments (3-5 bullets):
- Material news from the last 60 days, one line each
- Date + headline + brief impact assessment
- Only include items that could affect the upcoming print or guidance
---
PAGES 3-5: Figures (all charts and tables)
All figures are numbered sequentially. Every figure has a title and source line.
- Figure 1: Quarterly Revenue & Diluted EPS — Bar/line combo, 8 quarters
- Figure 2: Margin Trends (Gross & Operating %) — Dual line chart, 8 quarters
- Figure 3: Revenue Growth y/y % — Bar chart with green/red conditional coloring. Only include quarters where both current and year-ago data exist (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.
- Figure 4: Business Segment Revenue — Table: Segment | Latest Q Rev ($M) | % of Total | y/y Change
- Figure 5: 1-Year Stock Price with Earnings Dates — Price line with vertical annotation lines at earnings dates, labeled with quarter and 1-day post-earnings move
- Figure 6: Stock Performance vs. Competitors (Indexed to 100) — Multi-line chart, subject company as thick solid line, competitors as thinner dashed lines
- Figure 7: LTM P/E vs. Competitors — Horizontal bar chart, subject company highlighted in navy
- Figure 8: Competitor Comparison Table — Ticker | Company | Mkt Cap | LTM P/E | NTM P/E | YTD % | 1-Yr %
---
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 anid="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_idused 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
searchtool 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).
---
Phase 8: Output
1. Write the complete HTML file to earnings-preview-[TICKER]-YYYY-MM-DD.html in the current working directory. 2. Open it in the browser: open earnings-preview-[TICKER]-YYYY-MM-DD.html 3. Tell the user the file has been created and summarize the key findings.
---
Writing Guidelines
- NO EMOJIS: Do not use any emojis anywhere in the report. This is a professional research document.
- CONCISE: Target 4-5 printed pages. Every sentence must carry weight. Use bullets, not paragraphs, wherever possible. If a section feels long, cut it.
- Be specific with numbers: "$52.4B revenue, up 5.2% y/y" not "strong revenue growth."
- Take a view: This is an earnings preview, not a summary. State what you expect, what matters, and why. Be opinionated but back it with data.
- Management quotes without headers: 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.
- Professional tone: Sell-side equity research style — analytical, direct, data-driven.
- Charts must use real data: Every chart populated with actual MCP data. Never fabricate.
- Competitor context: Frame valuation relative to peers. A 25x P/E means nothing without knowing peers trade at 20x or 35x.
- Hyperlinked claims: Every factual claim — numeric or qualitative — must be an
<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.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2026-present Kensho Technologies, LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.HTML Report Template Reference
Use this template as the foundation for the single-company earnings preview HTML report. Customize the data, charts, and narrative content based on the research gathered in Phases 1-5.
HTML Structure
The report is a single self-contained HTML file with:
- Embedded CSS (no external stylesheets)
- Chart.js loaded from CDN for interactive charts
- Print-friendly styles via
@media print - Responsive layout that works on screens and in print
- Target: 4-5 printed pages
Complete Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Earnings Preview — [COMPANY] ([TICKER]) — [DATE]</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.7/dist/chart.umd.min.js" integrity="sha384-vsrfeLOOY6KuIYKDlmVH5UiBmgIdB1oEf7p01YgWHuqmOHfZr374+odEv96n9tNC" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-annotation@3.1.0/dist/chartjs-plugin-annotation.min.js" integrity="sha384-3N9GHhCtN3CQef6tNfqgZlv7sQLYIkcChN+uaTZ7xVdzKYp/SjBNPxa92+hM7EAY" crossorigin="anonymous"></script>
<style>
/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
font-family: 'Arial Narrow', Arial, sans-serif;
color: #1a1a2e;
background: #fff;
line-height: 1.6;
}
/* ── Layout ── */
.page {
max-width: 1100px;
margin: 0 auto;
padding: 40px 48px;
}
.page-break {
page-break-before: always;
border-top: 2px solid #1a1a4e;
margin-top: 48px;
padding-top: 32px;
}
/* ── Header / Cover ── */
.cover-header {
border-bottom: 3px solid #1a1a4e;
padding-bottom: 16px;
margin-bottom: 24px;
display: flex;
justify-content: space-between;
align-items: flex-end;
}
.cover-header .brand {
font-size: 24px;
font-weight: bold;
color: #1a1a4e;
letter-spacing: 2px;
text-transform: uppercase;
}
.cover-header .sector {
font-size: 13px;
color: #555;
}
.cover-header .date {
font-size: 14px;
color: #333;
text-align: right;
}
.report-title {
font-size: 26px;
font-weight: bold;
color: #1a1a2e;
margin: 20px 0 16px 0;
line-height: 1.3;
}
/* ── Executive Thesis ── */
.executive-summary {
font-size: 14px;
line-height: 1.65;
color: #222;
margin-bottom: 16px;
}
.executive-summary p {
margin-bottom: 10px;
text-align: justify;
}
.executive-summary ul {
margin: 8px 0 10px 20px;
font-size: 13.5px;
}
.executive-summary ul li {
margin-bottom: 5px;
line-height: 1.5;
}
blockquote {
border-left: 3px solid #b0b8c8;
padding: 6px 14px;
margin: 8px 0 8px 12px;
font-style: italic;
color: #444;
background: #f9fafb;
font-size: 12.5px;
line-height: 1.5;
}
/* ── Section Headings ── */
h2.section-title {
font-size: 18px;
font-weight: 700;
color: #1a1a4e;
border-bottom: 2px solid #1a1a4e;
padding-bottom: 5px;
margin: 28px 0 14px 0;
}
h3.subsection-title {
font-size: 14px;
font-weight: 600;
color: #1a1a4e;
margin: 16px 0 8px 0;
}
h4.figure-title {
font-size: 12px;
font-weight: 600;
color: #444;
margin: 14px 0 6px 0;
}
/* ── Tables ── */
table {
width: 100%;
border-collapse: collapse;
font-size: 12px;
margin: 10px 0 16px 0;
}
thead th {
background: #1a1a4e;
color: #fff;
padding: 7px 10px;
text-align: left;
font-weight: 600;
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
tbody td {
padding: 6px 10px;
border-bottom: 1px solid #e0e0e0;
}
tbody tr:nth-child(even) {
background: #f9fafb;
}
tbody tr:hover {
background: #eef0f5;
}
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: #0d7a3e; font-weight: 600; }
.neg { color: #c0392b; font-weight: 600; }
.neutral { color: #555; }
.highlight-row { background: #e8eaf6 !important; font-weight: 600; }
/* ── Chart Containers ── */
.chart-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
margin: 12px 0 20px 0;
}
.chart-container {
position: relative;
background: #fafbfc;
border: 1px solid #e8e8e8;
border-radius: 4px;
padding: 14px;
}
.chart-container canvas {
max-height: 260px;
}
.chart-full {
grid-column: 1 / -1;
}
/* ── Compact Lists ── */
.key-metrics ul, .themes ul, .news-list ul {
margin: 6px 0 6px 18px;
font-size: 13px;
line-height: 1.55;
}
.key-metrics li, .themes li, .news-list li {
margin-bottom: 5px;
}
/* ── Data Reference Links ── */
a.data-ref {
color: #1a1a4e;
text-decoration: none;
border-bottom: 1px dotted transparent;
transition: border-color 0.15s;
}
a.data-ref:hover {
border-bottom-color: #1a1a4e;
}
/* ── Appendix ── */
.appendix table {
font-size: 10.5px;
}
.appendix thead th {
font-size: 10px;
padding: 5px 8px;
}
.appendix tbody td {
padding: 4px 8px;
font-size: 10.5px;
vertical-align: top;
line-height: 1.45;
}
.appendix .ref-id {
font-weight: 600;
color: #1a1a4e;
white-space: nowrap;
}
.appendix .source-detail {
font-size: 10px;
color: #444;
}
.appendix .source-detail .formula {
font-family: 'Courier New', monospace;
font-size: 9.5px;
color: #555;
}
.appendix .source-detail .excerpt {
font-style: italic;
color: #555;
}
.appendix .source-detail .src-label {
font-weight: 600;
color: #1a1a4e;
font-size: 9.5px;
}
.appendix .source-detail a.data-ref {
font-weight: 600;
}
.appendix a.src-url {
color: #3366cc;
text-decoration: underline;
font-size: 10px;
word-break: break-all;
}
.appendix a.src-url:hover {
color: #1a1a4e;
}
.appendix .transcript-ref {
font-weight: 600;
color: #1a1a4e;
font-size: 10px;
}
.appendix-group {
font-size: 11px;
font-weight: 700;
color: #1a1a4e;
background: #f0f1f5;
padding: 4px 8px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
/* ── Source / Footer ── */
.source {
font-size: 10px;
color: #999;
margin-top: 3px;
font-style: italic;
}
.ai-disclaimer {
background-color: #fff3cd;
border: 1px solid #ffc107;
border-radius: 4px;
padding: 4px 10px;
font-size: 11px;
font-weight: 600;
color: #664d03;
text-align: center;
margin-bottom: 12px;
}
.page-footer {
border-top: 2px solid #1a1a4e;
padding-top: 10px;
margin-top: 32px;
text-align: center;
}
.page-footer .footer-disclaimer {
font-size: 11px;
font-weight: 600;
color: #664d03;
background-color: #fff3cd;
border: 1px solid #ffc107;
border-radius: 4px;
padding: 4px 10px;
display: inline-block;
margin-bottom: 4px;
}
.page-footer .footer-meta {
font-size: 10px;
color: #888;
}
/* ── Print Styles ── */
@media print {
body { font-size: 11px; }
.page { padding: 16px; max-width: none; }
.chart-container { break-inside: avoid; }
table { break-inside: avoid; }
.page-break { margin-top: 0; }
.no-print { display: none; }
}
</style>
</head>
<body>
<div class="page">
<!-- ════════════════════════════════════════════ -->
<!-- PAGE 1: COVER & THESIS -->
<!-- ════════════════════════════════════════════ -->
<div class="ai-disclaimer">Analysis is AI-generated — please confirm all outputs</div>
<div class="cover-header">
<div>
<div class="brand">Earnings Preview</div>
<div class="sector">[Industry] | [TICKER]</div>
</div>
<div class="date">[Full Date]</div>
</div>
<h1 class="report-title">[Company Name] ([TICKER]) [Q# FY####] Earnings Preview: [Thematic Subtitle]</h1>
<div class="executive-summary">
<!-- Executive thesis: 2-3 short paragraphs + bullet points.
What we expect, our EPS estimate vs consensus, guidance expectations,
key metrics to watch, what would move the stock, key debates.
Weave in 3-4 management quotes as blockquotes where they support the thesis.
Do NOT create a separate "Key Management Quotes" section. -->
<p>[Opening 1-2 sentences: what we expect from this print.]</p>
<ul>
<li><strong>EPS:</strong> We estimate <a href="#ref-1" class="data-ref">$X.XX</a> vs consensus <a href="#ref-2" class="data-ref">$X.XX</a>, [rationale]</li>
<li><strong>Revenue:</strong> We estimate <a href="#ref-3" class="data-ref">$XX.XB</a> vs consensus <a href="#ref-4" class="data-ref">$XX.XB</a>, [rationale]</li>
<li><strong>Guidance:</strong> [What to expect on forward guidance]</li>
<li><strong>Key metric:</strong> [Most important sub-headline metric to watch]</li>
<li><strong>Stock catalyst:</strong> [What would move the stock up/down post-print]</li>
<li><strong>Key debate:</strong> [What bulls and bears disagree on]</li>
</ul>
<blockquote>"[Key management quote supporting a thesis point]" — [Speaker], [Q# FY####] Earnings Call</blockquote>
<p>[1-2 sentences tying it together — your overall read on the setup.]</p>
<blockquote>"[Another supporting quote]" — [Speaker], [Q# FY####] Earnings Call</blockquote>
</div>
<!-- ════════════════════════════════════════════ -->
<!-- PAGE 2: ESTIMATES, THEMES & NEWS -->
<!-- ════════════════════════════════════════════ -->
<div class="page-break">
<!-- Consensus Estimates Table (Figure label inline) -->
<h2 class="section-title">Consensus Estimates — [Q# FY####]</h2>
<h4 class="figure-title">[Q# FY####] Consensus Estimates</h4>
<table>
<thead>
<tr>
<th>Metric</th>
<th class="num">Consensus</th>
<th class="num">Our Estimate</th>
<th class="num">y/y Change</th>
</tr>
</thead>
<tbody>
<tr><td>Revenue</td><td class="num"><a href="#ref-N" class="data-ref">$[XX.X]B</a></td><td class="num"><a href="#ref-N" class="data-ref">$[XX.X]B</a></td><td class="num [pos|neg]"><a href="#ref-N" class="data-ref">[+/-X.X%]</a></td></tr>
<tr><td>Diluted EPS</td><td class="num"><a href="#ref-N" class="data-ref">$[X.XX]</a></td><td class="num"><a href="#ref-N" class="data-ref">$[X.XX]</a></td><td class="num [pos|neg]"><a href="#ref-N" class="data-ref">[+/-X.X%]</a></td></tr>
<tr><td>Gross Margin</td><td class="num"><a href="#ref-N" class="data-ref">[XX.X%]</a></td><td class="num"><a href="#ref-N" class="data-ref">[XX.X%]</a></td><td class="num [pos|neg]"><a href="#ref-N" class="data-ref">[+/-XXbps]</a></td></tr>
<tr><td>Operating Income</td><td class="num"><a href="#ref-N" class="data-ref">$[X.X]B</a></td><td class="num"><a href="#ref-N" class="data-ref">$[X.X]B</a></td><td class="num [pos|neg]"><a href="#ref-N" class="data-ref">[+/-X.X%]</a></td></tr>
<!-- Add 2-3 company-specific KPIs below (e.g., comp sales, eComm growth, membership revenue) -->
<tr><td>[Company KPI 1]</td><td class="num">[Value]</td><td class="num">[Value]</td><td class="num [pos|neg]">[Change]</td></tr>
<tr><td>[Company KPI 2]</td><td class="num">[Value]</td><td class="num">[Value]</td><td class="num [pos|neg]">[Change]</td></tr>
</tbody>
</table>
<div class="source">Source: Kensho, S&P Capital IQ</div>
<!-- Key Metrics Beyond Headline EPS -->
<h3 class="subsection-title">Key Metrics Beyond Headline EPS</h3>
<div class="key-metrics">
<ul>
<li><strong>[Metric 1]:</strong> [What consensus/management expects, why it matters. Be specific with numbers.]</li>
<li><strong>[Metric 2]:</strong> [Details]</li>
<li><strong>[Metric 3]:</strong> [Details]</li>
<!-- 3-5 items -->
</ul>
</div>
<!-- Themes to Watch -->
<h3 class="subsection-title">Themes to Watch</h3>
<div class="themes">
<ul>
<li><strong>[Theme 1]:</strong> [1-2 sentences max. Forward-looking, specific.]</li>
<li><strong>[Theme 2]:</strong> [Details]</li>
<li><strong>[Theme 3]:</strong> [Details]</li>
<!-- 3-5 themes -->
</ul>
</div>
<!-- Recent News & Developments -->
<h3 class="subsection-title">Recent News & Developments</h3>
<div class="news-list">
<ul>
<li><strong>[Date]:</strong> [Headline] — [Brief impact assessment, one line]</li>
<li><strong>[Date]:</strong> [Headline] — [Impact]</li>
<li><strong>[Date]:</strong> [Headline] — [Impact]</li>
<!-- 3-5 material items from last 60 days -->
</ul>
</div>
<div class="source">Source: Kensho</div>
</div>
<!-- ════════════════════════════════════════════ -->
<!-- PAGES 3-5: FIGURES -->
<!-- All charts and tables, numbered sequentially -->
<!-- ════════════════════════════════════════════ -->
<div class="page-break">
<h2 class="section-title">Financial & Competitive Analysis</h2>
<!-- Figure 1: Quarterly Revenue & Diluted EPS -->
<div class="chart-row">
<div class="chart-container">
<h4 class="figure-title">Figure 1: Quarterly Revenue & Diluted EPS</h4>
<canvas id="chart-rev-eps"></canvas>
<div class="source">Source: S&P Capital IQ</div>
</div>
<!-- Figure 2: Margin Trends -->
<div class="chart-container">
<h4 class="figure-title">Figure 2: Margin Trends (Gross & Operating %)</h4>
<canvas id="chart-margins"></canvas>
<div class="source">Source: S&P Capital IQ</div>
</div>
</div>
<!-- Figure 3: Revenue Growth y/y % -->
<div class="chart-row">
<div class="chart-container chart-full">
<h4 class="figure-title">Figure 3: Revenue Growth y/y (%)</h4>
<canvas id="chart-rev-growth" style="max-height: 200px;"></canvas>
<div class="source">Source: S&P Capital IQ</div>
</div>
</div>
<!-- Figure 4: Business Segment Revenue -->
<h4 class="figure-title">Figure 4: Business Segment Revenue</h4>
<table>
<thead>
<tr>
<th>Segment</th>
<th class="num">Latest Q Rev ($M)</th>
<th class="num">% of Total</th>
<th class="num">y/y Change</th>
</tr>
</thead>
<tbody>
<!-- Populate from segment data. Color-code y/y change with pos/neg classes. -->
</tbody>
</table>
<div class="source">Source: S&P Capital IQ</div>
</div>
<!-- Page break for stock & competitor charts -->
<div class="page-break">
<!-- Figure 5: 1-Year Stock Price with Earnings Dates -->
<div class="chart-row">
<div class="chart-container chart-full">
<h4 class="figure-title">Figure 5: 1-Year Stock Price with Earnings Dates</h4>
<canvas id="chart-price-annotated" style="max-height: 300px;"></canvas>
<div class="source">Source: S&P Capital IQ</div>
</div>
</div>
<!-- Figure 6: Stock Performance vs. Competitors (Indexed to 100) -->
<div class="chart-row">
<div class="chart-container chart-full">
<h4 class="figure-title">Figure 6: Stock Performance vs. Competitors — 1 Year (Indexed to 100)</h4>
<canvas id="chart-comp-perf" style="max-height: 300px;"></canvas>
<div class="source">Source: S&P Capital IQ</div>
</div>
</div>
</div>
<div class="page-break">
<!-- Figure 7: LTM P/E vs. Competitors -->
<div class="chart-row">
<div class="chart-container chart-full">
<h4 class="figure-title">Figure 7: LTM P/E vs. Competitors</h4>
<canvas id="chart-pe-comp" style="max-height: 280px;"></canvas>
<div class="source">Source: S&P Capital IQ</div>
</div>
</div>
<!-- Figure 8: Competitor Comparison Table -->
<h4 class="figure-title">Figure 8: Competitor Comparison</h4>
<table>
<thead>
<tr>
<th>Ticker</th>
<th>Company</th>
<th class="num">Mkt Cap ($B)</th>
<th class="num">LTM P/E</th>
<th class="num">NTM P/E</th>
<th class="num">YTD %</th>
<th class="num">1-Yr %</th>
</tr>
</thead>
<tbody>
<!-- Highlight the subject company row with class="highlight-row" -->
</tbody>
</table>
<div class="source">Source: S&P Capital IQ</div>
</div>
<!-- ════════════════════════════════════════════ -->
<!-- APPENDIX: DATA SOURCES & CALCULATIONS -->
<!-- ════════════════════════════════════════════ -->
<div class="page-break appendix" id="appendix">
<div class="ai-disclaimer">Analysis is AI-generated — please confirm all outputs</div>
<h2 class="section-title">Appendix: Data Sources & Calculations</h2>
<p style="font-size: 11px; color: #666; margin-bottom: 12px;">
Every claim in this report is hyperlinked to its entry below. Click any highlighted text to jump here.
</p>
<table>
<thead>
<tr>
<th style="width: 40px;">Ref</th>
<th style="width: 170px;">Fact</th>
<th style="width: 75px;">Value</th>
<th>Source & Derivation</th>
</tr>
</thead>
<tbody>
<!-- Group: Quarterly Financials -->
<tr><td colspan="4" class="appendix-group">Quarterly Financials</td></tr>
<tr id="ref-1">
<td class="ref-id">1</td>
<td>[Q# FY#### Revenue]</td>
<td class="num">$[XX.X]B</td>
<td class="source-detail">
<span class="src-label">S&P Capital IQ</span> — get_financial_line_item_from_identifiers(identifier='[TICKER]', line_item='revenue', period_type='quarterly', period='[Q# FY####]')
</td>
</tr>
<tr id="ref-2">
<td class="ref-id">2</td>
<td>[Q# FY#### Diluted EPS]</td>
<td class="num">$[X.XX]</td>
<td class="source-detail">
<span class="src-label">S&P Capital IQ</span> — get_financial_line_item_from_identifiers(identifier='[TICKER]', line_item='diluted_eps', period_type='quarterly', period='[Q# FY####]')
</td>
</tr>
<tr id="ref-3">
<td class="ref-id">3</td>
<td>[Q# FY#### Gross Profit]</td>
<td class="num">$[XX.X]B</td>
<td class="source-detail">
<span class="src-label">S&P Capital IQ</span> — get_financial_line_item_from_identifiers(identifier='[TICKER]', line_item='gross_profit', period_type='quarterly', period='[Q# FY####]')
</td>
</tr>
<tr id="ref-4">
<td class="ref-id">4</td>
<td>[Q# FY#### Gross Margin]</td>
<td class="num">[XX.X%]</td>
<td class="source-detail">
<span class="formula"><a href="#ref-3" class="data-ref">Gross Profit $XX.XB</a> / <a href="#ref-1" class="data-ref">Revenue $XX.XB</a> = XX.X%</span><br>
<span class="src-label">S&P Capital IQ</span> (calculated)
</td>
</tr>
<tr id="ref-5">
<td class="ref-id">5</td>
<td>[Q# FY#### Revenue y/y Growth]</td>
<td class="num">[+/-X.X%]</td>
<td class="source-detail">
<span class="formula">(<a href="#ref-1" class="data-ref">[Q# FY## Rev $XX.XB]</a> - <a href="#ref-N" class="data-ref">[Q# FY## Rev $XX.XB]</a>) / <a href="#ref-N" class="data-ref">[Q# FY## Rev $XX.XB]</a> = X.X%</span><br>
<span class="src-label">S&P Capital IQ</span> (calculated)
</td>
</tr>
<!-- Continue for all financial data points... -->
<!-- Group: Valuation -->
<tr><td colspan="4" class="appendix-group">Valuation</td></tr>
<tr id="ref-N">
<td class="ref-id">[N]</td>
<td>Current Stock Price — [TICKER]</td>
<td class="num">$[XXX.XX]</td>
<td class="source-detail">
<span class="src-label">S&P Capital IQ</span> — get_prices_from_identifiers(identifier='[TICKER]', periodicity='day')
</td>
</tr>
<tr id="ref-N">
<td class="ref-id">[N]</td>
<td>Market Cap — [TICKER]</td>
<td class="num">$[XXX.X]B</td>
<td class="source-detail">
<span class="src-label">S&P Capital IQ</span> — get_capitalization_from_identifiers(identifier='[TICKER]', capitalization='market_cap')
</td>
</tr>
<tr id="ref-N">
<td class="ref-id">[N]</td>
<td>LTM P/E — [TICKER]</td>
<td class="num">[XX.X]x</td>
<td class="source-detail">
<span class="formula"><a href="#ref-20" class="data-ref">Price $XXX.XX</a> / (<a href="#ref-8" class="data-ref">Q1 EPS $X.XX</a> + <a href="#ref-9" class="data-ref">Q2 EPS $X.XX</a> + <a href="#ref-10" class="data-ref">Q3 EPS $X.XX</a> + <a href="#ref-11" class="data-ref">Q4 EPS $X.XX</a>) = XX.Xx</span><br>
<span class="src-label">S&P Capital IQ</span> (calculated)
</td>
</tr>
<tr id="ref-N">
<td class="ref-id">[N]</td>
<td>NTM P/E — [TICKER]</td>
<td class="num">[XX.X]x</td>
<td class="source-detail">
<span class="formula"><a href="#ref-20" class="data-ref">Price $XXX.XX</a> / (<a href="#ref-N" class="data-ref">Q4'25E $X.XX</a> + <a href="#ref-N" class="data-ref">Q1'26E $X.XX</a> + <a href="#ref-N" class="data-ref">Q2'26E $X.XX</a> + <a href="#ref-N" class="data-ref">Q3'26E $X.XX</a>) = XX.Xx</span><br>
<span class="src-label">S&P Capital IQ</span> — get_consensus_estimates_from_identifiers(identifier='[TICKER]', period_type='quarterly', num_periods_forward=4). NTM EPS = sum of next 4 quarterly consensus mean EPS estimates.
</td>
</tr>
<!-- Group: Transcript Claims -->
<tr><td colspan="4" class="appendix-group">Transcript Claims</td></tr>
<tr id="ref-N">
<td class="ref-id">[N]</td>
<td>[Fact, e.g., "Management guided comp sales +3-4%"]</td>
<td class="num">N/A</td>
<td class="source-detail">
<span class="excerpt">"We expect comp sales growth of 3-4% in Q4, driven by continued strength in grocery and health & wellness."</span><br>
<span class="src-label">Source:</span> <span class="transcript-ref">[Q# FY#### Earnings Call Transcript]</span> (key_dev_id: [ID]) — [Speaker Name], [Title]
</td>
</tr>
<!-- Group: Estimates & Consensus -->
<tr><td colspan="4" class="appendix-group">Estimates & Consensus</td></tr>
<tr id="ref-N">
<td class="ref-id">[N]</td>
<td>Consensus EPS — [Q# FY####]</td>
<td class="num">$[X.XX]</td>
<td class="source-detail">
<span class="excerpt">"Consensus EPS estimate of $X.XX, revised up from $X.XX over the past 90 days."</span><br>
<a href="https://[source-url-from-kensho-search]" target="_blank" class="src-url">[Source Title / Publication Name]</a><br>
<span class="src-label">Query:</span> search("[TICKER] earnings estimates consensus EPS revenue upcoming quarter")
</td>
</tr>
<!-- Group: News & Analyst Commentary -->
<tr><td colspan="4" class="appendix-group">News & Analyst Commentary</td></tr>
<tr id="ref-N">
<td class="ref-id">[N]</td>
<td>[e.g., "Barclays upgraded to Overweight"]</td>
<td class="num">N/A</td>
<td class="source-detail">
<span class="excerpt">"Barclays upgraded WMT to Overweight with a $210 price target, citing accelerating eCommerce momentum."</span><br>
<a href="https://[source-url-from-kensho-search]" target="_blank" class="src-url">[Source Title / Publication, Date]</a><br>
<span class="src-label">Query:</span> search("[TICKER] analyst ratings price target upgrades downgrades")
</td>
</tr>
<!-- Group: Stock Performance -->
<tr><td colspan="4" class="appendix-group">Stock Performance</td></tr>
<tr id="ref-N">
<td class="ref-id">[N]</td>
<td>YTD Return — [TICKER]</td>
<td class="num">[+/-X.X%]</td>
<td class="source-detail">
<span class="formula">(<a href="#ref-N" class="data-ref">Current $XXX.XX</a> - <a href="#ref-N" class="data-ref">Dec 31 Close $XXX.XX</a>) / <a href="#ref-N" class="data-ref">Dec 31 Close $XXX.XX</a> = X.X%</span><br>
<span class="src-label">S&P Capital IQ</span> (calculated from daily prices)
</td>
</tr>
</tbody>
</table>
</div>
<!-- ════════════════════════════════════════════ -->
<!-- FOOTER -->
<!-- ════════════════════════════════════════════ -->
<div class="page-footer">
<div class="footer-disclaimer">Analysis is AI-generated — please confirm all outputs</div>
<div class="footer-meta">Data: S&P Capital IQ, Kensho | [Month Day, Year]</div>
</div>
</div>
<!-- ════════════════════════════════════════════════ -->
<!-- CHART.JS SCRIPTS -->
<!-- ════════════════════════════════════════════════ -->
<script>
// ── Register Annotation Plugin ──
// The CDN-loaded annotation plugin must be explicitly registered.
// It is available as a global after the script tag loads.
if (window['chartjs-plugin-annotation']) {
Chart.register(window['chartjs-plugin-annotation']);
}
// ── Chart Defaults ──
Chart.defaults.font.family = "'Arial Narrow', Arial, sans-serif";
Chart.defaults.font.size = 11;
Chart.defaults.color = '#555';
Chart.defaults.plugins.legend.position = 'bottom';
Chart.defaults.plugins.legend.labels.boxWidth = 12;
// ── Color Palette ──
const COLORS = {
navy: '#1a1a4e',
blue: '#3366cc',
teal: '#0d9488',
orange: '#e67e22',
red: '#c0392b',
green: '#27ae60',
purple: '#8e44ad',
gray: '#7f8c8d',
lightBlue:'#85c1e9',
gold: '#f0b429',
};
const COMP_COLORS = [
COLORS.navy, COLORS.blue, COLORS.teal,
COLORS.orange, COLORS.red, COLORS.green,
COLORS.purple, COLORS.gold
];
// ── Helper: Revenue & EPS Combo Chart ──
function createRevEpsChart(canvasId, labels, revenueData, epsData, revLabel) {
const ctx = document.getElementById(canvasId);
if (!ctx) return;
new Chart(ctx, {
type: 'bar',
data: {
labels: labels,
datasets: [
{
label: revLabel || 'Revenue ($B)',
data: revenueData,
backgroundColor: COLORS.navy + 'cc',
borderColor: COLORS.navy,
borderWidth: 1,
yAxisID: 'y',
order: 2
},
{
label: 'Diluted EPS',
data: epsData,
type: 'line',
borderColor: COLORS.orange,
backgroundColor: COLORS.orange,
borderWidth: 2.5,
pointRadius: 4,
pointBackgroundColor: COLORS.orange,
tension: 0.3,
yAxisID: 'y1',
order: 1
}
]
},
options: {
responsive: true,
interaction: { mode: 'index', intersect: false },
scales: {
y: {
position: 'left',
title: { display: true, text: revLabel || 'Revenue ($B)', font: { size: 11 } },
grid: { color: '#eee' }
},
y1: {
position: 'right',
title: { display: true, text: 'EPS ($)', font: { size: 11 } },
grid: { drawOnChartArea: false }
}
}
}
});
}
// ── Helper: Margin Trend Chart ──
function createMarginChart(canvasId, labels, grossMargins, opMargins) {
const ctx = document.getElementById(canvasId);
if (!ctx) return;
new Chart(ctx, {
type: 'line',
data: {
labels: labels,
datasets: [
{
label: 'Gross Margin %',
data: grossMargins,
borderColor: COLORS.blue,
backgroundColor: COLORS.blue + '20',
borderWidth: 2.5,
pointRadius: 4,
fill: false,
tension: 0.3
},
{
label: 'Operating Margin %',
data: opMargins,
borderColor: COLORS.teal,
backgroundColor: COLORS.teal + '20',
borderWidth: 2.5,
pointRadius: 4,
fill: false,
tension: 0.3
}
]
},
options: {
responsive: true,
scales: {
y: {
title: { display: true, text: 'Margin (%)', font: { size: 11 } },
grid: { color: '#eee' },
ticks: { callback: v => v.toFixed(1) + '%' }
}
}
}
});
}
// ── Helper: Revenue Growth Bar Chart ──
function createRevGrowthChart(canvasId, labels, growthData) {
const ctx = document.getElementById(canvasId);
if (!ctx) return;
new Chart(ctx, {
type: 'bar',
data: {
labels: labels,
datasets: [{
label: 'Revenue Growth y/y %',
data: growthData,
backgroundColor: growthData.map(v => v >= 0 ? COLORS.green + 'cc' : COLORS.red + 'cc'),
borderColor: growthData.map(v => v >= 0 ? COLORS.green : COLORS.red),
borderWidth: 1
}]
},
options: {
responsive: true,
scales: {
y: {
title: { display: true, text: 'Growth (%)', font: { size: 11 } },
grid: { color: '#eee' },
ticks: { callback: v => v.toFixed(1) + '%' }
}
},
plugins: { legend: { display: false } }
}
});
}
// ── Helper: Earnings-Annotated Stock Price Chart ──
function createAnnotatedPriceChart(canvasId, labels, prices, earningsDates, ticker) {
const ctx = document.getElementById(canvasId);
if (!ctx) return;
const annotations = {};
earningsDates.forEach((ed, i) => {
let xValue = ed.date;
const isNeg = ed.move.startsWith('-');
annotations['earnings' + i] = {
type: 'line',
xMin: xValue,
xMax: xValue,
borderColor: isNeg ? '#c0392b' : '#0d7a3e',
borderWidth: 2,
borderDash: [6, 4],
label: {
display: true,
content: ed.label + ' (' + ed.move + ')',
position: i % 2 === 0 ? 'start' : 'end',
backgroundColor: isNeg ? '#c0392b' : '#0d7a3e',
color: '#fff',
font: { size: 10, weight: 'bold' },
padding: { top: 3, bottom: 3, left: 6, right: 6 },
borderRadius: 3
}
};
});
new Chart(ctx, {
type: 'line',
data: {
labels: labels,
datasets: [{
label: ticker + ' Close',
data: prices,
borderColor: COLORS.navy,
backgroundColor: COLORS.navy + '15',
borderWidth: 1.5,
pointRadius: 0,
pointHitRadius: 4,
fill: true,
tension: 0.1
}]
},
options: {
responsive: true,
interaction: { mode: 'index', intersect: false },
scales: {
x: { type: 'category', ticks: { maxTicksLimit: 12, font: { size: 10 } }, grid: { display: false } },
y: { title: { display: true, text: 'Price ($)', font: { size: 11 } }, grid: { color: '#eee' } }
},
plugins: {
annotation: { annotations: annotations },
tooltip: { callbacks: { label: ctx => ticker + ': $' + ctx.raw.toFixed(2) } }
}
}
});
}
// ── Helper: Competitor Indexed Performance Chart ──
// datasets: [{ label: 'TICKER', data: [price1, price2, ...], color: '#xxx', isSubject: true/false }, ...]
function createCompPerfChart(canvasId, labels, datasets) {
const ctx = document.getElementById(canvasId);
if (!ctx) return;
const chartDatasets = datasets.map((ds, i) => {
const base = ds.data[0] || 1;
return {
label: ds.label,
data: ds.data.map(v => (v / base) * 100),
borderColor: ds.color || COMP_COLORS[i % COMP_COLORS.length],
backgroundColor: 'transparent',
borderWidth: ds.isSubject ? 3 : 1.5,
borderDash: ds.isSubject ? [] : [4, 2],
pointRadius: 0,
tension: 0.2
};
});
new Chart(ctx, {
type: 'line',
data: { labels: labels, datasets: chartDatasets },
options: {
responsive: true,
interaction: { mode: 'index', intersect: false },
scales: {
y: { title: { display: true, text: 'Indexed (100 = Start)', font: { size: 11 } }, grid: { color: '#eee' } },
x: { ticks: { maxTicksLimit: 12 } }
},
plugins: {
tooltip: { callbacks: { label: ctx => ctx.dataset.label + ': ' + ctx.raw.toFixed(1) } }
}
}
});
}
// ── Helper: LTM P/E Horizontal Bar Chart ──
// companies: [{ label: 'TICKER', pe: 25.3, isSubject: true/false }, ...]
function createPEChart(canvasId, companies) {
const ctx = document.getElementById(canvasId);
if (!ctx) return;
companies.sort((a, b) => b.pe - a.pe);
new Chart(ctx, {
type: 'bar',
data: {
labels: companies.map(c => c.label),
datasets: [{
label: 'LTM P/E',
data: companies.map(c => c.pe),
backgroundColor: companies.map(c => c.isSubject ? COLORS.navy : COLORS.lightBlue),
borderColor: companies.map(c => c.isSubject ? COLORS.navy : COLORS.blue),
borderWidth: 1
}]
},
options: {
indexAxis: 'y',
responsive: true,
scales: {
x: {
title: { display: true, text: 'LTM P/E', font: { size: 11 } },
grid: { color: '#eee' }
},
y: {
ticks: { font: { size: 12, weight: 'bold' } }
}
},
plugins: {
legend: { display: false },
tooltip: {
callbacks: { label: ctx => 'P/E: ' + ctx.raw.toFixed(1) + 'x' }
}
}
}
});
}
// ═══════════════════════════════════════════════
// HELPER FUNCTIONS DEFINED ABOVE — DO NOT REWRITE THEM.
// Use ONLY these functions to create charts.
// DO NOT write custom inline Chart.js code.
// ═══════════════════════════════════════════════
</script>
<!-- ═══════════════════════════════════════════════════════════ -->
<!-- CHART DATA — EACH CHART IN ITS OWN SCRIPT + TRY-CATCH -->
<!-- A syntax error in one chart must NOT break the others. -->
<!-- MANDATORY: Use the helper functions above. No custom code. -->
<!-- ═══════════════════════════════════════════════════════════ -->
<!-- Figure 1: Revenue & EPS -->
<script>
try {
createRevEpsChart('chart-rev-eps',
['Q1 FY24','Q2 FY24','Q3 FY24','Q4 FY24','Q1 FY25','Q2 FY25','Q3 FY25','Q4 FY25'],
[152.3, 161.6, 160.8, 173.4, 161.5, 169.3, 165.8, 178.0], // revenue in $B
[1.47, 1.84, 1.53, 1.80, 1.56, 1.92, 1.60, 1.90], // diluted EPS
'Revenue ($B)'
);
} catch(e) { console.error('Figure 1 error:', e); }
</script>
<!-- Figure 2: Margin Trends -->
<script>
try {
createMarginChart('chart-margins',
['Q1 FY24','Q2 FY24','Q3 FY24','Q4 FY24','Q1 FY25','Q2 FY25','Q3 FY25','Q4 FY25'],
[24.0, 24.4, 24.2, 23.8, 24.5, 24.8, 24.6, 24.1], // gross margin %
[4.2, 5.1, 4.5, 4.8, 4.6, 5.3, 4.7, 5.0] // operating margin %
);
} catch(e) { console.error('Figure 2 error:', e); }
</script>
<!-- Figure 3: Revenue Growth y/y — ONLY quarters where y/y can be computed (most recent 4) -->
<script>
try {
createRevGrowthChart('chart-rev-growth',
['Q1 FY25','Q2 FY25','Q3 FY25','Q4 FY25'], // Only 4 labels — quarters with y/y data
[6.0, 4.8, 3.1, 2.7] // y/y revenue growth % for those 4 quarters
);
} catch(e) { console.error('Figure 3 error:', e); }
</script>
<!-- Figure 5: Annotated Stock Price -->
<script>
try {
createAnnotatedPriceChart('chart-price-annotated',
['2025-02-18','2025-02-19'], // ... daily date labels for 1 year
[170.5, 171.2], // ... daily closing prices
[
{ date: '2025-05-15', label: 'Q1 FY26', move: '+3.2%' },
{ date: '2025-08-15', label: 'Q2 FY26', move: '-1.8%' }
],
'WMT'
);
} catch(e) { console.error('Figure 5 error:', e); }
</script>
<!-- Figure 6: Competitor Indexed Performance -->
<script>
try {
createCompPerfChart('chart-comp-perf',
['2025-02-18','2025-03-18'], // ... date labels
[
{ label: 'WMT', data: [170.5, 172.3], isSubject: true },
{ label: 'COST', data: [580.2, 595.1], isSubject: false },
{ label: 'TGT', data: [142.0, 138.5], isSubject: false }
]
);
} catch(e) { console.error('Figure 6 error:', e); }
</script>
<!-- Figure 7: LTM P/E Comparison -->
<script>
try {
createPEChart('chart-pe-comp', [
{ label: 'COST', pe: 52.3, isSubject: false },
{ label: 'WMT', pe: 28.1, isSubject: true },
{ label: 'TGT', pe: 15.6, isSubject: false },
{ label: 'BJ', pe: 22.4, isSubject: false }
]);
} catch(e) { console.error('Figure 7 error:', e); }
</script>
</body>
</html>Chart.js Implementation Notes
Figure 2: Revenue & EPS Chart
- Type: Combo bar + line
- Bars: Quarterly revenue on left y-axis
- Line: Diluted EPS on right y-axis
- Labels: Quarter identifiers (e.g., "Q1 FY24")
- Use 8 quarters of data
Figure 3: Margin Trend Chart
- Type: Dual line chart
- Lines: Gross margin % and operating margin %
- Y-axis: Percentage with 1 decimal place
Figure 3: Revenue Growth Chart
- Type: Bar chart with conditional coloring
- Green bars: Positive growth quarters
- Red bars: Negative growth quarters
- 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. - No legend needed (self-explanatory)
Figure 4: Business Segment Revenue
- Use HTML table (not a chart)
- Columns: Segment | Latest Q Rev ($M) | % of Total | y/y Change
- Color-code y/y change cells with pos/neg classes
Figure 5: Earnings-Annotated Stock Price Chart
- Type: Line chart with annotation plugin vertical lines
- Data: 1 year of daily closing prices
- Annotations: Vertical dashed lines at each earnings date
- Labels: Quarter name + 1-day post-earnings stock move
- Colors: Green for positive reactions, red for negative
- Calculating the 1-day move: Compare closing price on earnings date to next trading day close
- CRITICAL: The annotation plugin MUST be registered before creating charts:
Chart.register(window['chartjs-plugin-annotation'])— this is already in the template script block
Figure 7: Competitor Indexed Performance Chart
- Type: Multi-line chart, rebased to 100
- Subject company: Solid thick line (borderWidth: 3)
- Competitors: Thinner dashed lines (borderWidth: 1.5, borderDash)
- This visual hierarchy makes the subject company immediately identifiable
Figure 8: LTM P/E Comparison Chart
- Type: Horizontal bar chart
- Subject company: Highlighted in navy (#1a1a4e)
- Competitors: Light blue (#85c1e9)
- Sorted: Descending by P/E
- Shows at a glance whether the company trades at a premium or discount to peers
Figure 8: Competitor Comparison Table
- HTML table with highlight-row for subject company
- Columns: Ticker | Company | Mkt Cap ($B) | LTM P/E | NTM P/E | YTD % | 1-Yr %
- Color-code returns with pos/neg classes
Formatting Conventions
Numbers
- Revenue: 1 decimal place for $B (e.g., "$152.3B"), no decimals for $M (e.g., "$4,521M")
- EPS: 2 decimal places (e.g., "$1.47")
- Margins: 1 decimal place with % sign (e.g., "24.5%")
- Growth rates: 1 decimal place with +/- sign (e.g., "+5.2%", "-3.1%")
- Market cap: 1 decimal place for $B (e.g., "$562.1B")
- Stock prices: 2 decimal places (e.g., "$172.35")
- P/E ratios: 1 decimal place with 'x' suffix (e.g., "25.3x")
Color Coding
- Positive values:
class="pos"-- green (#0d7a3e) - Negative values:
class="neg"-- red (#c0392b) - Neutral/flat:
class="neutral"-- gray (#555) - Subject company row:
class="highlight-row"-- light blue background
Figure Labels
- Number all figures sequentially: "Figure 1:", "Figure 2:", etc.
- Figures 1-8 are on Pages 3-5 (the Consensus Estimates table on Page 2 is not numbered)
- Include source attribution under every chart and table: "Source: S&P Capital IQ"
Hyperlinked Claims
- Every factual claim in the report body — numbers AND qualitative statements — must be wrapped in
<a href="#ref-N" class="data-ref">CLAIM TEXT</a> - The
ref-NID must match a row in the Appendix table - This applies to: narrative text, bullet points, table cells, blockquotes — anywhere a fact appears
- Chart axis labels and tooltips do NOT need hyperlinks (only report body text)
- Assign reference IDs sequentially (
ref-1,ref-2, ...) as you write the report - Multiple references to the same underlying claim should share the same ref ID
- For qualitative claims, wrap the key phrase:
<a href="#ref-25" class="data-ref">management flagged tariff headwinds</a>
Appendix
- MUST begin with:
<div class="ai-disclaimer">Analysis is AI-generated — please confirm all outputs</div> - The Appendix is the final section of the report, after all figures
- 4 columns: Ref # | Fact | Value | Source & Derivation
- One row per unique claim referenced in the report (numeric and non-numeric)
- Every number in the report body must be a clickable `<a href="#ref-N">` link to its appendix row. No exceptions.
- Group rows by category: Quarterly Financials, Valuation, Transcript Claims, Estimates & Consensus, News & Analyst Commentary, Stock Performance
- Use subheading rows (
appendix-groupclass) to separate groups - Source & Derivation column must include specific, detailed sourcing for EVERY row:
- For raw S&P data (revenue, EPS, prices, market cap, etc.):
<span class="src-label">S&P Capital IQ</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. - For calculated values (margins, growth rates, P/E, returns): the full formula with
<a class="data-ref">hyperlinks to each component row (useformulaCSS class). Every number in the formula must be a clickable link to its own appendix row. - For transcript claims: the verbatim excerpt sentence in italics (
excerptCSS class) + transcript name withtranscript-refclass +key_dev_id - For Kensho results: the key finding (
excerptclass) + clickable source URL as<a href="[URL]" target="_blank" class="src-url">[Source Title]</a>+ the search query used. Every Kensho-sourced claim must have a clickable URL to the original source. - Source labels use the
src-labelCSS class (bold navy) - External source URLs use the
src-urlCSS class (blue, underlined, clickable)
Style Rules
- NO EMOJIS anywhere in the report. No emoji in headings, tables, chart labels, or body text. This is a professional research document.
- Font: Arial Narrow throughout (body, headings, tables, charts).
- Management quotes: Integrate as
<blockquote>elements within the executive thesis narrative. Never under a separate heading. - Keep all text concise. Target 4-5 printed pages total (appendix is additional).
Related skills
How it compares
Pick this over generic financial prompts when you need a verified seven-phase MCP pipeline that outputs a printable 4–5 page HTML earnings preview.
FAQ
How long is the output?
Roughly four to five printed pages in self-contained HTML.
What inputs are analyzed?
Recent transcript, competitors, valuation, and recent news.
What format?
Dense HTML report with figures and sourced data.
Is Earnings Preview Single safe to install?
skills.sh reports 1 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.