Logo di Worktree Setup

Worktree Setup

Community
robinebers
worktree-setup

Generate setup scripts/configs for AI agent worktrees and isolated environments across Cursor, Codex, Conductor, and Claude Code. Use when wiring up a project so AI agents start with the same dependencies, env files, and tool configs as the main repo.

Panoramica

Autorerobinebers
Repositoryskills
Nome della skillworktree-setup
Stelle
49
Fork
5
File inclusi
Solo istruzioni
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da robinebers su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Worktree Setup in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/robinebers/skills/tree/main/skills/worktree-setup
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/robinebers/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/worktree-setup .claude/skills/worktree-setup
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Worktree Setup in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Worktree Setup non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Worktree Setup non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Worktree Setup

Generate the right config so AI agents start in their isolated worktrees / environments with the same setup as the main repo: dependencies installed, env files in place, tool configs copied over.

  1. Unless the context already provides an answer, explicitly ask the user which tool the setup is for: Cursor, Codex, Conductor, or Claude Code.

  2. Map out the project (web, native, Rust, Swift, etc.) and make judgement calls on the right setup/install, run/actions, and teardown/archive commands.

Not all projects use bun. Some use make, cargo, bun tauri dev, swift build, npm, pnpm, pip, etc. Read the README, package.json scripts, top-level Makefile, or Cargo.toml to figure it out.

What each tool reads

  • Cursor: Local parallel-agent worktrees in .cursor/worktrees.json.
  • Codex: Setup script + actions in .codex/environments/environment.toml.
  • Conductor: Workspace setup in conductor.json.
  • Claude Code: .worktreeinclude at the repo root (gitignored files to copy into each worktree) + .claude/settings.json SessionStart hook for install.

The shared pattern

Across Cursor, Codex, and Conductor, the setup script usually does the same 3 things:

  1. Install dependencies - run appropriate commands by project type, like Bun, Tauri, make, cargo, swift, etc. Read the README, package.json, Makefile, Cargo.toml, or similar to figure out what's right.
  2. Copy AI-tool config dirs - .agents, .claude, .codex, .cursor from the source repo into the new environment.
  3. Copy env files - .env, .env.local, .env.development, etc.

CRITICAL: the setup script always lives project-scoped, not global.

Claude Code is the exception: it auto-copies tracked files into each worktree and uses a declarative include list (.worktreeinclude) for gitignored files plus a SessionStart hook for install — no imperative setup script. See its section below.

Reusable copy snippet

Replace $SOURCE and $DEST with the right env vars for the platform (see the table near the bottom):

bash
for d in .agents .claude .codex .cursor; do
    [ -d "$SOURCE/$d" ] && mkdir -p "$DEST/$d" && rsync -a "$SOURCE/$d/." "$DEST/$d/"
done
[ -f "$SOURCE/{ENV_FILE}" ] && cp "$SOURCE/{ENV_FILE}" "$DEST/{ENV_FILE}" || true

Templates

Replace {INSTALL_CMD}, {RUN_CMD}, and {ENV_FILE} per project.

Cursor

Cursor exposes $ROOT_WORKTREE_PATH (the source repo root). Scripts run inside the new worktree, so the destination is just the current working directory.

For OS-specific setups, use setup-worktree-unix or setup-worktree-windows. setup-worktree is the cross-platform fallback.

json
{
    "setup-worktree": [
        "{INSTALL_CMD}",
        "for d in .agents .claude .codex .cursor; do [ -d \"$ROOT_WORKTREE_PATH/$d\" ] && mkdir -p \"$d\" && rsync -a \"$ROOT_WORKTREE_PATH/$d/.\" \"$d/\"; done",
        "[ -f \"$ROOT_WORKTREE_PATH/{ENV_FILE}\" ] && cp \"$ROOT_WORKTREE_PATH/{ENV_FILE}\" \"{ENV_FILE}\" || true"
    ]
}

Codex

The file is autogenerated by the Codex desktop app - don't hand-edit it lightly, but it's plain TOML and committed to git. Schema:

toml
version = 1
name = "{PROJECT_NAME}"

[setup]
script = '''
#!/usr/bin/env bash
set -euo pipefail

{INSTALL_CMD}

# Sync config dirs from source tree into the worktree
for d in .agents .claude .codex .cursor; do
    if [ -d "$CODEX_SOURCE_TREE_PATH/$d" ]; then
        mkdir -p "$CODEX_WORKTREE_PATH/$d"
        rsync -a "$CODEX_SOURCE_TREE_PATH/$d/." "$CODEX_WORKTREE_PATH/$d/"
    fi
done

# Copy env file if present
if [ -f "$CODEX_SOURCE_TREE_PATH/{ENV_FILE}" ]; then
    cp "$CODEX_SOURCE_TREE_PATH/{ENV_FILE}" "$CODEX_WORKTREE_PATH/{ENV_FILE}"
fi
'''

[[actions]]
name = "Dev Server"
icon = "run"
command = "{RUN_CMD}"

[[actions]]
name = "Build"
icon = "build"
command = "{BUILD_CMD}"

The [setup] script runs at the start of every new worktree / task. The [[actions]] blocks each become a named shortcut in the Codex UI. Common icons: run, build, debug, logs, check, package.

Conductor

conductor.json lives at the repo root and gets shared with teammates so everyone gets the same workspace setup.

Fields:

FieldTypeDescription
scripts.setupstringCommand to run when setting up a new workspace.
scripts.runstringCommand to start the dev server.
scripts.archivestringCommand to run when archiving a workspace.
runScriptMode"concurrent" | "nonconcurrent"Whether to kill in-progress run scripts before starting a new one.

Template:

json
{
    "scripts": {
        "setup": "{INSTALL_CMD}; for d in .agents .claude .codex .cursor; do [ -d \"$CONDUCTOR_ROOT_PATH/$d\" ] && mkdir -p \"$CONDUCTOR_WORKSPACE_PATH/$d\" && rsync -a \"$CONDUCTOR_ROOT_PATH/$d/.\" \"$CONDUCTOR_WORKSPACE_PATH/$d/\"; done; [ -f \"$CONDUCTOR_ROOT_PATH/{ENV_FILE}\" ] && cp \"$CONDUCTOR_ROOT_PATH/{ENV_FILE}\" \"$CONDUCTOR_WORKSPACE_PATH/{ENV_FILE}\"",
        "run": "{RUN_CMD}"
    }
}

Claude Code

Claude Code's worktree manager auto-copies all tracked files (including .claude/) into each new worktree, so no rsync of config dirs is needed. Only gitignored files need to be listed explicitly, and install runs through a session hook.

Three artifacts, all at the repo root:

.worktreeinclude — one line per gitignored file to copy into every new worktree:

{ENV_FILE}

.claude/settings.json — runs {INSTALL_CMD} on every new Claude session and every fresh worktree. matcher: "startup" skips --resume so it doesn't fire on session resumes:

json
{
    "hooks": {
        "SessionStart": [
            {
                "matcher": "startup",
                "hooks": [
                    {
                        "type": "command",
                        "command": "{INSTALL_CMD}",
                        "timeout": 120
                    }
                ]
            }
        ]
    }
}

timeout is in seconds. Bump it for projects with cold-build steps (Tauri, Rust, Swift cold builds can run several minutes).

.gitignore — under a # claude code runtime block so the runtime worktree directory and lock file aren't committed:

# claude code runtime
/.claude/scheduled_tasks.lock
/.claude/worktrees/

Environment variables by platform

  • Cursor: $ROOT_WORKTREE_PATH / (cwd is the new worktree, no separate destination var)
  • Codex: $CODEX_SOURCE_TREE_PATH / $CODEX_WORKTREE_PATH
  • Conductor: $CONDUCTOR_ROOT_PATH / $CONDUCTOR_WORKSPACE_PATH
  • Claude Code: none — declarative (.worktreeinclude) + session hook; no source/dest vars.

Vendors rename these. Always check the platform's docs before writing them.

Usage

CRITICAL: The user is a non-technical, non-engineer. Avoid technical jargon and help them set up the correct setup scripts for their setup.

  1. Identify which environment the project needs (per the user's answer).
  2. Detect project type and pick {INSTALL_CMD} / {RUN_CMD} / {ENV_FILE} from the table above (or read the README).
  3. Generate the matching config file from Templates.
  4. Offer to git commit for teams to have access to it too.
  5. Offer to also generate the same for other agents that this skill supports.

Domande frequenti

Cosa fa la skill IA Worktree Setup?

Generate setup scripts/configs for AI agent worktrees and isolated environments across Cursor, Codex, Conductor, and Claude Code. Use when wiring up a project so AI agents start with the same dependencies, env files, and tool configs as the main repo.

Perché usare Worktree Setup su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Worktree Setup è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Worktree Setup in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/robinebers/skills/tree/main/skills/worktree-setup. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Worktree Setup?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Worktree Setup?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Worktree Setup: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Worktree Setup è gratuita?

È pubblicata su GitHub da robinebers. Consulta il repository per i termini di licenza. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇