Run variant cycle

From tradingstrategy-ai/getting-started · View interactive version

Run variant cycle is an AI agent skill from the GitHub repository tradingstrategy-ai/getting-started. Create and run a variant of a backtesting or optimiser notebook.

How to use this skill

Skill file

Run variant cycle

This skill creates a variant of a backtesting or optimiser notebook,

runs it and reports result back.

1. Input notebook

Usually you determine this from the conversation context and it is a previous experiment notebook, or a notebook linked by the user.

Then the user tells you how they want to modify the notebook.

Changes include

For further examples you can use:

2. New notebook

Based on this we create a new notebook.

2.a) Outputted notebook file

2.b) Optimiser iterations

If the original notebook uses an optimiser (e.g. perform_optimisation with an iterations variable), reset iterations = 18 in the variant so that the initial run does not take too long. The user can increase iterations later once the notebook is confirmed working.

3. Execute notebook

Run the notebook with the observable jupyter-execute-agent runner as described

in CLAUDE.md, using a subagent — poetry run jupyter-execute-agent {notebook}.ipynb

(see notebook-execution.md).

If there are any bugs, make sure subagent fixed them and rerun the notebook again.

4. Analysis

From each backtest run, we should get

Reflect changes in the notebook

5. Posting results as a PR comment

We must have a worktree, branch and Github PR open.

Mention the Github PR comment link in the chat.

6. Posting results as a chat comment

setsid poetry run notebook-static-server --port 8765 > /tmp/notebook-static-server.log 2>&1 & echo $! > /tmp/notebook-static-server.pid

7. Verification

Check that Github PR comment correctly contains

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.