Agent skill

Backtesting Frameworks

by wshobson in wshobson/agents

Builds trustworthy trading backtests by guarding against look-ahead and survivorship bias, overfitting and ignored costs, with walk-forward analysis.

MITAuto-check passedBusiness, Finance & HR

Install Backtesting Frameworks

skills CLI
$ npx skills add wshobson/agents --skill backtesting-frameworks -a claude-code

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

GitHub CLI
$ gh skill install wshobson/agents backtesting-frameworks --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/wshobson/agents.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/quantitative-trading/skills/backtesting-frameworks .claude/skills/backtesting-frameworks && 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
backtesting-frameworks
GitHub stars
40k
Used in
10 other repos
Token cost
~725 tokens
SKILL.md length
172 words
Files
2 (incl. references)
Skills in repo
142
Repo updated
First seen
Licence
MIT

At a glance

Builds trustworthy trading backtests by guarding against look-ahead and survivorship bias, overfitting and ignored costs, with walk-forward analysis.

  • Works in 3 steps: Backtesting Biases → Proper Backtest Structure → Walk-Forward Analysis
  • Building backtesting infrastructure for a trading strategy
  • SKILL.md covers When to Use This Skill, Core Concepts, Detailed worked examples and… and Best Practices
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The skill sets out how to build a backtesting system whose results can be trusted. It lists five common biases with a remedy for each: look-ahead (use point-in-time data), survivorship (include delisted securities), overfitting (test out of sample), selection (pre-register strategies) and ignored transaction costs (use realistic cost models).

It describes a proper backtest structure and walk-forward analysis, where rolling windows each train and then test, and advises against optimizing on the full history. Further advice covers Monte Carlo analysis to understand uncertainty, careful use of adjusted data and attention to capacity and market impact. Implementation patterns and worked examples are in `references/details.md`.

When your agent uses it

  • Building backtesting infrastructure for a trading strategy
  • Checking a backtest for look-ahead or survivorship bias
  • Setting up walk-forward analysis instead of a single train and test split
  • Comparing alternative strategies on equal terms with realistic costs

Example prompts

  • “Review my backtest script for look-ahead bias and survivorship bias.”
  • “Add realistic transaction costs and slippage to this strategy backtest.”
  • “Set up walk-forward validation for my momentum strategy with rolling train and test windows.”

Workflow steps

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

  1. Backtesting Biases
  2. Proper Backtest Structure
  3. Walk-Forward Analysis

What it can do on your machine

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

    No scripts in the folder and no shell commands in SKILL.md.

    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

Backtesting Frameworks loads about 725 tokens when it runs, and up to ~5.3k if it reads all its reference files. Until then it costs about 66 tokens; SKILL.md has 172 words of instructions outside code blocks.

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

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 wshobson/agents at commit 46891e7, republished under its MIT licence (© wshobson). 172 words, ~725 tokens.

Download SKILL.mdSave it as .claude/skills/backtesting-frameworks/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
backtesting-frameworks
description
Build robust backtesting systems for trading strategies with proper handling of look-ahead bias, survivorship bias, and transaction costs. Use when developing trading algorithms, validating strategies, or building backtesting infrastructure.

Backtesting Frameworks

Build robust, production-grade backtesting systems that avoid common pitfalls and produce reliable strategy performance estimates.

When to Use This Skill

  • Developing trading strategy backtests
  • Building backtesting infrastructure
  • Validating strategy performance
  • Avoiding common backtesting biases
  • Implementing walk-forward analysis
  • Comparing strategy alternatives

Core Concepts

1. Backtesting Biases
BiasDescriptionMitigation
Look-aheadUsing future informationPoint-in-time data
SurvivorshipOnly testing on survivorsUse delisted securities
OverfittingCurve-fitting to historyOut-of-sample testing
SelectionCherry-picking strategiesPre-registration
TransactionIgnoring trading costsRealistic cost models
2. Proper Backtest Structure
Historical Data
      │
      ▼
┌─────────────────────────────────────────┐
│              Training Set               │
│  (Strategy Development & Optimization)  │
└─────────────────────────────────────────┘
      │
      ▼
┌─────────────────────────────────────────┐
│             Validation Set              │
│  (Parameter Selection, No Peeking)      │
└─────────────────────────────────────────┘
      │
      ▼
┌─────────────────────────────────────────┐
│               Test Set                  │
│  (Final Performance Evaluation)         │
└─────────────────────────────────────────┘
3. Walk-Forward Analysis
Window 1: [Train──────][Test]
Window 2:     [Train──────][Test]
Window 3:         [Train──────][Test]
Window 4:             [Train──────][Test]
                                     ─────▶ Time

Detailed worked examples and patterns

Detailed sections (starting with ## Implementation Patterns) live in references/details.md. Read that file when the navigation summary above is insufficient.

Best Practices

Do's
  • Use point-in-time data - Avoid look-ahead bias
  • Include transaction costs - Realistic estimates
  • Test out-of-sample - Always reserve data
  • Use walk-forward - Not just train/test
  • Monte Carlo analysis - Understand uncertainty
Don'ts
  • Don't overfit - Limit parameters
  • Don't ignore survivorship - Include delisted
  • Don't use adjusted data carelessly - Understand adjustments
  • Don't optimize on full history - Reserve test set
  • Don't ignore capacity - Market impact matters

© wshobson, 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 1 other file (references) in plugins/quantitative-trading/skills/backtesting-frameworks of wshobson/agents.

  • SKILL.md
  • references/details.md

Open the folder on GitHubat commit 46891e7

Used in 10 other repositories

We found 21 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 10 other GitHub owners. This page covers the copy in wshobson/agents, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Backtesting Frameworks 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.

Backtesting Frameworks compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Backtesting Frameworks this skillwshobson/agents40k10 repos~725Automated safety check: PassMIT
Strategy Performance Reporttradesdontlie/tradingview-mcp6.8k3 repos~591Automated safety check: PassCustom licence
WorldQuant BRAIN Alpha ResearchQuantML-Research/wq-alpha-research405—~4.9kAutomated safety check: PassNone
Regimejackson-video-resources/markov-hedge-fund-method483—~1.6kAutomated safety check: PassCustom licence
Virtuals Protocol AcpVirtual-Protocol/openclaw-acp1681 repos~6.4kAutomated safety check: PassNone
Quant Buddy Market Data and Backtestingpseudo-longinus/quant-buddy-skills1911 repos~11kAutomated safety check: PassMIT

Similar skills

  • Strategy Performance Report

    tradesdontlie/tradingview-mcp

    Builds a performance report for a backtested Pine Script strategy from TradingView data, covering metrics, trades, the equity curve and improvement ideas.

    6.8k GitHub starsUsed in 3 repos~591 tokens
    Business, Finance & HRAuto-check passed
  • WorldQuant BRAIN Alpha Research

    QuantML-Research/wq-alpha-research

    Chinese-language playbook for WorldQuant BRAIN alphas: choose fields, write expressions, backtest, diagnose check failures, tune turnover, submit and build portfolios.

    405 GitHub stars~4.9k tokensUpdated 3 mo ago
    Business, Finance & HRAuto-check passed
  • Regime

    jackson-video-resources/markov-hedge-fund-method

    Detect the market regime (Bull / Bear / Sideways) for ANY asset and turn it into a tradeable signal or a risk filter.

    483 GitHub stars~1.6k tokensUpdated 4 mo ago
    Business, Finance & HRAuto-check passed
  • Virtuals Protocol Acp

    Virtual-Protocol/openclaw-acp

    Hire specialised agents to handle any task — data analysis, trading, content generation, research, on-chain operations, 3D printing, physical goods, gift delivery, and more.

    168 GitHub starsUsed in 1 repo~6.4k tokens
    Business, Finance & HRAuto-check passed
  • Quant Buddy Market Data and Backtesting

    pseudo-longinus/quant-buddy-skills

    Queries A-share, Hong Kong and US stock quotes, valuation and financial data through the Quant Buddy API, and runs screening, factor calculation and strategy backtests.

    191 GitHub starsUsed in 1 repo~11k tokens
    Business, Finance & HRAuto-check passed
  • Guides an agent through installing, configuring and running local backtests in the lo2cin4bt repo, then explaining the results and fixing setup problems.

    288 GitHub stars~2.6k tokensUpdated 2 mo ago
    Business, Finance & HRAuto-check passed

More from wshobson/agents

All 142 skills in this repo
  • Cuts cloud spend across AWS, Azure, GCP and OCI with cost tagging, rightsizing, commitment and spot pricing models, and architecture changes.

    40k GitHub starsUsed in 13 repos~1.7k tokens
    Auto-check passed
  • Billing Automation

    wshobson/agents

    Covers building subscription billing: billing cycles, subscription states, invoice generation, proration, tax handling and dunning for failed payments.

    40k GitHub starsUsed in 12 repos~473 tokens
    Auto-check passed
  • Profiles slow Python code with cProfile and memory profilers, then applies targeted fixes for CPU, memory, I/O and query bottlenecks.

    40k GitHub starsUsed in 12 repos~814 tokens
    Auto-check passed
  • Portfolio Risk Metrics

    wshobson/agents

    Covers portfolio risk measurement with VaR, CVaR, Sharpe, Sortino and drawdown, plus guidance on limits, stress tests and tail risk.

    40k GitHub starsUsed in 12 repos~502 tokens
    Auto-check passed
  • Plans memory headroom, works through out-of-memory failures and watches temperature and power during long ML training jobs on NVIDIA DGX Spark.

    40k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Writes unit tests for shell scripts with Bats: error-condition tests, fixtures and mocks, cross-shell checks, parallel runs, helper files and CI integration.

    40k GitHub starsUsed in 11 repos~1.3k tokens
    Auto-check passed

Questions about Backtesting Frameworks

What does Backtesting Frameworks do?

Builds trustworthy trading backtests by guarding against look-ahead and survivorship bias, overfitting and ignored costs, with walk-forward analysis. The skill sets out how to build a backtesting system whose results can be trusted. It lists five common biases with a remedy for each: look-ahead (use point-in-time data), survivorship (include delisted securities), overfitting (test out of sample), selection (pre-register strategies) and ignored transaction costs (use realistic cost models).

When should I use Backtesting Frameworks?

Backtesting Frameworks fits situations like: building backtesting infrastructure for a trading strategy; checking a backtest for look-ahead or survivorship bias; setting up walk-forward analysis instead of a single train and test split; comparing alternative strategies on equal terms with realistic costs.

How do I install Backtesting Frameworks in Claude Code?

Run `npx skills add wshobson/agents --skill backtesting-frameworks -a claude-code`. Or copy the skill folder (plugins/quantitative-trading/skills/backtesting-frameworks in wshobson/agents) into .claude/skills/backtesting-frameworks in your project. Claude Code loads it when a task matches its description.

How do I install Backtesting Frameworks in Codex?

Run `npx skills add wshobson/agents --skill backtesting-frameworks -a codex`. Or copy the skill folder (plugins/quantitative-trading/skills/backtesting-frameworks in wshobson/agents) into .agents/skills/backtesting-frameworks in your project. Codex loads it when a task matches its description.

Can I use Backtesting Frameworks 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 wshobson/agents --skill backtesting-frameworks -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/backtesting-frameworks, .gemini/skills/backtesting-frameworks, .github/skills/backtesting-frameworks and .opencode/skills/backtesting-frameworks in your project.

What does Backtesting Frameworks need to run?

SKILL.md names no scripts, command-line tools or credentials: Backtesting Frameworks is instructions for the agent only.

Does Backtesting Frameworks 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 Backtesting Frameworks 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 Backtesting Frameworks use?

Backtesting Frameworks 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 Backtesting Frameworks use?

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

What are the alternatives to Backtesting Frameworks?

Skills that share tags, products or a category with Backtesting Frameworks: Strategy Performance Report (tradesdontlie/tradingview-mcp, 6.8k stars), WorldQuant BRAIN Alpha Research (QuantML-Research/wq-alpha-research, 405 stars), Regime (jackson-video-resources/markov-hedge-fund-method, 483 stars) and Virtuals Protocol Acp (Virtual-Protocol/openclaw-acp, 168 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Backtesting Frameworks?

wshobson (a GitHub user) maintains it in wshobson/agents, which has 40,254 GitHub stars. The repository holds 142 skills in this directory. The repository was last updated on October 5, 2026.

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