Receber por email
← Voltar para o catálogo

using-git-worktrees

Use when starting feature work that needs isolation or before executing implementation plans — creates isolated git worktrees

39estrelas
Atualizado há 4 meses

Ver no GitHub ↗ Licença: MIT

Como adicionar

/plugin marketplace add adriannoes/awesome-vibe-coding

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/using-git-worktrees-adriannoes/svg)](https://www.skillteca.com.br/skills/using-git-worktrees-adriannoes)

Skills relacionadas

Ver todas de Pesquisa e Web →

Alerta por categoria

Receba novas skills de Pesquisa e Web toda segunda

1 email curto, só com as skills novas de Pesquisa e Web. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

Using Git Worktrees

Source: obra/superpowers (MIT)

Overview

Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.

Core principle: Systematic directory selection + safety verification = reliable isolation.

Announce at start: "I'm using the using-git-worktrees skill to set up an isolated workspace."

Directory Selection

Follow this priority order:

  1. Check existing: .worktrees/ or worktrees/ (prefer .worktrees)
  2. Check project config: Look for worktree directory preference in CLAUDE.md, AGENTS.md, or similar
  3. Ask user if no directory exists and no preference found

Safety Verification (Project-Local)

MUST verify directory is ignored before creating worktree:

git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null

If NOT ignored: Add to .gitignore, commit, then proceed. Prevents accidentally committing worktree contents.

Creation Steps

1. Create Worktree

# Determine path (e.g., .worktrees/<branch-name>)
git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"

2. Run Project Setup

Auto-detect and run appropriate setup:

# Node.js
if [ -f package.json ]; then npm install; fi

# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi

# Rust, Go, etc.

3. Verify Clean Baseline

Run tests to ensure worktree starts clean:

npm test / pytest / cargo test / go test ./...

If tests fail: Report failures, ask whether to proceed or investigate.

If tests pass: Report ready.

4. Report Location

Worktree ready at <full-path>
Tests passing (<N> tests, 0 failures)
Ready to implement <feature-name>

Red Flags

Never:

  • Create worktree without verifying it's ignored (project-local)
  • Skip baseline test verification
  • Proceed with failing tests without asking

Always:

  • Verify directory is ignored for project-local
  • Auto-detect and run project setup
  • Verify clean test baseline

Integration

Pairs with: finishing-a-development-branch — cleanup worktree after work complete.

Compartilhar X LinkedIn