Logo di Dev.Worktrees

Dev.Worktrees

Community
kevinslin
dev.worktrees

Create, inspect, remove, or transactionally clean landed Git worktrees.

Panoramica

Autorekevinslin
Repositoryagstack
Nome della skilldev.worktrees
Stelle
26
Fork
1
File inclusi
2
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.

  • 2 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

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

Installazione

Installa la skill IA Dev.Worktrees 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/kevinslin/agstack/tree/main/active/dev.worktrees
  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/kevinslin/agstack.git /tmp/agstack
mkdir -p .claude/skills
cp -r /tmp/agstack/active/dev.worktrees .claude/skills/dev.worktrees
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Dev.Worktrees 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 Dev.Worktrees 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 Dev.Worktrees 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à.

dev.worktrees

Overview

Create and manage Git worktrees under ~/.worktrees. Use cleanup-landed only after a caller has independently proved that the work landed and may be discarded.

Conventions

  • Resolve the repo name from the main repo directory basename (folder containing .git), unless the user provides an override.
  • Always store worktrees under ~/.worktrees/<repo>/<branch-name>.
  • Keep the branch name as-is; if it contains /, it naturally becomes nested folders.
  • Run worktree commands from the main repo unless the user specifies a different worktree.
  • If the user requests a different location, confirm the deviation before proceeding.
  • Use absolute paths for removal and cleanup targets.
  • Never remove the current, primary, locked, or dirty worktree through the ordinary removal path.

Quick Tasks

Create worktree for an existing branch

bash
mkdir -p ~/.worktrees/<repo>
git worktree add ~/.worktrees/<repo>/<branch-name> <branch-name>

Create worktree for a new branch

bash
mkdir -p ~/.worktrees/<repo>
git worktree add -b <branch-name> ~/.worktrees/<repo>/<branch-name> [start-point]

List worktrees

bash
git worktree list --porcelain

Ordinary Removal

Use ordinary removal only when the worktree is already clean and unlocked. Inspect tracked and untracked state immediately before removal. If it is dirty, stop and preserve it; do not force removal or infer that its contents landed.

bash
git -C <worktree> status --short
git -C <repo> worktree remove <absolute-worktree-path>

Delete the local branch only when the caller separately established that it is no longer needed:

bash
git -C <repo> branch -d -- <branch-name>

cleanup-landed

Use ./scripts/cleanup_worktree.py to remove one exact worktree and its local branch after the caller has proved the change landed. This path is destructive: it resets tracked changes and deletes untracked and ignored files before removing the worktree.

Before invoking it, record:

  • a retained repository checkout outside the target worktree;
  • the exact absolute target path, or --no-worktree for a branch checked out nowhere;
  • the expected local branch or detached state;
  • the full expected HEAD object ID;
  • a refreshed local base branch;
  • the full landed commit object ID contained by that base; and
  • the actual merge mode: merge, squash, or rebase.

Run a dry run first and require JSON status ready or noop:

bash
python3 ./scripts/cleanup_worktree.py \
  --repo <retained-checkout> \
  --worktree <absolute-worktree-path> \
  --expected-branch <branch> \
  --expected-head <full-object-id> \
  --base-ref <refreshed-local-base-branch> \
  --landed-commit <full-landed-object-id> \
  --merge-mode <merge|squash|rebase>

Rerun the exact command with --execute. Require final JSON status complete or noop, with the path, registration, and local branch absent and the base still containing the landed commit.

  • Replace --expected-branch <branch> with --detached for a detached target.
  • Replace --worktree <path> with --no-worktree for branch-only cleanup; detached cleanup is invalid in that mode.
  • Treat blocked, partial, a nonzero exit, identity drift, or failed postconditions as a cleanup blocker.
  • Preserve the reported journal after partial execution and rerun the exact command after resolving the blocker.
  • If matching legacy and current journals both exist, stop and reconcile them; the executor fails closed rather than choosing one.
  • Do not reproduce the reset, clean, removal, orphan recovery, or branch deletion steps manually.

The script serializes each target, revalidates identity under the lock, and journals new transactions under the Git common directory's worktree-cleanup/ directory. It resumes matching legacy fin-cleanup/ journals in place. It never refreshes the base, proves external finalization, runs repository hooks, prunes unrelated registrations, or mutates remote branches; callers own those policies.

Prune Stale Metadata

Prune only when the user explicitly requests repository-wide stale metadata cleanup. Preview first and do not use pruning as a substitute for targeted removal or journal recovery.

bash
git -C <repo> worktree prune --dry-run
git -C <repo> worktree prune

Notes

  • Never place worktrees inside the main repo or other worktrees.
  • Prefer explicit paths and branch names in responses to avoid ambiguity.
  • Keep bulk Codex worktree garbage collection in codex-clean-worktrees; cleanup-landed owns one exact, proof-locked transaction.

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Dev.Worktrees?

Create, inspect, remove, or transactionally clean landed Git worktrees.

Perché usare Dev.Worktrees su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Dev.Worktrees è 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 Dev.Worktrees in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/kevinslin/agstack/tree/main/active/dev.worktrees. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Dev.Worktrees?

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 Dev.Worktrees?

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

La skill IA Dev.Worktrees è gratuita?

È pubblicata su GitHub da kevinslin. 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 👇