Stock API
zhangxiangliang/stock-api
Fetch real-time stock quotes, K-line (candlestick) history, and search symbols for China A-shares, Hong Kong, and US markets.
Apply factor models to portfolio construction and fund evaluation, from CAPM through the Fama-French 3- and 5-factor models plus momentum.
$ npx skills add JoelLewis/finance_skills --skill factor-investing -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install JoelLewis/finance_skills factor-investing --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/wealth-management/skills/factor-investing .claude/skills/factor-investing && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "factor-investing" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/factor-investing into .claude/skills/factor-investing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "factor-investing", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/factor-investingType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add JoelLewis/finance_skills --skill factor-investing -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install JoelLewis/finance_skills factor-investing --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/wealth-management/skills/factor-investing .agents/skills/factor-investing && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "factor-investing" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/factor-investing into .agents/skills/factor-investing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "factor-investing", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add JoelLewis/finance_skills --skill factor-investing -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install JoelLewis/finance_skills factor-investing --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/wealth-management/skills/factor-investing .cursor/skills/factor-investing && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "factor-investing" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/factor-investing into .cursor/skills/factor-investing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "factor-investing", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/JoelLewis/finance_skills.git --path plugins/wealth-management/skills/factor-investing--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add JoelLewis/finance_skills --skill factor-investing -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install JoelLewis/finance_skills factor-investing --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/wealth-management/skills/factor-investing .gemini/skills/factor-investing && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "factor-investing" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/factor-investing into .gemini/skills/factor-investing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "factor-investing", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install JoelLewis/finance_skills factor-investingInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add JoelLewis/finance_skills --skill factor-investing -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/wealth-management/skills/factor-investing .github/skills/factor-investing && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "factor-investing" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/factor-investing into .github/skills/factor-investing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "factor-investing", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add JoelLewis/finance_skills --skill factor-investing -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install JoelLewis/finance_skills factor-investing --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/wealth-management/skills/factor-investing .opencode/skills/factor-investing && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "factor-investing" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/factor-investing into .opencode/skills/factor-investing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "factor-investing", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
factor-investingApply factor models to portfolio construction and fund evaluation, from CAPM through the Fama-French 3- and 5-factor models plus momentum.
Factor Investing is an agent skill from JoelLewis/finance_skills. 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…
Its SKILL.md is about 4.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/factor_investing.py`).
It sits in Business, Finance & HR, covering Stock and market analysis. The repository describes itself as: Claude Code skill plugins for financial services — 81 skills across 7 domain plugins covering investment management, compliance, advisory practice, trading, and operations. The licence is MIT.
2 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 5c498ea. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
uvpython3From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Factor Investing loads about 4.1k tokens when it runs. Until then it costs about 213 tokens; SKILL.md has 1,924 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from JoelLewis/finance_skills at commit 5c498ea, republished under its MIT licence (© JoelLewis). 1,924 words, ~4,079 tokens.
.claude/skills/factor-investing/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.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] + epsilonThe 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.
| 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 |
| RMW (profitability) | Robust minus weak operating profitability | Compensation for cash-flow risk | Underreaction to quality | ~3%/yr |
| CMA (investment) | Conservative minus aggressive asset growth | Q-theory: high investment implies low expected return | Empire-building overinvestment | ~3%/yr |
| UMD (momentum, Carhart) | Past 12-1 month winners minus losers | Crash risk (violent reversals) | Underreaction, herding | 6-7%/yr |
*Approximate annualized US long-short premia over the 1963-2024 sample, Ken French data library, as of 2026. Long-run averages, not forecasts; realized decade-long stretches deviate wildly (see cyclicality below).
The rationale matters for durability: risk-based premia should persist (someone must bear the risk); behavioral premia survive only while limits to arbitrage prevent them from being competed away — and are more vulnerable to crowding.
Run OLS of fund excess returns on the factor return series. Interpret:
Two complementary uses of the same regression:
E(R) = R_f + sum(b_k * lambda_k), where lambda_k are assumed factor premia. This tells you what the fund should earn from its exposures alone; realized excess return minus the factor-implied excess is the manager's implied alpha. If the implied alpha is near zero, the fund is a factor portfolio you could replicate with cheap factor ETFs.IR_breakeven = (fund fee - index fee) / tracking error. A closet indexer needs an implausibly high IR on a tiny active-risk budget just to earn back its fee gap (Information Ratio itself is covered in performance-metrics).Treat every smart-beta product as a factor portfolio (the equities skill's rule) and evaluate the implementation, not the marketing name:
Published premia are measured on long-short, often leverage- and shorting-unconstrained portfolios rebalanced without costs. A long-only implementable tilt:
Scale expectations accordingly: a long-only value tilt with b_HML = 0.4 against a 2.5-3% premium is worth roughly 1.0-1.35%/yr before costs, not the headline long-short number.
Every factor endures multi-year droughts: US value underperformed growth for roughly the 2017-2020 stretch, with a relative drawdown deep enough to end careers, before rebounding sharply in 2021-2022. Momentum crashes violently in sharp reversals (2009). Because droughts are long and turning points are unforecastable, factor timing — rotating into "cheap" factors — has a poor live record and adds turnover. The defensible uses of cyclicality are (a) diversifying across factors with low mutual correlation (value and momentum are natural complements) and (b) sizing tilts so the investor can survive a decade-long drought without capitulating at the bottom.
Hundreds of "significant" factors have been published — Cochrane's "factor zoo." Treat the zoo skeptically:
| Formula | Expression | Use Case |
|---|---|---|
| 3-factor model | R_i - R_f = alpha + b_MKTMKT + b_SMBSMB + b_HML*HML + eps | Baseline equity attribution |
| Carhart 4-factor | 3-factor + b_UMD*UMD | Add momentum control |
| 5-factor model | 3-factor + b_RMWRMW + b_CMACMA | Profitability and investment control |
| Expected-return decomposition | E(R) = R_f + sum(b_k * lambda_k) | Factor-implied return from loadings and premia |
| Implied alpha | realized excess mean - sum(b_k * lambda_k) | Skill after factor exposure |
| Significance rule | t = coefficient / SE; skill requires |t(alpha)| > ~2 | Separate luck from skill |
| Residual (active) vol | sigma_resid = sigma_fund * sqrt(1 - R^2) | Tracking-error decomposition |
| Breakeven IR | (fund fee - index fee) / tracking error | Closet-index fee test |
Given: 60 monthly excess returns of a US large-cap value fund regressed on MKT, SMB, HML (all in % per month):
alpha = 0.037 (t = 0.60) -> 0.037 x 12 = 0.44% per year
b_MKT = 0.98 (t = 58.1)
b_SMB = 0.12 (t = 4.6)
b_HML = 0.45 (t = 23.1)
R^2 = 0.986 (residual vol 0.457% per month)Analysis: The three factors explain 98.6% of the fund's return variance. The value loading of 0.45 is strong and highly significant (t = 23.1 >> 2) — this is a genuine, stable value tilt, typical of a long-only value fund (well below the 1.0 of the academic long-short HML portfolio). The market loading of 0.98 is ordinary full-invested equity exposure, and the small positive SMB loading shows a mild small-cap lean. Alpha is 0.44% per year with t = 0.60 < 2: statistically indistinguishable from zero.
Verdict: factor exposure, not skill. Everything this fund delivers could be replicated with a market fund plus a value-tilted index fund. Whether to own it now becomes a fee question (Example 3), not a skill question.
Given: The Example 1 loadings, assumed forward-looking premia of MKT 6.5%, SMB 2.0%, HML 3.0% per year, a risk-free rate of 4.0% (assumption as of mid-2026), and a realized fund excess return of 8.4% per year.
MKT contribution = 0.98 x 6.5% = 6.37%
SMB contribution = 0.12 x 2.0% = 0.24%
HML contribution = 0.45 x 3.0% = 1.35%
Factor-implied excess return = 6.37 + 0.24 + 1.35 = 7.96%
Total expected return = 4.0% + 7.96% = 11.96%
Implied alpha = 8.4% - 7.96% = 0.44% per yearAnalysis: Of the fund's 8.4% realized excess return, 7.96 points came from factor exposures and only 0.44 from anything unexplained — consistent with Example 1's insignificant regression alpha. Note also the implementability haircut: the fund's value tilt is worth 1.35%/yr (0.45 x 3.0%), roughly half the headline long-short HML premium, exactly as the long-only discussion above predicts.
Given: A fund with monthly volatility 4.30%, R-squared of 0.99 against its benchmark, a 0.85% expense ratio, and a 0.05% comparable index fund.
Residual vol = 4.30% x sqrt(1 - 0.99) = 4.30% x 0.10 = 0.43% per month
Tracking error = 0.43% x sqrt(12) = 1.49% annualized
Fee gap = 0.85% - 0.05% = 0.80% per year
Breakeven IR = 0.80 / 1.49 = 0.54Analysis: R-squared of 0.99 (>= 0.98) and tracking error of 1.49% (<= 2%) both trip the closet-index screen. Worse, on a 1.49% active-risk budget the manager must sustain an Information Ratio of 0.54 just to break even on fees — an IR that would rank among top-decile active managers, demanded here merely to match the index fund net of costs. Verdict: closet indexer; the rational holdings are the index fund, or a genuinely active fund whose tracking error is large enough to make its fee gap recoverable.
uv run scripts/factor_investing.py # run the demo (uses PEP 723 inline deps)
uv run scripts/factor_investing.py --verify # check outputs against the worked examples (exit 1 on mismatch)
python3 scripts/factor_investing.py # alternative (requires: pip install numpy scipy)scripts/factor_investing.py provides a FactorInvesting class with static methods multifactor_regression (K-factor OLS via numpy least squares, returning alpha, loadings, t-stats, p-values, R-squared, and residual vol), expected_return_decomposition (loadings x premia, with implied alpha), and closet_index_diagnostics (residual vol, tracking error, breakeven IR, closet-index flag). A bare run (or --verify) prints the demo on a deterministic seeded dataset and asserts the worked-example values above (Example 1 loadings/t-stats/R-squared, Example 2 decomposition, Example 3 diagnostics), exiting nonzero on any mismatch. Run --help for the method list. For programmatic use, import rather than run: from factor_investing import FactorInvesting.
© JoelLewis, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (scripts) in plugins/wealth-management/skills/factor-investing of JoelLewis/finance_skills.
Open the folder on GitHubat commit 5c498ea
Factor Investing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Factor Investing this skillJoelLewis/finance_skills | 206 | — | ~4.1k | Automated safety check: Pass | MIT | |
| Stock APIzhangxiangliang/stock-api | 2k | — | ~507 | Automated safety check: Pass | MIT | |
| Tushare Datazillionare/zillionare | 322 | 2 repos | ~2.3k | Automated safety check: Pass | None | |
| Tradingview MCPatilaahmettaner/tradingview-mcp | 5k | — | ~1.3k | Automated safety check: Pass | MIT | |
| Digital Oraclekomako-workshop/digital-oracle | 878 | — | ~5.9k | Automated safety check: Pass | MIT | |
| Longbridge Researchhelsome/folio | 271 | 3 repos | ~2.1k | Automated safety check: Pass | MIT |
zhangxiangliang/stock-api
Fetch real-time stock quotes, K-line (candlestick) history, and search symbols for China A-shares, Hong Kong, and US markets.
zillionare/zillionare
面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。
atilaahmettaner/tradingview-mcp
AI Trading Intelligence — live prices, 30+ technical indicators, backtesting (6 strategies), walk-forward overfitting detection, trade logs, equity curves, licensed news sentiment (Marketaux), and…
komako-workshop/digital-oracle
Answer prediction questions using market trading data, not opinions.
helsome/folio
Institution ratings, consensus price targets, EPS/revenue forecasts, finance calendar, shareholder data, fund holders, insider trades (SEC Form 4), short interest, industry rankings, peer group…
helsome/folio
Earnings analysis — pre- and post-earnings. An agent skill from helsome/folio.
JoelLewis/finance_skills
Determine how to distribute capital across asset classes using strategic and tactical allocation frameworks.
JoelLewis/finance_skills
Determine how much capital to allocate to individual positions within a portfolio.
JoelLewis/finance_skills
Analyze commodity markets including futures curve dynamics, roll yield, and supply/demand fundamentals.
JoelLewis/finance_skills
Analyze currency markets, exchange rate mechanics, and FX risk management for international portfolios.
JoelLewis/finance_skills
Provide frameworks for managing and paying off personal debt effectively.
JoelLewis/finance_skills
Build diversified portfolios using correlation analysis, efficient frontier construction, and factor-based diversification.
Categories
Apply factor models to portfolio construction and fund evaluation, from CAPM through the Fama-French 3- and 5-factor models plus momentum. Factor Investing is an agent skill from JoelLewis/finance_skills. Apply factor models to portfolio construction and fund evaluation, from CAPM through the Fama-French 3- and 5-factor models plus momentum.
Factor Investing fits situations like: the user asks about Fama-French; momentum exposure; interpret a factor regression (loadings; alpha after controlling for factors.
Run `npx skills add JoelLewis/finance_skills --skill factor-investing -a claude-code`. Or copy the skill folder (plugins/wealth-management/skills/factor-investing in JoelLewis/finance_skills) into .claude/skills/factor-investing in your project. Claude Code loads it when a task matches its description.
Run `npx skills add JoelLewis/finance_skills --skill factor-investing -a codex`. Or copy the skill folder (plugins/wealth-management/skills/factor-investing in JoelLewis/finance_skills) into .agents/skills/factor-investing in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add JoelLewis/finance_skills --skill factor-investing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/factor-investing, .gemini/skills/factor-investing, .github/skills/factor-investing and .opencode/skills/factor-investing in your project.
Going by SKILL.md and its folder, Factor Investing needs Python for the scripts in its folder and the command-line tools its instructions call (uv and python3). Our summary lists: Python 3.
SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Factor Investing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.1k tokens (SKILL.md is roughly 16k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Factor Investing: Stock API (zhangxiangliang/stock-api, 2k stars), Tushare Data (zillionare/zillionare, 322 stars), Tradingview MCP (atilaahmettaner/tradingview-mcp, 5k stars) and Digital Oracle (komako-workshop/digital-oracle, 878 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
JoelLewis (a GitHub user) maintains it in JoelLewis/finance_skills, which has 206 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on July 18, 2026.
Source: JoelLewis/finance_skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.