Back to list
LerianStudio

ringusing-git-worktrees

by LerianStudio

1🍴 0📅 Jan 22, 2026

SKILL.md


name: "ring:using-git-worktrees" description: | Isolated workspace creation - creates git worktrees with smart directory selection and safety verification for parallel feature development. license: MIT compatibility: opencode metadata: trigger: "Starting feature needing isolation, before executing plan, multiple features" skip_when: "Quick fix in current branch, already in worktree, repo doesn't use worktrees" sequence_after: "ring:brainstorming" sequence_before: "ring:writing-plans, ring:executing-plans"

Using Git Worktrees

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 ring:using-git-worktrees skill to set up an isolated workspace."

Directory Selection Process

Priority order: (1) Existing .worktrees/ or worktrees/ (2) CLAUDE.md preference (3) Ask user

ls -d .worktrees worktrees 2>/dev/null   # Check existing (prefer .worktrees)
grep -i "worktree.*director" CLAUDE.md    # Check project preference

If none found, ask: .worktrees/ (project-local, hidden) OR ~/.config/ring/worktrees/<project>/ (global)

Safety Verification

Project-local directories: MUST verify .gitignore before creating: grep -q "^\.worktrees/$\|^worktrees/$" .gitignore

  • If NOT in .gitignore: Add it -> commit -> proceed (fix broken things immediately)
  • Why critical: Prevents accidentally committing worktree contents

Global directory (~/.config/ring/worktrees): No verification needed - outside project.

Creation Steps

# 1. Detect project
project=$(basename "$(git rev-parse --show-toplevel)")

# 2. Create worktree (path = $LOCATION/$BRANCH or ~/.config/ring/worktrees/$project/$BRANCH)
git worktree add "$path" -b "$BRANCH_NAME" && cd "$path"

# 3. Auto-detect and run setup
[ -f package.json ] && npm install
[ -f Cargo.toml ] && cargo build
[ -f requirements.txt ] && pip install -r requirements.txt
[ -f pyproject.toml ] && poetry install
[ -f go.mod ] && go mod download

# 4. Verify clean baseline (npm test / cargo test / pytest / go test ./...)

If tests fail: Report failures, ask whether to proceed or investigate. If tests pass: Report: Worktree ready at <path> | Tests passing (<N> tests) | Ready to implement <feature>

Quick Reference

SituationAction
.worktrees/ existsUse it (verify .gitignore)
worktrees/ existsUse it (verify .gitignore)
Both existUse .worktrees/
Neither existsCheck CLAUDE.md -> Ask user
Directory not in .gitignoreAdd it immediately + commit
Tests fail during baselineReport failures + ask
No package.json/Cargo.tomlSkip dependency install

Common Mistakes

MistakeProblemFix
Skip .gitignore verificationWorktree contents tracked, pollute git statusAlways grep .gitignore first
Assuming directory locationInconsistency, violates conventionsFollow priority: existing > CLAUDE.md > ask
Proceeding with failing testsCan't distinguish new vs pre-existing bugsReport failures, get permission
Hardcoding setup commandsBreaks on different toolsAuto-detect from project files

Example Workflow

Announce -> Check .worktrees/ exists -> Verify .gitignore -> git worktree add .worktrees/auth -b feature/auth -> npm install -> npm test (47 passing) -> Report ready

Red Flags

Never:

  • Create worktree without .gitignore verification (project-local)
  • Skip baseline test verification
  • Proceed with failing tests without asking
  • Assume directory location when ambiguous
  • Skip CLAUDE.md check

Always:

  • Follow directory priority: existing > CLAUDE.md > ask
  • Verify .gitignore for project-local
  • Auto-detect and run project setup
  • Verify clean test baseline

Integration

Called by:

  • ring:brainstorming (Phase 4) - REQUIRED when design is approved and implementation follows
  • Any skill needing isolated workspace

Pairs with:

  • ring:executing-plans - Work happens in this worktree

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon