Skip to content
Agentmart
Submit a tool

new-co-trader-worktree

Creates a new git worktree in the auto-co-trader project for any purpose — optimization, regression, backtesting, brainstorming, etc.

Skill by giladresisi

IndexedMIT★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/giladresisi-new-co-trader-worktree

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Creates a new git worktree in the auto-co-trader project for any purpose — optimization, regression, backtesting, brainstorming, etc. Use this skill when the user wants to CREATE or SET UP a new worktree — phrases like "prepare a new worktree", "set up a worktree", "create a new worktree for <purpose>", "prep a new worktree", "new worktree for autoresearch", "prepare optimization from [strategy]", or "create a worktree using [strategy]". Do NOT use this skill when the user is already in a worktree and wants to start/run/begin a task — that is handled by the relevant program file in the worktree session.

Use cases: productivity

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/new-co-trader-worktree

What's inside

Skill name
new-co-trader-worktree
Description
Creates a new git worktree in the auto-co-trader project for any purpose — optimization, regression, backtesting, brainstorming, etc. Use this skill when the user wants to CREATE or SET UP a new worktree — phrases like "prepare a new worktree", "set up a worktree", "create a new worktree for <purpose>", "prep a new worktree", "new worktree for autoresearch", "prepare optimization from [strategy]", or "create a worktree using [strategy]". Do NOT use this skill when the user is already in a worktree and wants to start/run/begin a task — that is handled by the relevant program file in the worktree session.
License
MIT
Instructions
219 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# new-co-trader-worktree

Creates a new git worktree for auto-co-trader work (optimization, regression,
backtesting, brainstorming, or any other purpose) and optionally seeds it with
a named starting strategy.

---

## Step 0: Branch Context Check

Before doing anything else, check which branch you are on:

```bash
git branch --show-current
```

### Case A — On a non-master branch

If the current branch is **not** `master`, stop and tell the user:

> You're on branch `<current-branch>`, not `master`. Worktree creation should be
> done from the `master` branch so each worktree starts from a clean baseline.
>
> Would you like to switch to master first, or proceed anyway using this branch
> as the base?

Do not proceed further until the user confirms.

### Case B — On master

This is the normal flow. Continue to Step 1 below.

---

## Step 1: Identify Starting Strategy

Check whether the user named a starting strategy in their message:

- **Named** (e.g. "start from energy_momentum_v1", "use financials_mar20"):
  - Locate `strategies/<name>.py` in the current repo.
  - Its functions will be injected into train.py in the worktree (see Step 4).
- **Not named (default)**: Use train.py as-is — skip Step 4.

---

## Step 2: Determine Branch Name

The branch name needs a descriptive prefix so the worktree folder is self-explanatory
(e.g. `energy-mar21`, `regression-apr05`, `backtest-may08`). Derive it from, in order:

1. **The user's message** — if it mentions a sector, theme, purpose, or set of tickers
   (e.g. "energy stocks", "semiconductors", "mag7", "regression run", "backtesting"),
   use that as the prefix.
2. **The named starting strategy** — if the strategy name implies a sector
   (e.g. `energy_momentum_v1` → `energy`, `semis_mar20` → `semis`), use that.
3. **Neither** — if there is no usable context, ask the user before proceeding:
   > To name the worktree, can you briefly describe what it's for?
   > (e.g. "energy stocks", "regression run", "backtesting mag7") — no need to list
   > exact tickers.

Once you have a prefix, the tag is `<prefix>-<month><day>` (e.g. `energy-mar21`).

Check for collision:
```bash
git branch -a | grep "autoresearch/<tag>"
```
If it exists, append a suffix: `energy-mar21-b`, etc.

Full branch name: `autoresearch/<tag>`.

---

## Step 3: Create Worktree

Get the current branch:
```bash
git branch --show-current
```

Use the `create-worktree` skill:
- **Branch name**: `autoresearch/<tag>`
- **Base branch**: the current branch (as above)

The worktree lands at `../<tag>`.

> All subsequent file edits go into the new worktree, not the current repo.

---

## Step 3.5: Copy Cached Data

After the worktree is created, copy any cached regression data so the new worktree
can use it without re-downloading or re-computing.

> **Note:** The main `data/*.parquet` bar files are NOT copied. They live in the
> shared global path (`~/projects/auto-co-trader/global/...`) and all worktrees
> read from there — copying them per-worktree is no longer necessary.

### Copy data/regression/<date> folders

```bash
if [ -d "data/regression" ]; then
  mkdir -p "../<tag>/data/regression"
  for dir in data/regression/*/; do
    cp -r "$dir" "../<tag>/$dir"
  done
  echo "Copied data/regression date folders"
fi
```

If the directory does not exist, skip silently — the worktree will fetch or
generate data as needed.

---

## Step 4: Inject Starting Strategy (only if user named one)

*Skip if using the default train.py.*

From giladresisi/ai-dev-env, MIT.

More from giladresisi/ai-dev-env

Signals

Stars
2
Forks
0
Open issues
0
Last commit (this folder)
Jun 9, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from giladresisi

Cite this page

new-co-trader-worktree skill. Agent Mart. https://agentmart.dev/skills/giladresisi-new-co-trader-worktree (last updated 2026-10-24)