worktree-parallel
Create and manage a git worktree for parallel feature development, then open the new worktree in the editor (code/Cursor) for a second Codex session. Use when the user asks to work on another feature simultaneously, spin up a parallel workspace, or open a new worktree even if they do not mention worktree explicitly.
When & Why to Use This Skill
The worktree-parallel skill automates the creation and management of Git worktrees, enabling developers to engage in parallel feature development without the friction of branch switching or stashing. By seamlessly setting up isolated workspaces and launching them in editors like VS Code or Cursor, it optimizes multitasking workflows and maintains development context across multiple branches.
Use Cases
- Simultaneous Feature Development: Create a parallel workspace to start a new feature immediately while keeping your current work-in-progress active and untouched.
- Efficient Hotfixing: Quickly spin up a separate worktree to address an urgent production bug without needing to stash or commit incomplete changes on your primary branch.
- Isolated Code Reviews: Open a colleague's pull request in a dedicated worktree to run tests and review code in a clean environment while maintaining your own development state.
- Parallel Testing: Run long-running test suites or builds in one worktree while continuing to write code in another, maximizing hardware utilization and reducing idle time.
| name | worktree-parallel |
|---|---|
| description | Create and manage a git worktree for parallel feature development, then open the new worktree in the editor (code/Cursor) for a second Codex session. Use when the user asks to work on another feature simultaneously, spin up a parallel workspace, or open a new worktree even if they do not mention worktree explicitly. |
Worktree Parallel
Workflow
- Confirm the repo root (use current working directory unless the user specifies another repo).
- Determine a feature slug and branch name.
- Default branch pattern:
feat/<slug>. - If the user already has a branch name, use it.
- Default branch pattern:
- Choose a base directory for linked worktrees.
- Default for this repo:
../<project_name>-wt(create it if missing).
- Default for this repo:
- Create the worktree.
- New branch:
git worktree add -b feat/<slug> <base>/<slug> - Existing branch:
git worktree add <base>/<slug> <branch>
- New branch:
- Open the worktree in the editor.
- Use
code -n <path>(Cursor supports thecodeCLI). - If
codeis unavailable, ask for the preferred editor command (e.g.,cursor -n,code, or another).
- Use
- Suggest a parallel Codex session in the new worktree.
cd <path> && codex
- Confirm with
git worktree listif needed.
Safety
- Do not use
--forceunless the user explicitly asks. - Do not remove existing worktrees unless the user requests cleanup.
Optional Cleanup (only if asked)
git worktree remove <path>git branch -d <branch>