Agent skill

Quant Backtest

by Sixian-Li in Sixian-Li/plain-backtest

Run the standardized Quant backtest pipeline from a natural-language strategy through data gating, tested implementation, PyBroker execution, independent-ledger reconciliation, parameter robustness…

MITAuto-check passedBusiness, Finance & HR

Install Quant Backtest

skills CLI
$ npx skills add Sixian-Li/plain-backtest --skill quant-backtest -a claude-code

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

GitHub CLI
$ gh skill install Sixian-Li/plain-backtest quant-backtest --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/Sixian-Li/plain-backtest.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/quant-backtest .claude/skills/quant-backtest && 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
quant-backtest
GitHub stars
170
Token cost
~2.7k tokens
SKILL.md length
1,298 words
Files
3 (incl. references)
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Run the standardized Quant backtest pipeline from a natural-language strategy through data gating, tested implementation, PyBroker execution, independent-ledger reconciliation, parameter robustness…

  • Works in 6 steps: Locate the root containing catalog.md,… → Read root catalog.md, root log.md,… → Read references/pipeline.md. Read data… → …
  • Explaining a backtest in this Quant workspace
  • SKILL.md covers Distributed project, Start every task, Define before coding and Implement and verify, plus 3 more sections
  • Calls python and pip

What it does

Quant Backtest is an agent skill from Sixian-Li/plain-backtest. Run the standardized Quant backtest pipeline from a natural-language strategy through data gating, tested implementation, PyBroker execution, independent-ledger reconciliation, parameter robustness analysis, interactive HTML, experiment registration, automatic strategy-evolution synchronization, and work logging. Use when creating, changing, rerunning, reviewing, or explaining a backtest in this Quant workspace.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `agents/openai.yaml` and `references/pipeline.md`).

It sits in Business, Finance & HR, covering Trading and backtesting. The repository describes itself as: Say It Simply, Test It Properly. Agent-powered strategy research with independent ledger checks and reproducible reports. The licence is MIT.

When your agent uses it

  • Explaining a backtest in this Quant workspace
  • Tasks that involve Trading and backtesting

Example prompts

  • “/quant-backtest”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Locate the root containing catalog.md, data/, and backtest/.
  2. Read root catalog.md, root log.md, backtest/README.md, backtest/docs/architecture.md, backtest/docs/research_protocol.md…
  3. Read references/pipeline.md. Read data or framework docs only when relevant.
  4. Inspect active_run_id before allocating a run. If it is running or completed_unvalidated with the same definition, resume it; do not…
  5. For a read-only review or explanation, run the targeted checks needed for the claim plus the catalog/workspace audit. Before changing or…
  6. For implementation or execution, use an isolated worktree below the primary repository's visible worktrees/ pool. Create an experiment…

What it can do on your machine

Read from SKILL.md and the folder at commit 36adf23. 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

    Shell commands in SKILL.md call:

    • python
    • pip

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

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    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

Quant Backtest loads about 2.7k tokens when it runs, and up to ~4.8k if it reads all its reference files. Until then it costs about 108 tokens; SKILL.md has 1,298 words of instructions outside code blocks.

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

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from Sixian-Li/plain-backtest at commit 36adf23, republished under its MIT licence (© Sixian-Li). 1,298 words, ~2,664 tokens.

Download SKILL.mdSave it as .claude/skills/quant-backtest/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
quant-backtest
description
Run the standardized Quant backtest pipeline from a natural-language strategy through data gating, tested implementation, PyBroker execution, independent-ledger reconciliation, parameter robustness analysis, interactive HTML, experiment registration, automatic strategy-evolution synchronization, and work logging. Use when creating, changing, rerunning, reviewing, or explaining a backtest in this Quant workspace.

Quant Backtest

Turn the user's strategy into a reproducible experiment that a fresh agent can inherit without reverse-engineering prior chat.

Distributed project

This skill is versioned at .agents/skills/quant-backtest/ in this repository. Locate the root from the current checkout; do not depend on a user-level skill or the author’s original workspace. Read README.md and backtest/docs/release/scope.md first. The distribution contains canonical data and experiment definitions, not the complete source archives or historical runs.

For an initial runnable demonstration, use backtest/.venv/bin/python backtest/scripts/quickstart.py. Its ledger check is not formal run validation. Formal Git/worktree/run requirements below apply when creating formal research in an initialized repository; do not initialize Git merely to run the example. Do not restore historical run pointers unless the full corresponding artifacts are present.

Start every task

  1. Locate the root containing catalog.md, data/, and backtest/.
  2. Read root catalog.md, root log.md, backtest/README.md, backtest/docs/architecture.md, backtest/docs/research_protocol.md, backtest/experiments/lineage.json, the relevant registry section, experiment.json, and its latest validated run/report when one exists.
  3. Read references/pipeline.md. Read data or framework docs only when relevant.
  4. Inspect active_run_id before allocating a run. If it is running or completed_unvalidated with the same definition, resume it; do not create a duplicate after a network/session interruption.
  5. For a read-only review or explanation, run the targeted checks needed for the claim plus the catalog/workspace audit. Before changing or executing a strategy, run pip check, relevant tests, and the audit; finish material implementation with the full test suite.
  6. For implementation or execution, use an isolated worktree below the primary repository's visible worktrees/ pool. Create an experiment task with cd backtest && .venv/bin/python -m scripts.manage_worktree create <task-name> --experiment <PROGRAM>/<experiment-directory>. The manager uses sparse checkout and shared symlinks; never create hidden/external worktrees or copy .venv or large data into one.

Define before coding

Write the authoritative experiment.json with a natural-language strategy description and exact rules for universe, warmup, indicators, entry/exit semantics, signal time, fill time, sizing, cash/margin, costs, benchmark, dates, and parameters. For interactive_research_v5, also write strategy.plain_language.summary, buy, sell, execution, and position as short complete Chinese sentences that a non-programmer can understand; keep formulas and machine conditions in the exact rule fields, not in this reader-facing story. Also predeclare research.stage, hypothesis, primary metric, selection rule, validation plan, promotion criteria, and rejection conditions. Distinguish a level condition from a crossing event. Ask only when an unresolved semantic choice would materially change results.

An experiment is the long-lived research definition. A run is one concrete execution that freezes configuration, data, code, environment, and outputs. A parameter combination inside a run is a case. Do not use these terms interchangeably. Changing strategy semantics creates a new experiment; data/code refreshes normally create a new run under the same experiment. Before starting a new experiment, assign its program, unique display version, full created_on, and lineage parent(s) in experiments/lineage.json; create its directory as experiments/<PROGRAM>/<DISPLAY_CODE>__<YY-MM-DD>__<slug>/. Run retries retain the same research version. For every parent-to-child edge, write rationale (why the research changed) and change_summary (what rules or intent changed) once in lineage.json. Do not manually edit strategy_evolution.md or program_evolution/*.md: the generator derives parent/child parameter differences and representative run metrics.

Implement and verify

  1. Reuse quantkit/ modules and configuration; do not duplicate a strategy per symbol.
  2. Add an automated test before changing fragile timing or accounting behavior. Put shared contracts under tests/core, data, lifecycle, or reporting; put strategy behavior under tests/strategies/<der|rot|tim>. Tests do not use experiment date/version names.
  3. Require approved canonical data and save its hash for formal promotion evidence. An explicitly user-authorized exploratory run may use a registered candidate_pending_review point-in-time universe only when it freezes the candidate build ID, source/archive hashes, review status, adjustment choice, known gaps, and decision-time membership lag in experiment/run provenance. Keep research.stage=exploratory, surface the data limitation before results, and force promotion criteria to fail until the data is approved. Never modify purchased raw data or splice suppliers silently.
  4. Force every order to an explicit OPEN or CLOSE; never allow PyBroker's default middle price into formal results.
  5. Use completed bars only. A close-confirmed signal fills no earlier than the next declared bar time.
  6. Create a run with scripts.start_experiment_run only when no resumable active run exists. Use --resume-active after a session interruption. Explicitly mark an abandoned session with scripts.manage_experiment_run interrupt before starting a replacement.
  7. Reconcile PyBroker cash, shares, equity, dates, sides, shares, and fill prices against the independent reference ledger for every case. Run symbol/cost blocks as checkpoints and save every completed case, not only winners.
  8. Reserve failed for deterministic code, data, ledger, report, or quality-gate failures. Use interrupted for network, process, or agent-session loss. After a validated successor exists, an explicitly authorized scripts.manage_experiment_run prune --apply may remove the interrupted directory while keeping the central event.
  9. Treat full-sample scans as exploratory. Analyze local neighborhoods, connected high-performance plateaus, boundaries, costs, and risk metrics before naming a stable representative.
Show full SKILL.md (501 more words)Show less

Publish and hand off

Save the required machine artifacts from references/pipeline.md. Before building HTML, inspect backtest/report_templates/ and reuse the closest accepted template through quantkit.reporting.render_interactive_report. Use interactive_research_v5 for every new report. Immediately after the title and before all performance results, explain the frozen strategy in reading order: trading object and intent, when to buy, when to sell, how a signal becomes a fill, position/capital, costs, and benchmark. Use short human sentences from strategy.plain_language; do not put JSON, Python dictionaries, code conditions, machine-field tables, or an expanded parameter tree on the HTML/PDF front page. Keep the exact rules and full parameters in the web-only collapsed appendix and experiment_snapshot.json; hide that appendix and machine identity in print/PDF. Never mutate historical validated HTML/PDF. Generate the remaining self-contained Plotly report with readable navigation, visible-window Y-axis behavior for K-lines, manual Y controls, warmup markings, trades, equity, drawdown, and parameter surfaces. Keep formal strategy calculation read-only over saved results; label browser-only comparison scenarios explicitly.

For every formal experiment, record the template ID/path and a reuse_review decision in experiment.json: reuse an existing template, promote stable generally useful improvements into a new/versioned project template, or explain why no template applies. Do not copy a finished experiment HTML into this skill. When template code changes, run its unit/JavaScript tests and a real-browser interaction smoke test before publishing.

Add or update the experiment in backtest/experiments/index.md and backtest/experiments/lineage.json, append the material result to root log.md, and keep root catalog.md as a pure file tree. After every strategy research run or registry change, run scripts.build_research_catalog and scripts.build_research_catalog --check so the grouped registry, generated combined strategy_evolution.md, matching program_evolution/<PROGRAM>.md, scorecard, and lineage map all match the immutable evidence. Treat any stale generated file or an edge missing rationale/change_summary as incomplete work. Run the workspace audit; invoke quant-tidy only for actual structural reorganization. Finish with scripts.validate_run; only a passing run may become latest_validated_run_id, and a validated run is immutable. Maintain experiment/report.html as a relative link to that latest validated report. Commit the worktree branch, then use scripts.manage_worktree publish <task-name> --experiment <PROGRAM>/<experiment-directory> from a clean primary tree; the worktree is not a delivery location. Remove the fully merged worktree after publication. Give a candid limitation summary.

Guardrails

  • Do not call an in-sample winner a future-optimal parameter.
  • Do not connect IBKR, enable financing, initialize Git, or expand scope without authorization.
  • Do not claim exact corporate-action accounting when using adjusted OHLC without event data.
  • Do not hide no-trade runs, failed quality gates, boundary optima, or mismatches.
  • Do not turn operational interruptions into experiment versions, strategy evidence, or scorecard rows.
  • Do not publish or validate a report whose strategy definition is absent, below its metrics, reconstructed from prose outside the frozen experiment snapshot, or presented as a raw configuration/code dump instead of a human-readable strategy story.
  • Do not leave the only copy of a validated report in a worktree or treat a worktree as the canonical experiment store.

Resources

  • Read references/pipeline.md for schemas, artifacts, commands, and completion criteria.
  • Run the workspace scripts.validate_run --experiment <experiment-dir> --run-id <run-id> before declaring a run validated.

© Sixian-Li, MIT. 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 (references) in .agents/skills/quant-backtest of Sixian-Li/plain-backtest.

  • SKILL.md
  • agents/openai.yaml
  • references/pipeline.md

Open the folder on GitHubat commit 36adf23

Compare with similar skills

Quant Backtest 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.

Quant Backtest compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Quant Backtest this skillSixian-Li/plain-backtest170—~2.7kAutomated safety check: PassMIT
Tushare Datazillionare/zillionare3192 repos~2.3kAutomated safety check: PassNone
Tradingview MCPatilaahmettaner/tradingview-mcp5k—~1.3kAutomated safety check: PassMIT
Digital Oraclekomako-workshop/digital-oracle870—~5.9kAutomated safety check: PassMIT
Fintoolsecond-state/fintool3161 repos~5.9kAutomated safety check: PassNone
Polyclawchainstacklabs/polyclaw3601 repos~2kAutomated safety check: PassApache-2.0

Similar skills

  • Tushare Data

    zillionare/zillionare

    面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    319 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed
  • Tradingview MCP

    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…

    5k GitHub stars~1.3k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Digital Oracle

    komako-workshop/digital-oracle

    Answer prediction questions using market trading data, not opinions.

    870 GitHub stars~5.9k tokensUpdated 2 mo ago
    Business, Finance & HRAuto-check passed
  • Fintool

    second-state/fintool

    Financial trading CLIs — spot and perp trading on Hyperliquid, Binance, Coinbase, OKX.

    316 GitHub starsUsed in 1 repo~5.9k tokens
    Business, Finance & HRAuto-check passed
  • Polyclaw

    chainstacklabs/polyclaw

    Trade on Polymarket via split + CLOB execution. An agent skill from chainstacklabs/polyclaw.

    360 GitHub starsUsed in 1 repo~2k tokens
    Business, Finance & HRAuto-check passed
  • Markdown

    facioquo/stock-indicators-dotnet

    Format and lint Markdown in this repository against GitHub Flavored Markdown and its markdownlint-cli2 configuration — headers, lists, code fences, callouts (VitePress containers on docs-site pages…

    1.2k GitHub stars~812 tokensUpdated today
    Business, Finance & HRAuto-check passed

More from Sixian-Li/plain-backtest

  • Data Update

    Sixian-Li/plain-backtest

    Operate and assess the Quant workspace market-data layer through the tested data-update CLI.

    170 GitHub stars~1.6k tokensUpdated 10 days ago
    Auto-check passed
  • Quant Tidy

    Sixian-Li/plain-backtest

    Audit and reorganize the Quant multi-project workspace. An agent skill from Sixian-Li/plain-backtest.

    170 GitHub stars~1.3k tokensUpdated 10 days ago
    Auto-check passed

Questions about Quant Backtest

What does Quant Backtest do?

Run the standardized Quant backtest pipeline from a natural-language strategy through data gating, tested implementation, PyBroker execution, independent-ledger reconciliation, parameter robustness…. Quant Backtest is an agent skill from Sixian-Li/plain-backtest. Run the standardized Quant backtest pipeline from a natural-language strategy through data gating, tested implementation, PyBroker execution, independent-ledger reconciliation, parameter robustness analysis, interactive HTML, experiment registration, automatic strategy-evolution synchronization, and work logging.

When should I use Quant Backtest?

Quant Backtest fits situations like: explaining a backtest in this Quant workspace; tasks that involve Trading and backtesting.

How do I install Quant Backtest in Claude Code?

Run `npx skills add Sixian-Li/plain-backtest --skill quant-backtest -a claude-code`. Or copy the skill folder (.agents/skills/quant-backtest in Sixian-Li/plain-backtest) into .claude/skills/quant-backtest in your project. Claude Code loads it when a task matches its description.

How do I install Quant Backtest in Codex?

Run `npx skills add Sixian-Li/plain-backtest --skill quant-backtest -a codex`. Or copy the skill folder (.agents/skills/quant-backtest in Sixian-Li/plain-backtest) into .agents/skills/quant-backtest in your project. Codex loads it when a task matches its description.

Can I use Quant Backtest 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 Sixian-Li/plain-backtest --skill quant-backtest -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/quant-backtest, .gemini/skills/quant-backtest, .github/skills/quant-backtest and .opencode/skills/quant-backtest in your project.

What does Quant Backtest need to run?

Going by SKILL.md and its folder, Quant Backtest needs the command-line tools its instructions call (python and pip). Our summary lists: Python 3.

Does Quant Backtest access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Quant Backtest 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. Review the folder before installing.

What licence does Quant Backtest use?

Quant Backtest is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Quant Backtest use?

About 2.7k tokens (SKILL.md is roughly 11k 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 2.1k tokens, read only when the agent opens those files.

What are the alternatives to Quant Backtest?

Skills that share tags, products or a category with Quant Backtest: Tushare Data (zillionare/zillionare, 319 stars), Tradingview MCP (atilaahmettaner/tradingview-mcp, 5k stars), Digital Oracle (komako-workshop/digital-oracle, 870 stars) and Fintool (second-state/fintool, 316 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Quant Backtest?

Sixian-Li (a GitHub user) maintains it in Sixian-Li/plain-backtest, which has 170 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on September 27, 2026.

Source: Sixian-Li/plain-backtest on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.