New to Claude Skills? Learn how to install them →

himself65 on GitHub

Earnings Preview

Free

Get detailed earnings forecasts using Yahoo Finance data.

Get this skill

Free · Opens the source repo

What Earnings Preview does

The Earnings Preview skill is designed for investors and analysts looking to prepare for upcoming earnings reports. By leveraging Yahoo Finance data through the yfinance library, this skill compiles essential information such as upcoming earnings dates, consensus estimates, historical performance, and analyst sentiment into a structured briefing. This allows users to quickly assess what to expect from a company's earnings call, making it a valuable tool for financial decision-making.

To use the skill, simply mention a stock ticker or a company name in the context of earnings, and the skill will automatically gather relevant data. It extracts key financial metrics, including earnings and revenue estimates, historical earnings performance, and analyst recommendations. The skill is straightforward to set up, requiring the installation of yfinance if it is not already available in the user's environment.

The output is organized into sections that cover all critical aspects of an earnings report. Users will receive information on the earnings date, consensus estimates, historical performance, analyst sentiment, and key financial metrics to watch. This comprehensive overview helps users make informed predictions about a company's earnings performance based on historical data and current market sentiment.

This skill is particularly useful for traders, investors, and financial analysts who need to stay updated on earnings reports and want to understand market expectations. It serves as a research tool that enhances the user's ability to prepare for earnings calls effectively.

When to use it

Use this skill when preparing for an upcoming earnings report or analyzing analyst expectations for a specific company.

When not to use it

This skill is not suitable for real-time trading decisions or in-depth financial analysis beyond earnings forecasts.

What you can build with it

Pre-Earnings Analysis for AAPL

Before Apple's earnings call, use this skill to gather consensus estimates and historical performance data.

Understanding Analyst Sentiment for TSLA

Analyze Tesla's earnings expectations and sentiment distribution to inform investment decisions.

Preparing for Earnings Season

Utilize the skill to quickly compile earnings previews for multiple companies during earnings season.

How to install Earnings Preview

View source

1. Install with the skills CLI

npx skills add himself65/finance-skills/earnings-preview --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by himself65

Earnings Preview Skill

Generates a pre-earnings briefing using Yahoo Finance data via yfinance. Pulls together upcoming earnings date, consensus estimates, historical accuracy, analyst sentiment, and key financial context — everything you need before an earnings call.

Important: Data is for research and educational purposes only. Not financial advice. yfinance is not affiliated with Yahoo, Inc.


Step 1: Ensure yfinance Is Available

Current environment status:

!`python3 -c "import yfinance; print('yfinance ' + yfinance.__version__ + ' installed')" 2>/dev/null || echo "YFINANCE_NOT_INSTALLED"`

If YFINANCE_NOT_INSTALLED, install it:

import subprocess, sys
subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "yfinance"])

If already installed, skip to the next step.


Step 2: Identify the Ticker and Gather All Data

Extract the ticker symbol from the user's request. If they mention a company name without a ticker, look it up. Then fetch all relevant data in one script to minimize API calls.

import yfinance as yf
import pandas as pd
from datetime import datetime

ticker = yf.Ticker("AAPL")  # replace with actual ticker

# --- Core data ---
info = ticker.info
calendar = ticker.calendar

# --- Estimates ---
earnings_est = ticker.earnings_estimate
revenue_est = ticker.revenue_estimate

# --- Historical track record ---
earnings_hist = ticker.earnings_history

# --- Analyst sentiment ---
price_targets = ticker.analyst_price_targets
recommendations = ticker.recommendations

# --- Recent financials for context ---
quarterly_income = ticker.quarterly_income_stmt
quarterly_cashflow = ticker.quarterly_cashflow

What to extract from each source

Data SourceKey FieldsPurpose
calendarEarnings Date, Ex-Dividend DateWhen earnings are and key dates
earnings_estimateavg, low, high, numberOfAnalysts, yearAgoEps, growth (for 0q, +1q, 0y, +1y)Consensus EPS expectations
revenue_estimateavg, low, high, numberOfAnalysts, yearAgoRevenue, growthRevenue expectations
earnings_historyepsEstimate, epsActual, epsDifference, surprisePercentBeat/miss track record
analyst_price_targetscurrent, low, high, mean, medianStreet price targets
recommendationsBuy/Hold/Sell countsSentiment distribution
quarterly_income_stmtTotalRevenue, NetIncome, BasicEPSRecent trajectory

Step 3: Build the Earnings Preview

Assemble the data into a structured briefing. The goal is to give the user everything they need in one glance.

Section 1: Earnings Date & Key Info

Report the upcoming earnings date from calendar. Include:

  • Company name, ticker, sector, industry
  • Upcoming earnings date (and whether it's before/after market)
  • Current stock price and recent performance (1-week, 1-month)
  • Market cap

Section 2: Consensus Estimates

Present the current quarter estimates from earnings_estimate and revenue_estimate:

MetricConsensusLowHigh# AnalystsYear AgoGrowth
EPS$1.42$1.35$1.5028$1.26+12.7%
Revenue$94.3B$92.1B$96.8B25$89.5B+5.4%

If the estimate range is unusually wide (high/low spread > 20% of consensus), note that as a sign of high uncertainty.

Section 3: Historical Beat/Miss Track Record

From earnings_history, show the last 4 quarters:

QuarterEPS EstEPS ActualSurpriseBeat/Miss
Q3 2024$1.35$1.40+3.7%Beat
Q2 2024$1.30$1.33+2.3%Beat
Q1 2024$1.52$1.53+0.7%Beat
Q4 2023$2.10$2.18+3.8%Beat

Summarize: "AAPL has beaten EPS estimates in 4 of the last 4 quarters by an average of 2.6%."

Section 4: Analyst Sentiment

From recommendations and analyst_price_targets:

  • Current recommendation distribution (Strong Buy / Buy / Hold / Sell / Strong Sell)
  • Price target range: low, mean, median, high vs. current price
  • Implied upside/downside from mean target

Section 5: Key Metrics to Watch

Based on the quarterly financials, highlight 3-5 things the market will focus on:

  • Revenue growth trend (accelerating or decelerating?)
  • Margin trajectory (expanding or compressing?)
  • Any notable line items that changed significantly quarter-over-quarter
  • Segment breakdowns if available in the data

This section requires judgment — think about what matters for this specific company/sector.


Step 4: Respond to the User

Present the preview as a clean, structured briefing:

  1. Lead with the headline: "AAPL reports earnings on [date]. Here's what to expect."
  2. Show all 5 sections with clear headers and tables
  3. End with a brief summary: 2-3 sentences capturing the overall setup (bullish/bearish lean based on estimates, track record, and sentiment — frame as "the street expects" not personal recommendation)

Caveats to include

  • Estimates can change up until the report date
  • Historical beats don't guarantee future beats
  • Yahoo Finance data may lag real-time consensus by a few hours
  • This is not financial advice

Reference Files

  • references/api_reference.md — Detailed yfinance API reference for earnings and estimate methods

Read the reference file when you need exact method signatures or edge case handling.

Frequently asked questions about Earnings Preview

Similar skills