worktree-manager

Configure Cursor worktrees for parallel agents with setup and cleanup controls.

Updated Feb 23, 2019
One-click install
npx skills add https://github.com/JohnWebb4/dotfiles --skill worktree-manager-johnwebb4
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree-manager
Source: https://github.com/JohnWebb4/dotfiles/tree/main/.cursor/skills/worktree-manager
Command: npx skills add https://github.com/JohnWebb4/dotfiles --skill worktree-manager-johnwebb4

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Configure Cursor's built-in worktree handling for parallel agents to ensure predictable workflows and cleanup across teams.

Core Features & Use Cases

  • Customizable worktree setup: define per-repo worktree behavior, including optional environment and dependency steps.
  • Worktree cleanup controls: adjust max counts and automatic cleanup behavior to prevent workspace sprawl.
  • Inspect and manage worktrees: list and review Cursor-created worktrees and merge changes back when ready.

Quick Start

Edit .cursor/worktrees.json to customize setup-worktree commands and environment handling, then run a parallel agent to create and manage a worktree.

Frequently Asked Questions about worktree-manager

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

FAQPage Schema
How do I configure Cursor worktrees for parallel agents?

Cursor worktrees are configured via the .cursor/worktrees.json file, which lets you define custom setup commands, environment variables, and dependency steps for parallel agents. Optional scripts in the .cursor directory automate environment setup across different operating systems.

What is the best way to manage and clean up git worktrees created by parallel agents?

Git worktree cleanup is managed by adjusting max counts and automatic cleanup behavior in .cursor/worktrees.json. This prevents workspace sprawl by automatically removing stale worktrees after parallel agents finish their tasks.

How do I inspect and merge changes from a Cursor worktree back to the main branch?

You can inspect and merge Cursor worktrees by listing active worktrees to review changes, then merging them back to your main branch when ready. The Skill provides clear guidance on tracking and integrating parallel agent modifications.

Can I run custom dependency and environment setup steps for each parallel agent worktree?

Yes, per-repo worktree behavior supports custom dependency and environment steps. By defining setup-worktree commands and environment handling in .cursor/worktrees.json, you ensure consistent environment setup for each parallel agent across different operating systems.

Why do my parallel agent worktrees lack the correct environment variables and dependencies?

Parallel agent worktrees lack environment variables when custom setup steps are not defined. You must configure dependency installation and .env file handling in .cursor/worktrees.json to ensure consistent environment setup across all worktrees.

Does worktree-manager work with Best-of-N workflows in Cursor?

Yes, worktree-manager applies to scenarios running parallel agents or Best-of-N workflows in Cursor. It ensures predictable environment setup, automated cleanup controls, and consistent worktree management across these parallel execution scenarios.