nv-worktree-create

Creates a sibling git worktree with a new branch, env files, and enterprise submodule setup.

39.7k|4.4k|Updated Aug 26, 2021
One-click install
npx skills add https://github.com/novuhq/novu --skill nv-worktree-create
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nv-worktree-create
Source: https://github.com/novuhq/novu/tree/main/.cursor/skills/nv-worktree-create
Command: npx skills add https://github.com/novuhq/novu --skill nv-worktree-create

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Setting up a parallel working environment for a new branch normally requires manually creating a git worktree, copying local environment files, initializing submodules, and wiring symlinks. This Skill automates that entire sequence so a developer can start working in an isolated checkout immediately.

Core Features & Use Cases

  • Worktree and branch creation: Creates a new branch and a sibling worktree at ../<name> from the current HEAD or a specified base ref, with preflight checks for existing paths and dirty working trees.
  • Environment file copying: Copies local .env* files (gitignored secrets only) into the worktree using rsync, without regenerating encryption keys.
  • Enterprise submodule wiring: Links an existing packages-enterprise clone or shallow-initializes the .source submodule with HTTPS fallback, then refreshes symlinks, falling back to OSS mode on failure.
  • Use Case: A developer asks for /worktree branch=more-dcr-oauths and receives a ready-to-use sibling checkout with env files and enterprise symlinks configured, while the agent moves into the new worktree.

Quick Start

Ask the agent to create a worktree by providing a branch name, for example: create a worktree for the branch feature-oauth-flow.

Frequently Asked Questions about nv-worktree-create

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

FAQPage Schema
How do I create a git worktree with a new branch?

Run git worktree add -b <branch> <path> to create a new branch and check it out in a sibling directory. This Skill automates that command plus preflight checks, env file copying, and submodule setup in one step.

How do I copy .env files into a new git worktree?

Use rsync to copy only gitignored .env files from the main checkout into the worktree, excluding .env.example. This Skill does that automatically and avoids running setup scripts that would regenerate encryption keys.

Can I create a worktree from a specific base ref instead of HEAD?

Yes, pass a base ref as an optional input and the worktree branches from that ref instead of the current HEAD. If omitted, the new branch is created from the current HEAD by default.

What happens if the enterprise submodule setup fails?

The Skill treats enterprise submodule setup as best-effort and continues in OSS mode with a warning if linking or initialization fails. It never blocks the worktree handoff, and troubleshooting details are available in the enterprise-submodule reference.

Why does the worktree creation abort with a dirty working tree?

The preflight step runs git status --porcelain and warns when uncommitted changes exist, asking for confirmation before proceeding. It also aborts if the target worktree path already exists in git worktree list.