a-share-factor-validation

a-share-factor-validation is a skill for Claude Code from cyijun/china-financial-services. It costs 68 tokens per session (986 once invoked), scanned A, original, Apache-2.0.

A research checklist and toolkit for testing stock-selection factors and backtests in China's A-share market, the mainland Chinese stock market. It checks whether results avoid future-data leakage and account for trading rules, costs, and statistical uncertainty.

In plain words
What is it for?
Use it to register hypotheses, prepare point-in-time data, run out-of-sample and cost-aware tests, examine robustness across market conditions, and label the strength of the evidence.
Why use it?
It helps separate a genuinely testable result from a backtest that looks good only because it used unavailable data, ignored trading limits, or tried many variations.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the china-market-researcher plugin — 17 skills, 1 agent shipped together

Good fit Use it to register hypotheses, prepare point-in-time data, run out-of-sample and cost-aware tests, examine robustness across market conditions, and label the strength of the evidence.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cyijun/china-financial-services/a-share-factor-validation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cyijun/china-financial-services --skill a-share-factor-validation
Clone the repo
git clone --depth 1 https://github.com/cyijun/china-financial-services

Made for: Claude Code.

Or install china-market-researcher, the plugin that ships this one along with the rest of its 17 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for a-share-factor-validation

README.md
[![agentmods](https://agentmods.dev/badge/skills/cyijun/china-financial-services/a-share-factor-validation/github.svg)](https://agentmods.dev/skills/cyijun/china-financial-services/a-share-factor-validation)
Your own site
<a href="https://agentmods.dev/skills/cyijun/china-financial-services/a-share-factor-validation"><img src="https://agentmods.dev/badge/skills/cyijun/china-financial-services/a-share-factor-validation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for a-share-factor-validation

Your own site · 80×15
<a href="https://agentmods.dev/skills/cyijun/china-financial-services/a-share-factor-validation"><img src="https://agentmods.dev/badge/skills/cyijun/china-financial-services/a-share-factor-validation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 986 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.00986
Opus 5 $0.00034 $0.00493
Sonnet 5 $0.00014 $0.00197
Haiku 4.5 $0.00007 $0.00099

Measured 11d ago against content hash f63f80c1ce81, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

a-share-factor-validation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/factor_registry.py, scripts/factor_validation.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/china-market-researcher/skills/a-share-factor-validation/SKILL.md · 44 lines

What it actually says

A股因子与回测验证

工作流

  1. 预注册因子公式、经济机制、方向、持有期、股票池、基准、再平衡和主要指标,区分探索性与验证性研究。
  2. 使用china-market-data建立严格PIT数据契约:原始价、复权因子、财务公告日、历史行业/指数成员、ST/退市/停牌状态。AKShare当前快照不得替代历史股票池。
  3. 画清信号、决策和成交时间线;收盘信号不得假设同收盘成交,并处理T+1、涨跌停、停牌和不可成交。
  4. 划分开发、验证和最终测试,或执行滚动样本外;最终测试集不能参与参数选择。
  5. 建立佣金、印花税、过户/经手费、点差、冲击、滑点、换手和容量模型。
  6. 报告IC分布、分组单调性、覆盖率、换手、行业/市值暴露、相对基准、真实交易笔数、交易胜率及区间、回撤和尾部风险。
  7. 记录测试数量、相关因子、参数搜索和选择过程,处理多重检验。
  8. 做子期间、行业、市值、市场状态、参数邻域、延迟、成本、极端点、替代数据源和时序保留重采样。
  9. 给出invalidatedinconclusiveresearch candidateout-of-sample supportedproduction unverified状态。

可执行研究链

预注册 → 数据快照 → 代码提交 → 运行 → 结果登记 → 样本外复核 → 衰减监控推进,不允许只保存最终图表:

  1. 先用scripts/factor_registry.py登记假设、因子族、数据SHA-256、代码Git SHA、样本边界和初始状态。
  2. 将PIT清洗后的长表导出为CSV,至少包含date,ts_code,factor,forward_returnforward_return必须从信号后首个允许成交时点开始,可选tradable显式排除当时停牌或不可成交样本。
  3. 运行scripts/factor_validation.py input.csv --cost-bps <成本> --output report.json。脚本执行逐日截面Spearman IC、块自助区间、分组多空、真实换仓事件和成本后结果;库函数另提供purged walk-forward、BH-FDR、CSCV-PBO与未来数据扰动检查。
  4. 结果连同数据快照、参数搜索清单、失败实验和运行环境回写注册表。未经独立最终样本和真实数据链验收,状态最多为research_candidateproduction_unverified
  5. 上线后监控覆盖率、IC分布、换手、容量、因子暴露和结构断点;衰减监控是新实验,不得事后改变原预注册门槛。

硬约束

  • 不用固定IC、IR、Sharpe、回撤或胜率阈值单独宣告有效。
  • 胜率和交易数来自完整开平仓,不用盈利日数量代替。
  • IID随机重排不能冒充完整稳健性检验。
  • 未运行的测试不得写成通过;Mock通过不等于真实Tushare链可用。
  • 不宣称实盘收益,不下单。
  • 脚本不替调用者推断涨跌停、停牌或T+1;这些字段必须由PIT数据链先构造,缺失时不能声称完成可交易回测。

输出契约

输出研究问题、数据契约、时点图、样本划分、成本、主要结果、稳健性、多重检验、偏差清单、状态和生产验证缺口。

需要详细闸门时读取references/validation-gates.md

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 44 lines · 68 tokens per session scan A f63f80c1ce81

Subscribe to this mod's changes

a-share-factor-validation is a skill published in the GitHub repository cyijun/china-financial-services (19 stars, last pushed 17d ago), licensed Apache-2.0. It adds 68 tokens to every session and 986 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.