Company Valuation
Alex YangCommunityCreated by Alex Yang
- Skill
- Workflow
- Business and productivity
- MIT
- Low risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
Company Valuation provides a structured, multi-method approach to determining the fair value of a public company. It triangulates results from Discounted Cash Flow (DCF), relative peer multiples, and Sum-of-the-Parts (SOTP) analysis to derive an implied share price. The skill includes automated data fetching, sensitivity analysis, and scenario modeling to help users assess whether a stock is overvalued or undervalued based on fundamental data.
What it does
- Performs a 5-year DCF projection using WACC and terminal value calculations.
- Conducts relative valuation by comparing the target to a peer group using P/E, EV/Revenue, and EV/EBITDA multiples.
- Executes SOTP analysis for multi-segment conglomerates.
- Generates a 5x5 sensitivity grid for WACC and terminal growth rates.
- Produces Bull, Base, and Bear case scenarios for valuation ranges.
- Calculates an implied share price by blending results from the chosen methods.
When to use it
- When you need to determine the intrinsic or fair value of a public company.
- When you want to assess if a stock is currently overvalued or undervalued.
- When you need to build a fundamental price target based on financial projections.
- When comparing a company's valuation against its industry peers.
- When analyzing a complex conglomerate that requires segment-level valuation.
Advantages
- Triangulates value using multiple industry-standard methodologies.
- Provides sensitivity and scenario analysis to account for assumption uncertainty.
- Automates the retrieval of financial data and peer multiples.
- Includes industry-specific guidance for DCF and relative valuation.
- Forces a disciplined, model-driven approach rather than relying on memory.
Usage examples
- “What is the fair value of AAPL based on a DCF and peer analysis?”
- The agent will fetch AAPL's financial data, run a 5-year DCF model, compare it against a peer group, and output a blended implied share price with sensitivity and scenario tables.
- “Is NVDA overvalued right now?”
- The agent will perform a relative valuation against semiconductor peers and a DCF model to compare the calculated intrinsic value against the current market price, providing a verdict.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/himself65/company-valuation/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip company-valuation.zip -d .agents/skills
Documentation by Alex Yang
Company Valuation
If your host has not already executed the shell probes below (for example, in Codex), run the commands inside the ! wrappers with its shell tool before choosing a setup path. Use the actual output; if shell access is unavailable, report that limitation.
Triangulates intrinsic value via three methods, then blends them to an implied share price:
DCF — 5-year FCFF projection, discount at WACC, terminal value.
Relative — apply peer median P/E, EV/Revenue, EV/EBITDA.
SOTP — when 2+ distinct reporting segments exist, value each at pure-play peer multiples.
Always present a WACC × terminal-growth sensitivity table and Bull/Base/Bear scenarios.
Disclaimer: Research/educational output. Not financial advice.
Step 1: Detection Flow
Detect data source and runtime deps. The skill supports 2 method paths — pick the richest one available.
Environment status:
!`python3 -c "exec('try:\n import yfinance, numpy, pandas\n print(\'YFIN_OK\')\nexcept Exception:\n print(\'YFIN_MISSING\')')"`!`python3 -c "exec('try:\n import yfinance as yf\n t=yf.Ticker(\'^TNX\')\n p=t.fast_info.last_price\n print(f\'RF_10Y={p/100:.4f}\')\nexcept Exception:\n print(\'RF_FETCH_FAIL\')')"`Decision tree:
| Condition | Method path |
|---|---|
YFIN_OK | Path A (primary): yfinance for financials + peer multiples |
YFIN_MISSING | Path B: pip-install yfinance, then Path A. python3 -m pip install -q yfinance numpy pandas |
RF_FETCH_FAIL | Use default rf = 0.045 and note stale risk-free rate in output |
If RF_10Y= printed, use that value as rf in Step 4d instead of the hardcoded 4.5%.
Step 2: Choose Methods & Set Defaults
Method applicability
| Company type | DCF | Relative | SOTP | Fallback |
|---|---|---|---|---|
| Mature cash-flow (CPG, telecom, utilities) | ✅ primary | ✅ | ❌ | — |
| High-growth SaaS / software | ✅ with care | ✅ primary | ❌ | Use EV/Revenue + Rule of 40 |
| Multi-segment conglomerate | ✅ | ✅ | ✅ primary | See references/sotp.md |
| Banks / insurance | ❌ | ✅ (P/B, P/TBV) | ❌ | DDM or excess return; note in output |
| Pre-revenue | ❌ | EV/Revenue only | ❌ | Flag low confidence |
| REITs | ❌ | ✅ (P/FFO, P/AFFO) | ❌ | NAV-based |
| Cyclicals (energy, semis, industrials) | ✅ on mid-cycle | ✅ | sometimes | Normalize through-cycle |
Defaults table
Settle every parameter before pulling data — these defaults apply unless the user overrides them.
| Parameter | Default | Rationale |
|---|---|---|
| Projection horizon | 5 years | Standard explicit forecast window |
Terminal growth g | 2.5% | ~ long-run US GDP |
Risk-free rate rf | Live 10Y UST from Step 1, else 4.5% | Current cost of capital anchor |
Equity risk premium erp | 5.5% | Damodaran mid-range |
| Beta | info['beta'] from yfinance | Market-observed levered beta |
Cost of debt kd | interest_expense / total_debt, else 5.5% | Effective rate; fallback to IG spread |
| Tax rate | 3-yr median effective rate, floored 15%, capped 30% | Strips out one-offs |
| Margin assumptions | 3-yr median of each ratio | Smooths cyclical noise |
| SBC treatment | Cash for software/SaaS; non-cash for industrials/CPG | Industry convention |
| Peer count | 4-6 | Balances signal vs noise |
| Peer multiple | Median (not mean) | Robust to outliers |
| Method weights (no SOTP) | DCF 50% / Relative 50% | Equal triangulation |
| Method weights (with SOTP) | DCF 40% / Relative 30% / SOTP 30% | SOTP gets weight when applicable |
| Sensitivity grid | WACC ±1% in 0.5% steps × g from 1.5-3.5% in 0.5% | 5×5 matrix |
See references/wacc_erp_rates.md for current risk-free rates, ERP tables, and sector WACC benchmarks.
Step 3: Pull Data
import yfinance as yf
import numpy as np
import pandas as pd
TICKER = "AAPL" # replace
t = yf.Ticker(TICKER)
info = t.info
income_a = t.income_stmt
cashflow_a = t.cashflow
balance_a = t.balance_sheet
income_q = t.quarterly_income_stmt
cashflow_q = t.quarterly_cashflow
earnings_est = t.earnings_estimate
revenue_est = t.revenue_estimate
price = info.get("currentPrice") or info.get("regularMarketPrice")
market_cap = info.get("marketCap")
shares_out = info.get("sharesOutstanding")
total_debt = info.get("totalDebt") or 0
cash = info.get("totalCash") or 0
beta = info.get("beta") or 1.0
sector = info.get("sector")
industry = info.get("industry")Key financial statement rows (yfinance labels):
| Need | Row |
|---|---|
| Revenue | Total Revenue |
| EBIT | Operating Income |
| Net income | Net Income |
| D&A | Depreciation And Amortization (in cashflow) |
| CapEx | Capital Expenditure (negative) |
| ΔNWC | Change In Working Capital (cashflow) |
| SBC | Stock Based Compensation (cashflow) |
Step 4: DCF Build
Full methodology + industry-specific tweaks in references/dcf.md. Quick skeleton:
# 4a. Revenue growth path — fade from Y1 (consensus or hist CAGR) to terminal g
rev = income_a.loc["Total Revenue"].dropna().iloc[::-1].values # yfinance columns are newest-first; reverse to oldest -> newest
hist_cagr = (rev[-1] / rev[0]) ** (1 / (len(rev)-1)) - 1
y1 = float(revenue_est.loc["+1y", "growth"]) if "+1y" in revenue_est.index else hist_cagr
g_terminal = 0.025
growth_path = np.linspace(y1, g_terminal + 0.01, 5)
# 4b. Margins — 3y median
ebit_margin = float((income_a.loc["Operating Income"] / income_a.loc["Total Revenue"]).iloc[:3].median())
da_pct = float((cashflow_a.loc["Depreciation And Amortization"] / income_a.loc["Total Revenue"]).iloc[:3].median())
capex_pct = float((cashflow_a.loc["Capital Expenditure"].abs() / income_a.loc["Total Revenue"]).iloc[:3].median())
nwc_pct = float((cashflow_a.loc["Change In Working Capital"].abs() / income_a.loc["Total Revenue"]).iloc[:3].median())
eff_tax = (income_a.loc["Tax Provision"] / income_a.loc["Pretax Income"]).iloc[:3].median()
tax_rate = float(min(0.30, max(0.15, eff_tax))) if pd.notna(eff_tax) else 0.21 # 3y median effective, floored 15%, capped 30%
# 4c. FCFF per year
rev_t = [float(income_a.loc["Total Revenue"].iloc[0])]
fcff = []
for g in growth_path:
rev_t.append(rev_t[-1] * (1 + g))
ebit = rev_t[-1] * ebit_margin
nopat = ebit * (1 - tax_rate)
fcff.append(nopat + rev_t[-1]*da_pct - rev_t[-1]*capex_pct - rev_t[-1]*nwc_pct)
# 4d. WACC
rf, erp, kd = 0.045, 0.055, 0.055 # override rf with live value from Step 1
ke = rf + beta * erp
e_v = market_cap / (market_cap + total_debt)
d_v = 1 - e_v
wacc = e_v*ke + d_v*kd*(1 - tax_rate)
# 4e. Terminal value — compute both, use midpoint
tv_gordon = fcff[-1] * (1 + g_terminal) / (wacc - g_terminal)
tv_exit = (rev_t[-1] * ebit_margin + rev_t[-1] * da_pct) * 15 # peer median EV/EBITDA
tv_base = 0.5 * (tv_gordon + tv_exit)
# 4f. Bridge to equity
pv_fcff = sum(f / (1+wacc)**(i+1) for i, f in enumerate(fcff))
pv_tv = tv_base / (1+wacc)**5
ev = pv_fcff + pv_tv
equity = ev + cash - total_debt
implied_price_dcf = equity / shares_outGates: (a) if wacc <= g_terminal → stop, g too aggressive; (b) if pv_tv / ev > 0.85 or < 0.45 → flag and show both TV methods; (c) if wacc is outside the sector sanity band in references/wacc_erp_rates.md → note.
Step 5: Relative Valuation
Select 4-6 peers. Peer map and adjustment rules in references/relative_valuation.md.
PEERS = ["MSFT", "ORCL", "CRM", "NOW", "SAP", "WDAY"] # pick by industry
multiples = {}
for p in PEERS:
pi = yf.Ticker(p).info
multiples[p] = {
"pe_fwd": pi.get("forwardPE"),
"ev_rev": pi.get("enterpriseToRevenue"),
"ev_ebitda": pi.get("enterpriseToEbitda"),
"ps": pi.get("priceToSalesTrailing12Months"),
}
med_pe = np.nanmedian([v["pe_fwd"] for v in multiples.values()])
med_ev_rev = np.nanmedian([v["ev_rev"] for v in multiples.values()])
med_ev_eb = np.nanmedian([v["ev_ebitda"] for v in multiples.values()])
eps_ttm = float(income_q.loc["Diluted EPS"].iloc[:4].sum())
rev_ttm = float(income_q.loc["Total Revenue"].iloc[:4].sum())
ebitda_ttm = float(income_q.loc["EBIT"].iloc[:4].sum()) + float(cashflow_q.loc["Depreciation And Amortization"].iloc[:4].sum())
net_debt = total_debt - cash
implied_pe = med_pe * eps_ttm
implied_ev_rev = (med_ev_rev * rev_ttm - net_debt) / shares_out
implied_ev_ebit = (med_ev_eb * ebitda_ttm - net_debt) / shares_out
implied_price_rel = np.nanmedian([implied_pe, implied_ev_rev, implied_ev_ebit])Adjust peer median ±10-30% if target's growth or margin profile diverges materially. Always state the adjustment and reason. Rule of 40 anchor for SaaS in references/relative_valuation.md.
Step 6: SOTP (multi-segment only)
Skip unless the 10-K reports 2+ operating segments with distinct economics. yfinance does NOT expose segment data — user must supply or parse from filings. Full methodology in references/sotp.md:
Identify segments + pure-play peer for each
Apply peer median EV/EBITDA (or EV/Rev for growth segments)
Subtract unallocated corporate costs (cap 2-5% of revenue if unknown)
Subtract net debt, minority interest; divide by shares
SOTP discount = (SOTP price − market price) / SOTP price. Flag if >20% (conglomerate discount).
Step 7: Triangulate, Sensitivity, Scenarios
# Blended implied price
if sotp_price is None:
blended = 0.5*implied_price_dcf + 0.5*implied_price_rel
else:
blended = 0.4*implied_price_dcf + 0.3*implied_price_rel + 0.3*sotp_price
# 5x5 sensitivity grid
wacc_grid = [wacc + dx for dx in (-0.01, -0.005, 0, 0.005, 0.01)]
g_grid = [0.015, 0.020, 0.025, 0.030, 0.035]
sens = {}
for w in wacc_grid:
for g in g_grid:
tv = fcff[-1]*(1+g)/(w-g)
pv = sum(f/(1+w)**(i+1) for i,f in enumerate(fcff)) + tv/(1+w)**5
sens[(w,g)] = (pv + cash - total_debt) / shares_outAlso produce Bull / Base / Bear: shift revenue growth ±300bps, EBIT margin ±200bps, WACC ∓100bps, terminal g 3.0% / 2.5% / 1.5%.
Step 8: Respond to the User
Present the valuation in this order:
Headline verdict — one sentence with the blended fair value, the current price, the % upside or downside, and which method is most bullish or bearish.
Snapshot — sector, industry, market cap, current price, 3M / 12M price change, LTM revenue growth.
Three-method summary — 3-column table: method | implied price | weight | brief rationale.
DCF build — assumptions table (growth path, margins, WACC components, terminal method) + 5-yr FCFF projection table + EV-to-equity bridge.
Peer comparison — table of peers with P/E fwd, EV/Rev, EV/EBITDA, gross margin, rev growth; bottom row = median; flag target's premium/discount.
SOTP (if applicable) — segment table + adjustments + equity value.
Sensitivity matrix — WACC × g grid (5×5), base case highlighted.
Scenarios — Bull / Base / Bear table with levers + implied price.
Key risks — which assumptions move the answer most, and what could break the thesis.
Error handling
| Missing / edge case | Action |
|---|---|
yfinance returns None for beta | Use sector-default beta from references/wacc_erp_rates.md |
| Negative LTM EBITDA | Skip EV/EBITDA multiple; rely on EV/Revenue + DCF |
| Negative LTM EPS | Skip P/E multiple; use forward P/E if positive, else skip |
| Growth > WACC in Gordon | Cap g = wacc − 0.5% and flag |
| Fewer than 3 years history | Use what's available; flag data confidence as "low" |
| Peer data fetch fails | Drop that peer from median; note in output |
| No segment data for SOTP | Skip Section 6; proceed with DCF + Relative only |
Caveats to include
TTM data lags real-time; peer multiples reflect market sentiment (can overshoot)
DCF is garbage-in/garbage-out; sensitivity matters more than a point estimate
yfinance data is unofficial; cross-check any decision with primary filings
Not financial advice
Reference Files
references/dcf.md— DCF methodology + industry-specific guidance (software, retail, financials, healthcare, energy, manufacturing, CPG, telecom, REITs, streaming)references/relative_valuation.md— Peer selection, multiple adjustment rules, Rule of 40, peer sets by themereferences/sotp.md— Sum-of-parts methodology, conglomerate discount detection, catalystsreferences/wacc_erp_rates.md— Risk-free rates, equity risk premiums, sector WACC benchmarks, sector-default betas
Files
- ATTRIBUTION.mdAdded by AutoGineer895 B
- LICENSELicence file added by AutoGineer1.0 KiB
- README.md2.1 KiB
- SKILL.md13.1 KiB
- references/dcf.md7.3 KiB
- references/relative_valuation.md5.5 KiB
- references/sotp.md5.5 KiB
- references/wacc_erp_rates.md6.7 KiB
references/dcf.md
DCF Methodology — Detailed Reference
Expands on the summary in SKILL.md. Use this when building the DCF build table or when the user asks for industry-specific treatment.
When DCF Is Appropriate
Good fit:
Mature companies with predictable cash flows
Companies whose revenue and margin trajectory can be estimated within a reasonable confidence band
Strategic valuations requiring intrinsic value assessment
Cross-checking a relative valuation
Poor fit:
Pre-revenue / early-stage (no cash flow history)
Banks, insurance (use DDM or excess return model)
REITs (use NAV)
Highly cyclical businesses without a clear cycle baseline — use mid-cycle earnings instead
Projection Model (5-Year Explicit Forecast)
Revenue projection
Compute historical 3–5 year CAGR.
Pull analyst consensus from
yfinance.Ticker.revenue_estimate.Consider industry growth, competitive position, and company guidance.
Project revenue for Y1–Y5, fading linearly toward terminal growth rate.
Revenue_t = Revenue_{t-1} × (1 + g_t)EBIT and Free Cash Flow Build
Revenue
- COGS → historical gross margin trend
= Gross Profit
- SG&A → historical SG&A % of revenue
- R&D → historical R&D % of revenue
- Other OpEx
= EBIT (Operating Income)
FCFF = EBIT × (1 − Tax Rate)
+ Depreciation & Amortization
+ Stock-Based Compensation ← only if treating SBC as non-cash
− Capital Expenditures
− Change in Net Working CapitalAssumption checklist (state explicitly)
| Assumption | How to derive | Typical range |
|---|---|---|
| Tax rate | Effective tax rate from historicals | 15–25% US; use statutory if unreliable |
| D&A | % of revenue or PP&E schedule | 3–8% revenue for most; 15–25% for telecom/utilities |
| CapEx | % of revenue; split maintenance vs growth if possible | 3–8% SaaS; 8–15% industrials; 15–25% telecom |
| NWC change | Days sales outstanding, DPO, days inventory | Usually 1–3% of Δrevenue |
| SBC treatment | Cash for software/SaaS, non-cash for industrials/CPG | Decide upfront and disclose |
WACC Calculation
WACC = (E/V) × Ke + (D/V) × Kd × (1 − Tax Rate)Cost of Equity (CAPM)
Ke = Risk-Free Rate + Beta × Equity Risk Premium + Size Premium (if applicable)| Component | Source | Typical range |
|---|---|---|
| Risk-free rate | 10-year US Treasury | 3.5–5.0% (use current) |
| Equity risk premium | Damodaran or Duff & Phelps | 4.5–6.0% |
| Beta | yfinance info['beta'] (levered) | 0.6–2.0 |
| Size premium | Add for small/mid-cap | 0–3% |
Cost of Debt
Preferred: interest expense / total debt from financials.
Fallback: credit rating spread over risk-free rate.
Investment-grade: 4–6%. High-yield: 7–10%.
Capital structure
Use market values:
E = market cap
D = total debt (balance sheet)
V = E + D
Terminal Value
Method 1: Perpetuity Growth (Gordon Growth)
TV = FCFF_5 × (1 + g) / (WACC − g)Terminal growth
g: 2–3% typical; must not exceed long-term GDP (~2.5% US, ~3–4% EM).TV normally represents 60–80% of total EV. Flag if outside that range.
Method 2: Exit Multiple
TV = EBITDA_5 × exit EV/EBITDA multipleUse current peer trading multiples as reference.
Apply discount for growth deceleration by Y5.
Cross-check against Gordon TV — if they diverge by >30%, reconcile assumptions.
Bridge to Equity Value
PV of FCFF = Σ FCFF_t / (1 + WACC)^t for t = 1..5
PV of TV = TV / (1 + WACC)^5
Enterprise Value = PV of FCFF + PV of TV
+ Cash & equivalents
− Total debt
− Minority interest
− Preferred stock
+ Equity investments (if material)
= Equity Value
Implied share price = Equity Value / diluted shares outstandingSensitivity & Scenarios
WACC × Terminal Growth matrix
5×5 grid. Vary WACC by ±1% in 0.5% steps and g by 0.5% from 1.5% to 3.5%. Highlight base case.
Scenario analysis
| Scenario | Levers |
|---|---|
| Bull | Higher revenue growth, margin expansion, lower WACC |
| Base | Median historicals / consensus |
| Bear | Revenue deceleration, margin compression, higher WACC |
Industry-Specific Guidance
Technology / SaaS
EV/Revenue often more meaningful than P/E if not yet profitable.
Key metrics: ARR growth, net dollar retention (NRR), Rule of 40 (growth% + FCF margin ≥ 40).
CapEx light (3–8% rev); R&D heavy (15–30%).
SBC material — decide cash vs non-cash upfront and disclose.
Terminal growth: 3–4% for category leaders, 2–3% others.
Retail / E-commerce
Revenue = same-store sales growth + new store openings (physical) OR GMV growth (digital).
Working capital matters: inventory turns, payables.
Split CapEx: maintenance (existing) vs growth (new stores/fulfillment).
Normalize for one-time charges (store closures, write-downs).
Financial Services (Banks / Insurance)
Standard DCF is wrong. Use DDM or excess return model.
If forced: project NII, provisions, non-interest income separately.
Discount rate = cost of equity only (debt is operational).
Healthcare / Pharma
Separate existing portfolio from pipeline.
Key risk: patent cliffs, FDA approval probability.
R&D: 15–25% of revenue.
Biotech: risk-adjust pipeline NPV by phase success probability.
Energy (Oil & Gas)
Revenue tied to commodity prices — use strip pricing or scenarios.
High CapEx; distinguish development vs exploration.
Depletion accounting differs from standard D&A.
Terminal value very sensitive to long-term price deck.
Manufacturing / Industrial
Cyclical — use mid-cycle earnings for normalization.
CapEx 8–15% of revenue.
Working capital swings with cycle — use through-cycle averages.
WACC 8–11% typical.
Consumer Goods (CPG)
Stable, predictable — good DCF candidates.
Distinguish organic vs M&A growth.
Watch gross margin trends, A&P spend, input costs.
Terminal growth 2–3% (population + inflation).
Telecommunications
High CapEx (15–25%) for network buildout.
Recurring revenue, low churn — good for DCF.
Spectrum costs lumpy.
WACC 7–9% for large incumbents.
Real Estate / REITs
Use NAV as primary; DCF supplementary.
Project NOI instead of FCF.
Cap rate replaces WACC at property level.
Distinguish maintenance vs growth CapEx.
Media / Streaming
Subscriber growth × ARPU drives revenue.
Content spend dominant cost — capitalize vs expense debate matters.
Path to profitability > current margin for growth-stage.
High operating leverage at scale.
Common Pitfalls
Terminal value dominance: If TV > 80% of EV, model is really a multiple-expansion bet. Disclose.
Growth > WACC: Breaks Gordon formula. Cap
gbelow WACC.Inconsistent tax rates: Historical effective rate may include one-offs. Cross-check with statutory.
Double-counting SBC: Either subtract SBC from FCFF OR use diluted shares that price it in — not both, and not neither.
Stale beta: yfinance beta may be 5-year or 3-year. For recent IPOs or post-restructuring businesses, compute fresh.
Ignoring minority interest / preferred: These are claims on EV ahead of common equity. Always subtract.
Circular WACC: WACC uses market cap → which is what we're trying to estimate. For IPOs or controversial names, iterate or use target capital structure.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Python
Security
What our scanner noticed· Low risk
- Instructions that use the network
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Alex Yang
- Publisher
- Alex Yang (Community)
- Source
- himself65/finance-skills · plugins/market-analysis/skills/company-valuation · commit a085078
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Alex Yang or Alex Yang.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download company-valuation.zip