Your job is to help users merge changes from git worktrees into their current branch, supporting multiple merge strategies from simple file checkout to selective cherry-picking.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versiongit:merge-worktreeExecute the skills CLI command in your project's root directory to begin installation:
Fetches git:merge-worktree from neolabhq/context-engineering-kit and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate git:merge-worktree. Access via /git:merge-worktree in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
1
total installs
1
this week
765
GitHub stars
0
upvotes
Run in your terminal
1
installs
1
this week
765
stars
Your job is to help users merge changes from git worktrees into their current branch, supporting multiple merge strategies from simple file checkout to selective cherry-picking.
CRITICAL: Perform the following steps exactly as described:
Current state check: Run git worktree list to show all existing worktrees and git status to verify working directory state
Parse user input: Determine what merge operation the user wants:
--interactive or no arguments: Guided interactive mode--from <worktree>: Specify source worktree explicitly--patch or -p: Use interactive patch selection modeDetermine source worktree/branch:
a. If user specified --from <worktree>: Use that worktree path directly
b. If user specified a branch name: Find worktree for that branch from git worktree list
c. If only one other worktree exists: Ask to confirm using it as source
d. If multiple worktrees exist: Present list and ask user which to merge from
e. If no other worktrees exist: Explain and offer to use branch-based merge instead
Determine merge strategy: Present options based on user's needs:
Strategy A: Selective File Checkout (for specific files/directories)
git checkout <branch> -- <path>Strategy B: Interactive Patch Selection (for partial file changes)
git checkout -p <branch> -- <path>Strategy C: Cherry-Pick with Selective Staging (for specific commits)
git cherry-pick --no-commit <commit>git reset HEAD -- <unwanted-files> to unstagegit checkout -- <unwanted-files> to discardgit commit -m "message"Strategy D: Manual Merge with Conflicts (for complex merges)
git merge --no-commit <branch>git commit -m "message"Strategy E: Multi-Worktree Selective Merge (combining from multiple sources)
git checkout <branch1> -- <path1>git checkout <branch2> -- <path2>git commit -m "Merge selected files from multiple branches"Execute the selected strategy:
/git:compare-worktrees first)Post-merge summary: Display what was merged:
Cleanup prompt: After successful merge, ask:
git worktree remove <path> for selected worktreesgit worktree prune if needed| Strategy | Use When | Command Pattern |
|---|---|---|
| Selective File | Need complete file(s) from another branch | git checkout <branch> -- <path> |
| Interactive Patch | Need specific changes within a file | git checkout -p <branch> -- <path> |
| Cherry-Pick Selective | Need a commit but not all its changes | git cherry-pick --no-commit + selective staging |
| Manual Merge | Full branch merge with control | git merge --no-commit + selective staging |
| Multi-Source | Combining files from multiple branches | Multiple git checkout <branch> -- <path> |
Merge single file from worktree:
> /git:merge-worktree src/app.js --from ../project-feature
# Prompts for merge strategy
# Executes: git checkout feature-branch -- src/app.js
Interactive patch selection:
> /git:merge-worktree src/utils.js --patch
# Lists available worktrees to select from
# Runs: git checkout -p feature-branch -- src/utils.js
# User selects hunks interactively (y/n/s/e)
Cherry-pick specific commit:
> /git:merge-worktree abc1234
# Detects commit hash
# Asks: Apply entire commit or selective?
# If selective: git cherry-pick --no-commit abc1234
# Then guides through unstaging unwanted changes
Merge from multiple worktrees:
> /git:merge-worktree --interactive
# "Select files to merge from different worktrees:"
# "From feature-1: src/moduleA.js"
# "From feature-2: src/moduleB.js, src/moduleC.js"
# Executes selective checkouts from each
Full guided mode:
> /git:merge-worktree
# Lists all worktrees
# Asks what to merge (files, commits, or branches)
# Guides through appropriate strategy
# Offers cleanup at end
Directory merge with conflicts:
> /git:merge-worktree src/components/ --from ../project-refactor
# Strategy D: Manual merge with conflicts
# git merge --no-commit refactor-branch
# Helps resolve any conflicts
# Reviews and commits selected changes
When using --patch or Strategy B, the user sees prompts for each change hunk:
@@ -10,6 +10,8 @@ function processData(input) {
const result = transform(input);
+ // Added validation
+ if (!isValid(result)) throw new Error('Invalid');
return result;
}
Apply this hunk? [y,n,q,a,d,s,e,?]
| Key | Action |
|---|---|
y |
Apply this hunk |
n |
Skip this hunk |
q |
Quit (don't apply this or remaining hunks) |
a |
Apply this and all remaining hunks |
d |
Don't apply this or remaining hunks in this file |
s |
Split into smaller hunks |
e |
Manually edit the hunk |
? |
Show help |
For Strategy C (cherry-picking with selective staging):
# 1. Apply commit without committing
git cherry-pick --no-commit abc1234
# 2. Check what was staged
git status
# 3. Unstage files you don't want
git reset HEAD -- path/to/unwanted.js
# 4. Discard changes to those files
git checkout -- path/to/unwanted.js
# 5. Commit the remaining changes
git commit -m "Cherry-pick selected changes from abc1234"
For Strategy E (merging from multiple worktrees):
# Get files from different branches
git checkout feature-auth -- src/auth/login.js src/auth/session.js
git checkout feature-api -- src/api/endpoints.js
git checkout feature-ui -- src/components/Header.js
# Review all changes
git status
git diff --cached
# Commit combined changes
git commit -m "feat: combine auth, API, and UI improvements from feature branches"
> /git:merge-worktree src/new-feature.js --from ../project-feature
# Gets just the file, not the entire branch
> /git:merge-worktree --patch src/utils.js --from ../project-hotfix
# Select only the specific bug fix hunks, not all changes
> /git:merge-worktree --interactive
# Select specific files from PR-1 worktree
# Select other files from PR-2 worktree
# Combine into single coherent commit
# First review what will be merged
> /git:compare-worktrees src/module.js
# Then merge with confidence
> /git:merge-worktree src/module.js --from ../project-feature
Working directory state: Always ensure your working directory is clean before merging. Uncommitted changes can cause conflicts.
Pre-merge review: Consider using /git:compare-worktrees before merging to understand what changes will be applied.
Conflict resolution: If conflicts occur during merge, the command will help identify and resolve them before committing.
No-commit flag: Most strategies use --no-commit to give you control over the final commit message and what gets included.
Shared repository: All worktrees share the same Git object database, so commits made in any worktree are immediately visible to cherry-pick from any other.
Branch locks: Remember that branches can only be checked out in one worktree at a time. Use branch names for merge operations rather than creating duplicate worktrees.
After merging, consider cleaning up worktrees that are no longer needed:
# List worktrees
git worktree list
# Remove specific worktree (clean state required)
git worktree remove ../project-feature
# Force remove (discards uncommitted changes)
git worktree remove --force ../project-feature
# Clean up stale worktree references
git worktree prune
The command will prompt you about cleanup after each successful merge to help maintain a tidy workspace.
"Cannot merge: working directory has uncommitted changes"
git stash before merge, git stash pop after"Merge conflict in "
<<<<<<< markers)git add <file>git commit"Commit not found" when cherry-picking
git log <branch> in any worktree to find commits"Cannot checkout: file exists in working tree"
"Branch not found for worktree"
git worktree list to see current worktreesgit worktree prune to clean up stale referencesPre-merge review:
> /git:compare-worktrees src/
> /git:merge-worktree src/specific-file.js
Create worktree, merge, cleanup:
> /git:create-worktree feature-branch
> /git:compare-worktrees src/
> /git:merge-worktree src/module.js --from ../project-feature-branch
# After merge, cleanup is offered automatically
Make data-driven prioritization decisions faster
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Prerequisites
Time Estimate
30-60 minutes to see productivity improvements
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid when
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
mattpocock/skills
parcadei/continuous-claude-v3
cursor/plugins
ailabs-393/ai-labs-claude-skills
pproenca/dot-skills
mattpocock/skills
We added git:merge-worktree from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
We added git:merge-worktree from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
Useful defaults in git:merge-worktree — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
Solid pick for teams standardizing on skills: git:merge-worktree is focused, and the summary matches what you get after install.
git:merge-worktree is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
Registry listing for git:merge-worktree matched our evaluation — installs cleanly and behaves as described in the markdown.
git:merge-worktree reduced setup friction for our internal harness; good balance of opinion and flexibility.
git:merge-worktree reduced setup friction for our internal harness; good balance of opinion and flexibility.
Solid pick for teams standardizing on skills: git:merge-worktree is focused, and the summary matches what you get after install.
git:merge-worktree has been reliable in day-to-day use. Documentation quality is above average for community skills.
showing 1-10 of 66