joellewis/equities
Analyze equity securities, factor models, and equity portfolio construction. Use when the user asks about stocks, equity valuation ratios, index construction methods, or style analysis. Also trigger when users mention 'P/E ratio', 'growth vs value', 'market cap weighting', 'sector allocation', 'GICS classification', 'earnings per share', 'Fama-French factors', 'CAPM', 'dividend yield', 'PEG ratio', 'EV/EBITDA', or ask which factors explain equity returns.
npx skills add https://github.com/JoelLewis/finance_skills --skill equities
This skill is a decision procedure: which valuation metric to use for which company, which index methodology fits which mandate, and the order of operations for analyzing a stock. It assumes the user can look up definitions; the value here is choosing the right tool.
Match the metric to the sector and capital structure — using the wrong one is the most common equity-analysis error.
| Situation | Use | Avoid | Why |
|-----------|-----|-------|-----|
| Financials (banks, insurers) | P/B, P/TBV, ROE vs P/B | EV/EBITDA | Debt is raw material, not financing — EV and EBITDA are meaningless; book value is marked closer to fair value |
| Capital-intensive (industrials, telecom, energy) | EV/EBITDA, EV/EBIT | P/E alone | Neutralizes depreciation policy and leverage differences across peers |
| Mature dividend payers (utilities, staples) | Dividend yield + payout sustainability, P/E | PEG | Growth is low and stable; income and coverage matter most |
| High-growth, low/no earnings | EV/Sales, PEG (if earnings exist), unit economics | P/E, P/B | Earnings are depressed by reinvestment; book value is mostly intangibles |
| Cyclicals (autos, semis, materials) | Mid-cycle or normalized P/E, P/B at trough | Spot P/E | P/E is lowest at the cycle peak and highest at the trough — spot P/E inverts the buy/sell signal |
| Negative earnings, positive cash flow | EV/EBITDA, P/FCF | P/E, earnings yield | Ratio is undefined or misleading with negative denominator |
| REITs and listed real estate | P/FFO, P/AFFO, NAV | P/E | GAAP depreciation distorts earnings for property — handled in detail by the real-assets skill |
| Cross-border / different leverage | EV-based multiples | Equity multiples | Enterprise value normalizes for capital structure |
Cross-checks that apply everywhere:
| Mandate | Methodology | Trade-off to flag |
|---------|-------------|-------------------|
| Cheap, tax-efficient market exposure | Cap-weighted (S&P 500, total market) | Momentum-chasing by construction; concentration in mega-caps — a single sector can exceed 30% |
| Reduce concentration / small-cap tilt | Equal-weighted | Higher turnover and rebalancing cost; structural size and contrarian tilt |
| Break the price-weight link | Fundamental-weighted (revenue, earnings, book) | Effectively a value tilt with extra steps; compare cost vs an explicit value fund |
| Explicit factor exposure | Factor/style index (value, momentum, quality, low vol) | Verify the factor definition and rebalance rules; factor timing rarely works |
| Avoid | Price-weighted (DJIA-style) | Weight proportional to share price is economically arbitrary — legacy only |
Selection rules: default to cap-weighted for core beta; add equal- or fundamental-weighted only when the user explicitly wants the embedded tilt and accepts the turnover; treat any "smart beta" product as a factor portfolio and evaluate its factor loadings, not its marketing name.
| Formula | Expression | Use Case |
|---------|-----------|----------|
| EV/EBITDA | (Market Cap + Debt - Cash) / EBITDA | Capital-structure-neutral valuation |
| Earnings Yield | EPS / Price | Compare equity vs bond yields |
| PEG | (P/E) / Earnings Growth Rate (in %) | Growth-adjusted valuation |
| Gordon Growth | P = D1 / (r - g) | Dividend-based intrinsic value |
| CAPM | E(R) = R_f + beta × (E(R_m) - R_f) | Required return input for valuation |
| Total Return | Price Return + Dividend Return | Performance comparison basis |
Given: An industrial company with market cap $500M, total debt $100M, cash $50M, EBITDA $75M, EPS $7.50, price $150.
Decide and calculate:
uv run scripts/equities.py # run the demo (uses PEP 723 inline deps)
uv run scripts/equities.py --verify # check demo outputs against the worked example (exit 1 on mismatch)
python3 scripts/equities.py # alternative (requires: pip install numpy)
The demo prints valuation metrics (including the worked example's EV/EBITDA and earnings yield), a factor regression on synthetic data, and sector concentration analysis. Run --help for a list of the classes and functions. For programmatic use, import the module rather than running it — the demo only executes under python equities.py.
Take joellewis/equities from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference pip.
Without those the skill loads but fails at the first command.