开源 · MIT · Agent Skills 标准 Open source · MIT · Agent Skills standard

给你的 AI
装上 QMT 量化技能
Give your AI
quant skills for QMT

把量化策略开发的领域知识——研报解读、因子回测、信号生成——封装成标准技能。丢一句话给 AI 就能安装,Claude Code、Cursor、Codex 等 70+ AI 编程工具直接可用。 Quant strategy know-how — research-report parsing, factor backtesting, signal generation — packaged as standard skills. Install by sending your AI one sentence; works in Claude Code, Cursor, Codex and 70+ AI coding tools.

GitHub 仓库 GitHub repo 把这句话发给 Claude Code、Cursor 等任意 AI 工具,它会自己下载技能并放到正确目录。Send this sentence to Claude Code, Cursor or any AI tool — it downloads the skills and puts them in the right place by itself.
70+
兼容 AI 工具Compatible tools
5
种安装方式Install methods
MIT
开源许可License
Claude Code × xtquantai
这份研报的上下影线因子,帮我生成中证1000、Top 10 持仓、5 日调仓的 QMT 回测脚本 Take the shadow-line factor from this report and generate a QMT backtest: CSI 1000, top-10 holdings, 5-day rebalance
qmt-inner-backtest
因子Factor上下影线(东吴)Shadow lines
股票池Universe中证1000CSI 1000
调仓RebalanceTop 10 · 5d
已解读因子逻辑,规格表如上,请确认。确认后我基于母版生成完整回测脚本,信号统一 shift(1),T+1 开盘调仓。 Factor logic parsed — spec table above, please confirm. I'll then generate the full backtest script from the master template, signals shifted by one day, trading at next open.
Skills

从研报到回测脚本,一个技能搞定 From research report to backtest script, one skill

技能列表由社区需求驱动、持续生长,全部按 Agent Skills 开放标准在 CI 中自动校验。 The skill list is community-driven and keeps growing — every skill is automatically validated in CI against the open Agent Skills standard.

可用Available

QMT 内置因子回测QMT built-in factor backtest

qmt-inner-backtest

根据策略描述、研报 PDF 或截图解读因子逻辑,基于母版脚本生成 QMT 策略编辑器内置的日频截面因子回测策略。 Parses factor logic from strategy descriptions, research-report PDFs or screenshots, then generates a daily cross-sectional factor backtest for the QMT strategy editor from a battle-tested master template.

  • 研报 PDF / 截图 / 文字都能解读成因子公式与组合规则Report PDFs, screenshots or plain text are parsed into factor formulas and portfolio rules
  • 先输出策略规格表供你确认,缺省参数标注假设、不静默编造Outputs a strategy spec table for your confirmation first — missing parameters are flagged, never silently invented
  • after_init 预计算信号 → handlebar 调仓执行,交易执行函数原样保留Signals precomputed in after_init, rebalancing executed in handlebar — trade-execution code stays untouched
  • Barra 风格因子处理(MAD 去极值、市值/行业中性化),信号强制 shift(1) 防未来函数Barra-style factor pipeline (MAD winsorizing, cap/industry neutralization) with mandatory shift(1) to prevent look-ahead bias
01
丢给它研报或想法Feed it a report or an idea
PDF · 截图 · 一句话描述PDF · screenshot · one sentence
02
解读因子逻辑Factor logic parsed
公式、窗口、中性化、组合规则Formula, windows, neutralization, portfolio rules
03
策略规格表 · 你来确认Spec table · you confirm
股票池、持仓数、调仓频率、因子方向Universe, holdings, rebalance cadence, factor direction
04
生成完整回测脚本Full backtest script generated
基于母版只改必要部分Only the necessary parts of the template change
05
去 QMT 编译回测Compile & backtest in QMT
附手动核对配置清单Comes with a manual config checklist
工作原理How it works

技能即文件,装进哪个 AI 都能用 Skills are just files — they work in any AI tool

每个技能是一个含 SKILL.md 与母版脚本的文件夹,遵循开放的 Agent Skills 标准。没有服务进程、没有额外依赖。 Each skill is a folder with a SKILL.md and master scripts, following the open Agent Skills standard. No server process, no extra dependencies.

You
研报 / 想法Report / idea
PDF、截图或一句话描述A PDF, a screenshot or one sentence
Agent
AI 编程工具AI coding tool
Claude Code · Cursor · Codex · 70+
Skill
xtquantai
SKILL.md + 回测母版脚本SKILL.md + backtest master template
QMT
策略编辑器Strategy editor
编译 · 回测 · 查看收益曲线Compile · backtest · review the equity curve
技能即文件夹Skills are folders 开放标准、纯文件分发,复制即安装。跨工具通用目录是 .agents/skills/。 Open standard, distributed as plain files — copying is installing. The cross-tool directory is .agents/skills/.
只生成,不代操作Generates, never operates 技能只产出脚本和配置清单;编译、回测由你在 QMT 中完成,账户始终在你手里。 The skill only produces scripts and config checklists; you compile and backtest in QMT — your account stays in your hands.
CI 标准校验CI-validated 所有技能在 CI 中按 agentskills.io 标准自动校验,维护流程公开在维护手册。 Every skill is auto-validated in CI against the agentskills.io spec; the maintenance playbook is public.
一键安装Install

丢给 AI 一句话,它自己装好 One sentence to your AI — it installs itself

让 AI 自己装(推荐)Let your AI install it (recommended)

仓库内置了一份写给 AI 看的 INSTALL.md。把右边这句话发给你的 AI 工具,它会自己克隆仓库、识别自己是哪个工具、把技能复制到正确目录并验证——全程不需要你动手。 The repo ships an INSTALL.md written for AIs. Send the sentence on the right to your AI tool and it clones the repo, figures out which tool it is, copies the skills to the right directory and verifies them — no manual steps.

Claude Code Cursor Codex Gemini CLI Kimi Code + 65
对你的 AI 说Say to your AI
读取 https://raw.githubusercontent.com/dfkai/xtquantai/master/INSTALL.md 并按其中说明安装技能。Read https://raw.githubusercontent.com/dfkai/xtquantai/master/INSTALL.md and install the skills as instructed.

npx skills

习惯命令行的话,一条命令交互式选择要安装到的工具,覆盖 70+ AI 编程工具。加 --skill 只装某个技能,加 -g 装到全局目录。Prefer the command line? One command interactively picks the target tool, covering 70+ AI coding tools. Add --skill for a single skill, -g for the global directory.

shell
# 交互式选择要安装到的工具
npx skills add dfkai/xtquantai

# 只装某个技能
npx skills add dfkai/xtquantai --skill qmt-inner-backtest

# 装到全局目录(所有项目可用)
npx skills add dfkai/xtquantai -g

Claude Code 原生插件Native Claude Code plugin

通过 Claude Code 的插件市场安装,两条斜杠命令完成。Install through Claude Code's plugin marketplace with two slash commands.

Claude Code
/plugin marketplace add dfkai/xtquantai
/plugin install qmt-skills@xtquantai

Kimi Code CLI

Kimi Code 用户一条命令直接装。Kimi Code users install with a single command.

Kimi Code
/plugins install https://github.com/dfkai/xtquantai

手动复制Manual copy

把 skills/ 下的技能文件夹整个复制到所用工具的技能目录(必须包含 SKILL.md 和 scripts/,目录名不变)。Copy the whole skill folder from skills/ into your tool's skills directory (keep SKILL.md, scripts/ and the folder name intact).

Claude Code.claude/skills/
Cursor (≥2.4).cursor/skills/
Codex CLI.agents/skills/
通用 / 其他工具Universal / others.agents/skills/

全部 12+ 工具的目录对照表见 GitHub README。The full directory table for 12+ tools is in the GitHub README.

shell
git clone --depth 1 https://github.com/dfkai/xtquantai.git
mkdir -p .claude/skills
cp -r xtquantai/skills/qmt-inner-backtest .claude/skills/
用法Usage

装好之后,直接说人话 Once installed, just talk

这份研报(附 PDF / 截图)的上下影线因子,帮我生成一个中证1000、Top 10 持仓、5 日调仓的 QMT 回测脚本。 Take the shadow-line factor from this research report (PDF / screenshot attached) and generate a QMT backtest script: CSI 1000 universe, top-10 holdings, 5-day rebalance.

默认 T 日收盘算因子、T+1 日开盘调仓;需要改调仓逻辑直接说明即可。 By default factors are computed at T close and rebalanced at T+1 open — just say so if you want different timing.

STEP 01

描述策略,确认规格表Describe, then confirm the spec

Agent 先输出策略规格表——股票池、持仓数、调仓频率、因子方向——由你确认后才动手。The agent first outputs a spec table — universe, holdings, rebalance cadence, factor direction — and only proceeds after you confirm.

STEP 02

拿到完整回测脚本Get the full backtest script

基于母版只替换因子与配置区,交易执行和防未来函数检查原样保留,附自检清单。Only the factor and config sections change from the master template; trade execution and look-ahead checks stay intact, with a self-check list attached.

STEP 03

在 QMT 中编译回测Compile & backtest in QMT

粘贴到 QMT 策略编辑器 → 编译 → 按提示核对日期 / 资金 / 费率 → 运行回测看收益曲线。Paste into the QMT strategy editor → compile → verify dates / capital / fees per the checklist → run and review the equity curve.

参与共建Community

下一个技能,由你的需求决定 The next skill is decided by your needs

这个项目靠社区需求驱动——你在 QMT 量化中遇到的重复劳动,都可能值得做成一个技能。所有技能在 CI 中按 Agent Skills 标准自动校验,维护流程公开透明。 This project is driven by community needs — any repetitive chore in your QMT quant workflow might deserve to become a skill. Every skill is CI-validated against the Agent Skills spec, with a public maintenance playbook.

FAQ

常见问题 FAQ

技能本身(解读研报、生成脚本的过程)不限平台,Mac / Linux 上照常使用。只有生成的策略脚本需要在 Windows 的 QMT 策略编辑器中编译和回测——因为 QMT / 投研终端目前仅支持 Windows。 The skill itself (parsing reports, generating scripts) is platform-agnostic — it works fine on Mac / Linux. Only the generated strategy script needs Windows, because QMT and the research terminal currently only run there.
Claude Code、Cursor、Codex、Gemini CLI、Kimi Code、Windsurf、Cline、Trae 等 70+ 支持 Agent Skills 标准的工具。跨工具通用目录是 .agents/skills/;只用 Claude 系工具可以放 .claude/skills/。完整目录对照表见 README。 Claude Code, Cursor, Codex, Gemini CLI, Kimi Code, Windsurf, Cline, Trae and 70+ tools that support the Agent Skills standard. The universal directory is .agents/skills/; Claude-family tools can use .claude/skills/. See the README for the full table.
不在命令行运行。把脚本粘贴到 QMT 策略编辑器 → 保存编译 → 在回测面板设置日期、资金、费率 → 运行回测。记得先在「数据管理」下载回测区间的日线行情和财务数据,并确认 QMT 已登录。 Not from the command line. Paste the script into the QMT strategy editor → save and compile → set dates, capital and fees in the backtest panel → run. Make sure you've downloaded daily bars and financial data for the backtest window in Data Management first, with QMT logged in.
技能强制信号 shift(1):T 日收盘算因子,T+1 日开盘调仓,并在生成后的自检清单中逐项检查。除非你明确要求当日收盘调仓并接受前视偏差,否则不会去掉滞后。 The skill enforces shift(1) on signals: factors computed at T close trade at T+1 open, verified item-by-item in the post-generation checklist. The lag is never removed unless you explicitly ask for same-day rebalancing and accept the bias.
这个项目靠社区需求驱动:用 skill-request 模板提交技能需求(一句话的想法也欢迎)、在 Discussions 交流量化思路,或阅读贡献指南后直接提 PR。所有技能在 CI 中按 agentskills.io 标准自动校验。 The project is community-driven: file a skill request (even a one-sentence idea), discuss quant ideas in Discussions, or read the contributing guide and open a PR. Every skill is CI-validated against the agentskills.io spec.

一句话,让 AI 学会 QMT 回测 One sentence teaches your AI QMT backtesting

开源 · MIT 许可 · 欢迎 Star、技能需求与 PR Open source · MIT licensed · Stars, skill requests and PRs welcome

前往 GitHub Go to GitHub