Agent skill

A Share Factor Analysis

by aifinlab in aifinlab/FinClaw

A股单因子研究/IC检验。当用户说"因子分析"、"单因子"、"IC"、"IR"、"因子检验"、"factor analysis"、"因子有效性"、"XX因子表现怎么样"、"因子IC"、"因子收益"、"因子衰减"、"quintile分析"时触发。基于 cn-stock-data 获取股票池行情与财务数据,通过 factoranalyzer.py 计算…

Apache-2.0Auto-check passedBusiness, Finance & HR

Install A Share Factor Analysis

skills CLI
$ npx skills add aifinlab/FinClaw --skill a-share-factor-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aifinlab/FinClaw a-share-factor-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aifinlab/FinClaw.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/a-share-factor-analysis .claude/skills/a-share-factor-analysis && rm -rf skills-src

Use ~/.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/

Facts

Skill name
a-share-factor-analysis
GitHub stars
254
Token cost
~551 tokens
SKILL.md length
144 words
Files
3 (incl. scripts, references)
Skills in repo
74
Repo updated
First seen
Licence
Apache-2.0

At a glance

A股单因子研究/IC检验。当用户说"因子分析"、"单因子"、"IC"、"IR"、"因子检验"、"factor analysis"、"因子有效性"、"XX因子表现怎么样"、"因子IC"、"因子收益"、"因子衰减"、"quintile分析"时触发。基于 cn-stock-data 获取股票池行情与财务数据,通过 factoranalyzer.py 计算…

  • Works in 5 steps: 确定研究范围 → 数据获取与因子构建 → 运行因子分析 → …
  • Tasks that involve Financial analysis
  • SKILL.md covers 数据源, Workflow, 风格说明 and 关键规则
  • Runs Python scripts from its folder; calls python

What it does

A Share Factor Analysis is an agent skill from aifinlab/FinClaw. A股单因子研究/IC检验。当用户说"因子分析"、"单因子"、"IC"、"IR"、"因子检验"、"factor analysis"、"因子有效性"、"XX因子表现怎么样"、"因子IC"、"因子收益"、"因子衰减"、"quintile分析"时触发。基于 cn-stock-data 获取股票池行情与财务数据,通过 factoranalyzer.py 计算 IC/IR、分位组合收益、因子换手率等量化指标。支持专业因子研究报告风格(formal)和快速因子检验风格(brief)。不适用于多因子组合优化(需自建模型)或个股基本面分析(用 a-share-earnings-analysis)。

Its SKILL.md is about 550 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts and reference files (for example `references/factor-analysis-guide.md` and `scripts/factor_analyzer.py`).

It sits in Business, Finance & HR, covering Financial analysis. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Financial analysis

Example prompts

  • “factor analysis”
  • “XX因子表现怎么样”
  • “quintile分析”
  • “/a-share-factor-analysis”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. 确定研究范围
  2. 数据获取与因子构建
  3. 运行因子分析
  4. 结果解读
  5. 输出

What it can do on your machine

Read from SKILL.md and the folder at commit 9e62862. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

A Share Factor Analysis loads about 551 tokens when it runs, and up to ~1.4k if it reads all its reference files. Until then it costs about 80 tokens; SKILL.md has 144 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~80
When it runs · the whole SKILL.md, loaded when a task matches
~551
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.4k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from aifinlab/FinClaw at commit 9e62862, republished under its Apache-2.0 licence (© aifinlab). 144 words, ~551 tokens.

Download SKILL.mdSave it as .claude/skills/a-share-factor-analysis/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
a-share-factor-analysis
description
A股单因子研究/IC检验。当用户说"因子分析"、"单因子"、"IC"、"IR"、"因子检验"、"factor analysis"、"因子有效性"、"XX因子表现怎么样"、"因子IC"、"因子收益"、"因子衰减"、"quintile分析"时触发。基于 cn-stock-data 获取股票池行情与财务数据,通过 factor_analyzer.py 计算 IC/IR、分位组合收益、因子换手率等量化指标。支持专业因子研究报告风格(formal)和快速因子检验风格(brief)。不适用于多因子组合优化(需自建模型)或个股基本面分析(用 a-share-earnings-analysis)。

A 股单因子研究 / IC 检验

数据源

bash
SCRIPTS="$SKILLS_ROOT/cn-stock-data/scripts"
ANALYZER="$SKILLS_ROOT/a-share-factor-analysis/scripts/factor_analyzer.py"

# 获取股票池行情(如沪深300成分股)
python "$SCRIPTS/cn_stock_data.py" kline --code [CODE1],[CODE2],... --freq daily --start [回测起始日期]

# 获取财务指标(PE/PB/ROE 等因子原始值)
python "$SCRIPTS/cn_stock_data.py" finance --code [CODE1],[CODE2],...

# 获取实时行情(市值、PE、PB)
python "$SCRIPTS/cn_stock_data.py" quote --code [CODE1],[CODE2],...

# 运行因子分析
python "$ANALYZER" --factor [FACTOR] --period [N] --data [input.json]

Workflow

Step 1: 确定研究范围
  1. 明确因子名称(PE/PB/ROE/动量/波动率/换手率等)
  2. 确定股票池(沪深300/中证500/全A等,默认沪深300)
  3. 确定回测区间(默认近3年)和调仓周期(默认20个交易日)
Step 2: 数据获取与因子构建
  1. 获取股票池所有成分股的日线 kline 数据
  2. 获取 finance/quote 数据构建因子截面值
  3. 整理为 factor_analyzer.py 所需的 JSON 格式(参见 references/factor-analysis-guide.md)
Step 3: 运行因子分析

调用 factor_analyzer.py 计算:

  • IC 序列:每期因子值与下期收益的 Rank IC(Spearman 相关系数)
  • IR:IC 均值 / IC 标准差,衡量因子稳定性
  • 分位组合:按因子值分5组,比较各组平均收益
  • 因子换手率:相邻两期 Top/Bottom 组合的持仓变化比例
  • 因子衰减:不同持仓周期下 IC 的衰减速度
Step 4: 结果解读

参见 references/factor-analysis-guide.md 的解读标准:

  • IC 均值 > 0.03 且 IR > 0.5 → 因子有效
  • 分位组合单调性 → 因子区分度
  • 换手率过高 → 实际可执行性存疑
Step 5: 输出

风格说明

维度formal(专业因子研究报告)brief(快速因子检验)
篇幅2-4 页半页
IC 分析IC 序列图描述 + 分布统计 + 显著性检验IC 均值 + IR 一行结论
分位分析五分位组合收益表 + 多空收益曲线描述Top-Bottom 收益差
因子衰减多周期 IC 衰减表最优持仓周期
换手率月度换手率序列平均换手率
结论因子有效性评级 + 使用建议 + 局限性有效/无效 + 一句话建议
免责声明需要(历史回测不代表未来表现)不需要

关键规则

  1. Rank IC 优先于 Pearson IC:A 股因子值分布偏态严重,必须用 Spearman 秩相关
  2. 去极值与中性化:分析前对因子值做 MAD 去极值,formal 模式需做市值/行业中性化
  3. 存活偏差:说明是否剔除退市股,ST 股必须剔除
  4. 交易成本:分位组合收益需说明是否扣除交易成本(双边千三估算)
  5. 数据来源标注:标明因子原始数据来自 cn-stock-data 的哪个接口
  6. A 股特色因子:关注涨跌停、ST、壳价值等 A 股特有因素对因子的影响

© aifinlab, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts, references) in skills/a-share-factor-analysis of aifinlab/FinClaw.

  • SKILL.md
  • references/factor-analysis-guide.md
  • scripts/factor_analyzer.py

Open the folder on GitHubat commit 9e62862

Compare with similar skills

A Share Factor Analysis 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.

A Share Factor Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
A Share Factor Analysis this skillaifinlab/FinClaw254—~551Automated safety check: PassApache-2.0
Financial Analyzinghuangjia2019/claude-code-engineering1.1k1 repos~474Automated safety check: PassNone
Longbridge Earningshelsome/folio2691 repos~2.5kAutomated safety check: PassNone
Fundamentalsstaskh/trading_skills3741 repos~836Automated safety check: PassMIT
Earnings AnalysisWind-Alice/AliceMarket1303 repos~2.2kAutomated safety check: PassNone
Buy Side Equity Research Memohaskaomni/serenity-skill632—~3.8kAutomated safety check: PassMIT

Similar skills

  • Financial Analyzing

    huangjia2019/claude-code-engineering

    Analyze financial data, calculate financial ratios, and generate analysis reports.

    1.1k GitHub starsUsed in 1 repo~474 tokens
    Business, Finance & HRAuto-check passed
  • Longbridge Earnings

    helsome/folio

    Earnings analysis — pre- and post-earnings. An agent skill from helsome/folio.

    269 GitHub starsUsed in 1 repo~2.5k tokens
    Business, Finance & HRAuto-check passed
  • Fundamentals

    staskh/trading_skills

    Get fundamental financial data including financials, earnings, and key metrics.

    374 GitHub starsUsed in 1 repo~836 tokens
    Business, Finance & HRAuto-check passed
  • Earnings Analysis

    Wind-Alice/AliceMarket

    Create professional equity research earnings update reports (8-12 pages, 3,000-5,000 words) analyzing quarterly results for companies already under coverage.

    130 GitHub starsUsed in 3 repos~2.2k tokens
    Business, Finance & HRAuto-check passed
  • Buy Side Equity Research Memo

    haskaomni/serenity-skill

    Generate source-backed buy-side equity research memos from a ticker, starting with investment view, target-price scenarios, SEC and IR-backed financial statement analysis, industry chain…

    632 GitHub stars~3.8k tokensUpdated 2 mo ago
    Business, Finance & HRAuto-check passed
  • ERPClaw ERP Controller

    avansaber/erpclaw

    Operates the ERPClaw self-hosted ERP in plain language: accounting, invoicing, inventory, purchasing, tax, HR, payroll and reports, treating the ERP as the single source of truth.

    114 GitHub stars~15k tokensUpdated 2 days ago
    Business, Finance & HRAuto-check passed

More from aifinlab/FinClaw

All 74 skills in this repo
  • Bank Corporate Credit Dd

    aifinlab/FinClaw

    A skill your agent uses when the user asks for help with corporate credit due diligence, enterprise credit investigation, pre-loan review, borrower analysis, document collection, management…

    254 GitHub stars~952 tokensUpdated 4 mo ago
    Auto-check passed
  • A skill your agent uses when you need a bank corporate-risk monitoring assistant for enterprise litigation/penalty/enforcement scanning (处罚/诉讼/被执行/失信等).

    254 GitHub stars~751 tokensUpdated 4 mo ago
    Auto-check passed
  • A skill your agent uses when you need a bank corporate client operating-volatility monitoring assistant (经营监测/指标波动/预警解释).

    254 GitHub stars~605 tokensUpdated 4 mo ago
    Auto-check passed
  • A skill your agent uses when you need a bank post-loan visit follow-up assistant to turn visit notes/materials into a structured memo (摘要/关键更新/风险观察/用途核验/行动项).

    254 GitHub stars~544 tokensUpdated 4 mo ago
    Auto-check passed
  • A skill your agent uses when you need a bank corporate credit issue-list assistant (问题清单/补件清单/催办台账).

    254 GitHub stars~487 tokensUpdated 4 mo ago
    Auto-check passed
  • A skill your agent uses when you need a bank corporate credit approval-opinion drafting assistant (审批意见/条款建议/有条件同意).

    254 GitHub stars~549 tokensUpdated 4 mo ago
    Auto-check passed

Questions about A Share Factor Analysis

What does A Share Factor Analysis do?

A股单因子研究/IC检验。当用户说"因子分析"、"单因子"、"IC"、"IR"、"因子检验"、"factor analysis"、"因子有效性"、"XX因子表现怎么样"、"因子IC"、"因子收益"、"因子衰减"、"quintile分析"时触发。基于 cn-stock-data 获取股票池行情与财务数据,通过 factoranalyzer.py 计算…. A Share Factor Analysis is an agent skill from aifinlab/FinClaw.

When should I use A Share Factor Analysis?

A Share Factor Analysis fits situations like: tasks that involve Financial analysis.

How do I install A Share Factor Analysis in Claude Code?

Run `npx skills add aifinlab/FinClaw --skill a-share-factor-analysis -a claude-code`. Or copy the skill folder (skills/a-share-factor-analysis in aifinlab/FinClaw) into .claude/skills/a-share-factor-analysis in your project. Claude Code loads it when a task matches its description.

How do I install A Share Factor Analysis in Codex?

Run `npx skills add aifinlab/FinClaw --skill a-share-factor-analysis -a codex`. Or copy the skill folder (skills/a-share-factor-analysis in aifinlab/FinClaw) into .agents/skills/a-share-factor-analysis in your project. Codex loads it when a task matches its description.

Can I use A Share Factor Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aifinlab/FinClaw --skill a-share-factor-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/a-share-factor-analysis, .gemini/skills/a-share-factor-analysis, .github/skills/a-share-factor-analysis and .opencode/skills/a-share-factor-analysis in your project.

What does A Share Factor Analysis need to run?

Going by SKILL.md and its folder, A Share Factor Analysis needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does A Share Factor Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is A Share Factor Analysis safe to install?

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.

What licence does A Share Factor Analysis use?

A Share Factor Analysis is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does A Share Factor Analysis use?

About 551 tokens (SKILL.md is roughly 2.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 867 tokens, read only when the agent opens those files.

What are the alternatives to A Share Factor Analysis?

Skills that share tags, products or a category with A Share Factor Analysis: Financial Analyzing (huangjia2019/claude-code-engineering, 1.1k stars), Longbridge Earnings (helsome/folio, 269 stars), Fundamentals (staskh/trading_skills, 374 stars) and Earnings Analysis (Wind-Alice/AliceMarket, 130 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains A Share Factor Analysis?

aifinlab (a GitHub user) maintains it in aifinlab/FinClaw, which has 254 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on May 13, 2026.

Source: aifinlab/FinClaw on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.