create-worktree

Create isolated Git worktrees from a base branch with conflict checks.

Updated Feb 28, 2026
One-click install
npx skills add https://github.com/cosmicdreams/claude-plugins --skill create-worktree-cosmicdreams
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-worktree
Source: https://github.com/cosmicdreams/claude-plugins/tree/main/admin/skills/create-worktree
Command: npx skills add https://github.com/cosmicdreams/claude-plugins --skill create-worktree-cosmicdreams

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill prevents messy, conflicting changes by creating an isolated Git worktree for a specific issue or feature so development stays contained and easy to review.

Core Features & Use Cases

  • Isolated worktree creation: Creates a dedicated worktree directory and branch from a specified base branch (defaulting to HEAD).
  • Safety guardrails: Validates required inputs, refuses to overwrite existing paths, checks for branch/base existence, and fails fast on errors.
  • Repo-specific baseline protection: Syncs phpcs.xml from main to the new worktree to preserve JS/CSS exclude-patterns and avoid phpcbf regressions.

Quick Start

Ask: create a worktree for issue 2901667 with base branch main.

Frequently Asked Questions about create-worktree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an isolated Git worktree for a specific issue?

To create an isolated Git worktree, run the command from the main worktree directory, specifying the issue number and base branch to generate a dedicated working directory and branch for contained development.

Why does my phpcs.xml exclude pattern get lost when creating a new Git worktree?

Git worktree creation normally copies only tracked files, but this Skill specifically syncs phpcs.xml exclude patterns from the main branch to preserve JS/CSS rules and prevent phpcbf regressions in the new directory.

Does Git worktree creation support Drupal-specific development flows?

Yes, Git worktree creation supports Drupal-focused workflows by verifying main-derived configuration and syncing phpcs.xml exclude patterns to ensure a consistent coding standard baseline across isolated issue branches.

What happens if a Git worktree path or branch already exists?

If a Git worktree path or branch already exists, the creation process enforces safety guardrails by refusing to overwrite existing paths and failing fast to prevent workspace collisions.

How do I prevent workspace collisions when using multiple Git worktrees?

Workspace collisions are prevented by validating required parameters, checking for existing path and branch conflicts before creation, and ensuring the process runs from the main worktree directory.

Will my Git user configuration carry over to a new worktree?

Yes, Git user configuration is automatically propagated to the new worktree during creation to ensure commits in the isolated branch use the correct author identity.