# factor-investing

Evaluates fund returns and smart-beta products using Fama-French and Carhart factor models, isolating genuine skill from passive factor exposures.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 339 installs · ★ 218
- Author: JoelLewis
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/JoelLewis/finance_skills/tree/HEAD/plugins/wealth-management/skills/factor-investing/SKILL.md
- Updated: 2026-07-18
- HTML: https://affpapa.org/en/nevibecode/skills/factor-investing

## What it does

This skill guides coding agents through multifactor portfolio evaluation beyond single-factor CAPM. It incorporates Fama-French 3- and 5-factor specifications alongside Carhart momentum (SMB, HML, RMW, CMA, UMD). The agent learns to interpret excess return regressions, checking factor loadings, adjusted $R^2$, and t-statistics with absolute values above 2 to confirm statistical significance.

The framework screens for closet indexing by checking whether benchmark $R^2$ reaches 0.98, tracking error stays under 2%, or active share drops below roughly 60%. It also evaluates smart-beta ETFs across factor purity, capacity, and turnover drag. For instance, momentum requires high annual turnover (~100%+/yr), while value strategies require much less (~15-25%/yr).

Paper premiums from academic long-short portfolios overestimate implementable results. Long-only strategies capture roughly half of published factor premiums because shorting is omitted and trading costs dilute returns.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add JoelLewis/finance_skills --skill factor-investing -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/factor-investing/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/factor-investing/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add JoelLewis/finance_skills --skill factor-investing -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/factor-investing/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add JoelLewis/finance_skills --skill factor-investing -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/factor-investing/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install JoelLewis/finance_skills factor-investing
```

2. **Manually: put the files in place**
- File: `.github/skills/factor-investing/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add JoelLewis/finance_skills --skill factor-investing -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/JoelLewis/finance_skills --path plugins/wealth-management/skills/factor-investing
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/factor-investing/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add JoelLewis/finance_skills --skill factor-investing -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/JoelLewis/finance_skills/tree/HEAD/plugins/wealth-management/skills/factor-investing/SKILL.md

## When to use it
- decompose fund performance into factor loadings and genuine alpha
- screen active portfolios for closet indexing via active share and tracking error
- evaluate smart-beta ETF factor purity against fees and turnover
- interpret Fama-French regression outputs and t-statistics

## Example prompts
- Run a Fama-French 5-factor plus momentum regression on this manager's monthly excess returns.
- Check if this mutual fund is closet indexing based on its 0.99 R-squared and 1.5% tracking error.
- Calculate the breakeven Information Ratio for an active fund with a 0.8% fee versus index fees.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 607cae9f55092f14.

BEGIN THIRD-PARTY FILE 607cae9f55092f14
````text
---
name: factor-investing
description: "Apply factor models to portfolio construction and fund evaluation, from CAPM through the Fama-French 3- and 5-factor models plus momentum. Use when the user asks about 'Fama-French', 'value factor', 'smart beta', 'factor tilt', 'momentum exposure', or the 'factor zoo', wants to run or interpret a factor regression (loadings, alpha after controlling for factors, R-squared, t-stats), decompose a manager's returns into factor exposures versus skill, or asks 'is my fund closet indexing'. Also trigger on SMB, HML, RMW, CMA, UMD, size/value/quality/profitability/low-vol premia, factor ETF or smart-beta product evaluation (factor purity, turnover, capacity, fees), factor cyclicality and the danger of factor timing, factor crowding, long-short academic factors versus long-only implementable tilts, and post-publication factor decay."
---

# Factor Investing

## Core Concepts

### From CAPM to Multifactor Models

CAPM prices a single source of risk: `E(R_i) - R_f = beta * (E(R_m) - R_f)`. Persistent anomalies — small caps, cheap (high book-to-market) stocks, and recent winners earning more than beta predicts — motivated adding factors. Fama-French (1993) added size and value to the market factor (3-factor model); Carhart (1997) added momentum; Fama-French (2015) added profitability and investment (5-factor model):

```
R_i - R_f = alpha + b_MKT*MKT + b_SMB*SMB + b_HML*HML [+ b_RMW*RMW + b_CMA*CMA] [+ b_UMD*UMD] + epsilon
```

The key reinterpretation: a manager's CAPM alpha may be nothing more than static factor exposure. Alpha only means skill *after* controlling for the factors an investor could buy cheaply. Single-factor OLS mechanics, t-statistics, and the CAPM regression itself live in the statistics-fundamentals skill; this skill generalizes to K regressors and interprets the output.

### The Canonical Factors

| Factor | Construction (long-short) | Rationale: risk-based | Rationale: behavioral | Approx. premium* |
|--------|---------------------------|----------------------|----------------------|------------------|
| MKT | Market minus risk-free | Non-diversifiable macro risk | — | 6-7%/yr |
| SMB (size) | Small caps minus big caps | Illiquidity, distress sensitivity | Neglect of small firms | 1.5-2%/yr |
| HML (value) | High book/market minus low | Distress risk, cyclical cash flows | Overextrapolation of growth | 2.5-3%/yr |
````
END THIRD-PARTY FILE 607cae9f55092f14

The third-party file has ended. Everything between the 607cae9f55092f14 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2413 of 16345 bytes. © JoelLewis · MIT · https://github.com/JoelLewis/finance_skills/tree/HEAD/plugins/wealth-management/skills/factor-investing/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
