worktree

Automate git worktree setup and teardown for Node.js monorepos.

Updated Jan 10, 2026
One-click install
npx skills add https://github.com/dain-agency/mood-tracker --skill worktree-dain-agency
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/dain-agency/mood-tracker/tree/main/.claude/skills/worktree
Command: npx skills add https://github.com/dain-agency/mood-tracker --skill worktree-dain-agency

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Setting up and tearing down git worktrees for Node.js feature development is error-prone and time-consuming, with common breakpoints including missing gitignored environment files, stale ORM generated clients, dev servers from other worktrees holding port or directory locks, and missing workspace package build artifacts that require manual fixes every time.

Core Features & Use Cases

  • Full lifecycle automation: Handles both new worktree setup for feature branches and safe teardown after PR merges, with guardrails to prevent accidental data loss.
  • Auto-detection of project stack: Automatically identifies the package manager (npm, pnpm, yarn), ORM type (Prisma, Drizzle, or none), and workspace package structure to apply the correct setup steps without manual configuration.
  • Use case: When starting work on a new feature branch, use this skill to generate a fully functional worktree in seconds, with all dependencies, environment files, and generated code ready to use, instead of spending 10+ minutes troubleshooting missing files and stale clients.

Quick Start

Use the worktree skill to create a ready-to-code git worktree for your current feature branch, or safely remove a worktree and its associated branch after you have merged its changes into the main codebase.

Frequently Asked Questions about worktree

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

FAQPage Schema
How do I set up a git worktree for a Node.js monorepo without missing environment files?

Git worktree setup for Node.js monorepos can automatically mirror gitignored environment files and hardlink node_modules. This prevents missing configuration files and avoids redundant dependency installations when creating feature branch worktrees.

Does git worktree automation support Node projects using Prisma or Drizzle?

Git worktree automation supports Node.js projects using Prisma, Drizzle, or no ORM. It automatically detects the ORM type and regenerates stale clients during worktree setup, ensuring your database queries run without manual client regeneration steps.

What is the best way to clean up a git worktree and delete its branch after a PR merge?

The best way to clean up a git worktree after a PR merge is using automated teardown with dev server process cleanup and verified branch deletion. This safe removal process includes guardrails to prevent accidental data loss while clearing port locks.

Why does my dev server hold port locks when using multiple git worktrees?

Dev servers from other git worktrees often hold port or directory locks because they remain running in the background. Automated worktree teardown resolves this by safely cleaning up dev server processes before removing the worktree directory.

Can I use git worktree automation with npm, pnpm, or yarn workspaces?

Git worktree automation fully supports npm, pnpm, and yarn workspaces in both single-app and multi-app project layouts. It auto-detects your package manager to apply the correct workspace setup steps without requiring manual configuration.