Automates the git worktree merge process including PR verification, branch synchronization, and VS Code workspace cleanup.
The worktree-merge skill provides a robust, safety-first workflow for integrating feature worktrees back into a primary branch within a development environment. It streamlines the integration process by verifying Pull Request status to prevent premature merges, ensuring the base branch is synced with origin to minimize conflicts, and automatically removing the worktree from VS Code workspace files post-merge. This end-to-end automation ensures a clean development environment and prevents the accumulation of orphaned directories and stale configurations in complex project structures.
Key Features
01Base Branch Synchronization: Automatically syncs the main branch with origin before merging to reduce conflict risk.
020 GitHub stars
03Intelligent Auto-detection: Automatically resolves repository and worktree names from the current working directory path.
04Automated Environment Cleanup: Removes worktree folders from VS Code workspace files and local directories post-merge.
05PR Status Verification: Blocks merges if a Pull Request is still open or in a non-draft state.
06Dry-Run Mode: Preview all planned git operations and workspace modifications without executing changes.
Use Cases
01Automating the teardown of temporary development environments after code review and integration.
02Safely merging worktree code while ensuring the local primary branch is up-to-date with remote changes.
03Integrating a completed feature branch and cleaning up the devcontainer workspace in a single command.