All skills
lexler avatar

/git-worktrees

@83aee6a
by Lada Kesselerlexler/skill-factory238 stars
61

Creates git worktrees for parallel development. Use when creating a git worktree, setting up multiple working directories, or working on features in parallel.

Use this Skill: https://skilld.dev/gh/lexler/skill-factory/git-worktrees

This session only. Nothing lands on disk.

SKILL.md

≈43 tokens always: the name and description. ≈266 when used: this file.

Git Worktrees

Directory Convention

Worktrees live in a sibling directory named <project>_worktrees:

parent/
├── myproject/              # main repo
└── myproject_worktrees/    # worktrees directory
    ├── feature_1/
    └── feature_2/

Branch Naming

Use <feature>_<N> pattern when creating multiple worktrees:

  • auth-refactor_1, auth-refactor_2
  • api-migration_1, api-migration_2

Workflow

  1. Get project name from current directory
  2. Create worktrees directory if needed: ../<project>_worktrees/
  3. Create worktree with new branch: git worktree add <path> -b <branch>

Creating Multiple Worktrees

When asked for N worktrees for a feature:

PROJECT=$(basename "$PWD")
WORKTREES_DIR="../${PROJECT}_worktrees"
mkdir -p "$WORKTREES_DIR"

for i in $(seq 1 N); do
    git worktree add "${WORKTREES_DIR}/<feature>_${i}" -b "<feature>_${i}"
done

Cleanup

Remove worktree and branch:

git worktree remove <path>
git branch -d <branch>

List all worktrees: git worktree list

Source: SKILL.md on GitHub

1 warning6d4 checks · Risk SAFE
  • Gen Agent Trust Hub6d

    The skill provides standard Git worktree management capabilities and does not contain any malicious patterns, data exfiltration, or suspicious external dependencies.

  • Socket6d

    No alerts

  • Snyk6d

    Risk: LOW · No issues

  • Runlayer7mo

    1/1 file flagged

Signed by skilld at 83aee6a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 8 months ago

README badge

README badge for lexler/skill-factory/git-worktrees