mcpField
C
creating-worktrees

creating-worktrees

github.com/darknesskillerDevelopment0100 installsUpdated 3w ago
Repository

About creating-worktrees

A development skill for creating Git worktrees from existing or new branches. It handles repository-specific exclusion and optional CodeGraph setup, then reports the resulting state.

Key features

  1. 01Create a worktree from an existing branch
  2. 02Create a branch and worktree together
  3. 03Record .worktrees/ in Git’s local excludes
  4. 04Run CodeGraph init when applicable
  5. 05Report path and setup status

Use cases

  1. 01Create an isolated workspace for a task
  2. 02Start work on a new branch in a separate directory

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/darknesskiller/skills --skill creating-worktrees

After installing, type/creating-worktreesin Claude Code to confirm it loaded.

Bundled filesagents/openai.yaml

Details

From the project README

Creating Worktrees

Steps

  1. Find repo root: git rev-parse --show-toplevel.
  2. Get branch or task name; ask once if missing.
  3. Sanitize slug: replace /, spaces, unusual chars with -.
  4. Add .worktrees/ to $(git rev-parse --git-path info/exclude) if missing.
  5. Create: existing branch → git worktree add <path> <branch>; new branch → git worktree add -b <branch> <path>.
  6. codegraph init <path> only when source has .codegraph/ or user asks. Else CodeGraph: not applicable.
  7. Report path, branch, exclude status, CodeGraph result.

Output

End with a short report covering Report path/branch, Sanitized slug, Worktree exists, Exclusion, and CodeGraph status.

Completion: worktree exists, branch correct, exclusion recorded, CodeGraph reported.

Comments

Markdown supported