Source profileQuality 88/100

HKUDS/Vibe-Trading/agent/src/skills/backtest-diagnose/SKILL.md

backtest-diagnose

Diagnose failed or underperforming backtests, locate the root cause, and fix the issue

Source repository stars
29,558
Declared platforms
0
Static risk flags
0
Last source update
2026-08-04
Source checked
2026-08-04

Decision brief

What it does—and where it fits

Diagnose failed or underperforming backtests, locate the root cause, and fix the issue

Best for

    Not for

    • Tasks that require unconfirmed production actions or broad system permissions.
    • Environments where the pinned source and install steps cannot be inspected.

    Compatibility matrix

    Platform support, with evidence labels

    PlatformStatusEvidenceWhat to check
    CodexNot declaredNo explicit evidencePortability before use
    Claude CodeNot declaredNo explicit evidencePortability before use
    CursorNot declaredNo explicit evidencePortability before use
    Gemini CLINot declaredNo explicit evidencePortability before use
    Open the compatibility checker

    Installation

    Inspect first. Install second.

    The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

    Source-detected install commandSource
    npx skills add https://github.com/HKUDS/Vibe-Trading --skill "agent/src/skills/backtest-diagnose"
    Safe inspection promptEditorial

    Inspect the Agent Skill "backtest-diagnose" from https://github.com/HKUDS/Vibe-Trading/blob/3a752d5a8ed088633040893de1cc9e6dc712596f/agent/src/skills/backtest-diagnose/SKILL.md at commit 3a752d5a8ed088633040893de1cc9e6dc712596f. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

    Workflow

    What the source asks the agent to do

    1. 01

      Diagnostic Workflow

      1. Read existing artifacts: use readfile to inspect artifacts/metrics.csv, equity.csv, and trades.csv 2. Read the code: use readfile to inspect code/signalengine.py and config.json 3. Classify the issue: determine the root cause using the error taxonomy below 4. Apply the fix: u…

      Read existing artifacts: use readfile to inspect artifacts/metrics.csv, equity.csv, and trades.csvRead the code: use readfile to inspect code/signalengine.py and config.jsonClassify the issue: determine the root cause using the error taxonomy below
    2. 02

      Error Taxonomy

      1. Zero trades (tradecount=0): signal-logic bug. Conditions are too strict, so the signal stays at 0. Check whether entry and exit logic is reasonable, and inspect the signal series to confirm it is not all zeros. 2. Late trades (first trade occurs more than 2 years after the ba…

      Zero trades (tradecount=0): signal-logic bug. Conditions are too strict, so the signal stays at 0. Check whether entry and exit logic is reasonable, and inspect the signal series to confirm it is not all zeros.Late trades (first trade occurs more than 2 years after the backtest start): data-filtering bug. The lookback window may be too long, or the initial data segment may have been dropped. Shorten the window or check whethe…Capital utilization < 50% (mostly in cash): position-sizing bug. Signal triggers may be too sparse, or the position-sizing logic may be wrong.
    3. 03

      Runtime Errors (exitcode != 0)

      Review the “Runtime Errors (exitcode != 0)” section in the pinned source before continuing.

      Review and apply the “Runtime Errors (exitcode != 0)” source section.
    4. 04

      Logic Bugs (Backtest Succeeds but Results Are Abnormal)

      1. Zero trades (tradecount=0): signal-logic bug. Conditions are too strict, so the signal stays at 0. Check whether entry and exit logic is reasonable, and inspect the signal series to confirm it is not all zeros. 2. Late trades (first trade occurs more than 2 years after the ba…

      Zero trades (tradecount=0): signal-logic bug. Conditions are too strict, so the signal stays at 0. Check whether entry and exit logic is reasonable, and inspect the signal series to confirm it is not all zeros.Late trades (first trade occurs more than 2 years after the backtest start): data-filtering bug. The lookback window may be too long, or the initial data segment may have been dropped. Shorten the window or check whethe…Capital utilization < 50% (mostly in cash): position-sizing bug. Signal triggers may be too sparse, or the position-sizing logic may be wrong.
    5. 05

      Data Errors

      Review the “Data Errors” section in the pinned source before continuing.

      Review and apply the “Data Errors” source section.

    Permission review

    Static risk signals and limitations

    No configured static risk pattern was detected

    This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

    Evidence record

    Why each signal appears

    EvidenceSourceComputedTestedEditorial
    SignalValueEvidence typeMeaning
    Quality score88/100ComputedDocumentation, specificity, maintenance, and trust rules
    Repository stars29,558SourceRepository attention, not individual Skill quality
    Compatibility0 platformsSourceDeclared in the catalog source record
    Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

    Pinned source

    Provenance and original SKILL.md

    Repository
    HKUDS/Vibe-Trading
    Skill path
    agent/src/skills/backtest-diagnose/SKILL.md
    Commit
    3a752d5a8ed088633040893de1cc9e6dc712596f
    License
    MIT
    Collected
    2026-08-04
    Default branch
    main
    View the original SKILL.md

    Backtest Diagnosis

    Overview

    Use this skill when a user reports that a backtest failed, raised an error, or produced poor results.

    Diagnostic Workflow

    1. Read existing artifacts: use read_file to inspect artifacts/metrics.csv, equity.csv, and trades.csv
    2. Read the code: use read_file to inspect code/signal_engine.py and config.json
    3. Classify the issue: determine the root cause using the error taxonomy below
    4. Apply the fix: use edit_file to modify the code, then rerun the backtest
    5. Verify the fix: use read_file to inspect the new metrics.csv

    Error Taxonomy

    Runtime Errors (exit_code != 0)

    Error TypeCommon CauseFix
    ImportErrorMissing dependencybash("pip install xxx")
    KeyErrorDataFrame column-name mismatchCheck the actual column names in data_map
    IndexErrorEmpty data or insufficient lengthAdd length checks
    TypeErrorIncorrect signal typeEnsure the return value is pd.Series

    Logic Bugs (Backtest Succeeds but Results Are Abnormal)

    1. Zero trades (trade_count=0): signal-logic bug. Conditions are too strict, so the signal stays at 0. Check whether entry and exit logic is reasonable, and inspect the signal series to confirm it is not all zeros.
    2. Late trades (first trade occurs more than 2 years after the backtest start): data-filtering bug. The lookback window may be too long, or the initial data segment may have been dropped. Shorten the window or check whether dropna is too aggressive.
    3. Capital utilization < 50% (mostly in cash): position-sizing bug. Signal triggers may be too sparse, or the position-sizing logic may be wrong.
    4. Open position at the end (a position still exists when the backtest ends): exit-timing bug. Forced liquidation may be missing, or exit logic does not cover the final segment.

    Data Errors

    SymptomRoot CauseFix
    No data fetchedInvalid API token or code issueCheck config.json
    Too little dataDate range too narrowExpand the date range

    Data-Source Error Ignore List

    If you encounter the following keywords, do not modify the code. The problem is on the data-provider side:

    • a provider-side "no data available" response
    • rate limit
    • API limit
    • daily limit
    • Information (common in Tushare API responses)

    These issues require the user to check the API token, switch data sources, or wait for the quota to reset.

    Hard-Gate Checklist

    1. artifacts/metrics.csv exists and is non-empty
    2. artifacts/equity.csv exists and is non-empty
    3. trade_count > 0 (0 trades means a signal bug)
    4. The equity series contains no NaN
    5. exit_code == 0

    Fixing Principles

    • Use edit_file to make precise code fixes instead of rewriting the entire file with write_file, unless the structure is fundamentally broken
    • Fix the bug only, do not change strategy logic unless the user explicitly asks
    • Fix one issue at a time, and rerun the backtest immediately after each fix
    • Limit yourself to at most 3 repair iterations

    Post-Fix Validation Rules

    After modifying signal_engine.py, you must confirm:

    1. AST syntax passes: bash("python -c \"import ast; ast.parse(open('code/signal_engine.py').read()); print('OK')\"")
    2. Contains class SignalEngine: the file must define class SignalEngine
    3. Contains def generate: the class must contain a def generate method
    4. Rerun the backtest: after the fix, rerun the backtest and verify the results

    action_items Writing Rules

    After diagnosis, output actionable improvement suggestions:

    • Format: "Change X from A to B" or "Add X logic in signal_engine.py"
    • Be specific about parameter values, filenames, and function names
    • Provide at least 2 items
    • Examples:
      • "Change RSI threshold from 30 to 25 in signal_engine.py line 42"
      • "Add signals = signals.fillna(0) after signal calculation to prevent NaN propagation"
      • "Add a volume filter: skip buy signals when volume is below the 20-day average"

    Alternatives

    Compare before choosing

    Computed 10023,781

    alirezarezvani/claude-skills

    app-store-optimization

    App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist

    Computed 10014,225

    wanshuiyin/Auto-claude-code-research-in-sleep

    citation-audit

    Use it for operations and research tasks; the detail page covers purpose, installation, and practical steps.

    Computed 1004,922

    dotnet/skills

    migrate-vstest-to-mtp

    Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing

    Computed 1002,504

    aaron-he-zhu/aaron-marketing-skills

    social-selling-planner

    Use when the user asks to "set up my founder social-selling routine", "build a daily engagement block for target accounts", or "turn funding / hiring signals into selling plays"; produces the founder/seller daily operating block — a time-boxed engagement-block spec (substantive value-add comments on target-account posts, never a pitch), warm-touch-before-ask cadence rules, trigger-response plays consuming the social-pulse-monitor B2B trigger watchlist (funding / hiring / launch signals), and a q