[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DR582NAQN6XHGVFKPWS2ZE":3,"skill-same:01M6DR582NAQN6XHGVFKPWS2ZE":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":49,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":51,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":52,"install":53,"resources":66},"01M6DR582NAQN6XHGVFKPWS2ZE","git:merge-worktree",null,"Merge changes from worktrees into current branch with selective file checkout, cherry-picking, interactive patch selection, or manual merge","AntifragileTech\u002Fantifragile-claude-code","AntifragileTech","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F174357194?v=4","01M6DQCYMK4CDSQQAN0ZC72NTV","01M6DQCYS9YPW1WKMQ5TJMPQ43",9,"MIT","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fdev\u002Fmerge-worktree\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"merge","git:merge worktree","worktree","git","git branch","git merge","file","Bash","git worktree","pick","branch","interactive","diff","patch","log","restore","selection","git log","reset","commit","2026-11-10 10:12:30",false,"---\nname: git:merge-worktree\ndescription: Merge changes from worktrees into current branch with selective file checkout, cherry-picking, interactive patch selection, or manual merge\nargument-hint: file\u002Fdirectory path, commit name, branch name, or --interactive for guided mode\nmodel: opus\nallowed-tools: Bash(git worktree:*), Bash(git branch:*), Bash(git diff:*), Bash(git status:*), Bash(git checkout:*), Bash(git cherry-pick:*), Bash(git merge:*), Bash(git reset:*), Bash(git log:*), Bash(git restore:*), Bash(git add:*), Bash(ls:*), Bash(pwd:*), Bash(diff:*)\n---\n\n# Claude Command: Merge Worktree\n\nYour 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.\n\n## Instructions\n\nCRITICAL: Perform the following steps exactly as described:\n\n1. **Current state check**: Run `git worktree list` to show all existing worktrees and `git status` to verify working directory state\n\n2. **Parse user input**: Determine what merge operation the user wants:\n   - **`--interactive` or no arguments**: Guided interactive mode\n   - **File\u002Fdirectory path**: Merge specific file(s) or directory from a worktree\n   - **Commit name**: Cherry-pick a specific commit\n   - **Branch name**: Merge from that branch's worktree\n   - **`--from \u003Cworktree>`**: Specify source worktree explicitly\n   - **`--patch` or `-p`**: Use interactive patch selection mode\n\n3. **Determine source worktree\u002Fbranch**:\n   a. If user specified `--from \u003Cworktree>`: Use that worktree path directly\n   b. If user specified a branch name: Find worktree for that branch from `git worktree list`\n   c. If only one other worktree exists: Ask to confirm using it as source\n   d. If multiple worktrees exist: Present list and ask user which to merge from\n   e. If no other worktrees exist: Explain and offer to use branch-based merge instead\n\n4. **Determine merge strategy**: Present options based on user's needs:\n\n   **Strategy A: Selective File Checkout** (for specific files\u002Fdirectories)\n   - Best for: Getting complete file(s) from another branch\n   - Command: `git checkout \u003Cbranch> -- \u003Cpath>`\n\n   **Strategy B: Interactive Patch Selection** (for partial file changes)\n   - Best for: Selecting specific hunks\u002Flines from a file\n   - Command: `git checkout -p \u003Cbranch> -- \u003Cpath>`\n   - Prompts user for each hunk: y (apply), n (skip), s (split), e (edit)\n\n   **Strategy C: Cherry-Pick with Selective Staging** (for specific commits)\n   - Best for: Applying a commit but excluding some changes\n   - Steps:\n     1. `git cherry-pick --no-commit \u003Ccommit>`\n     2. Review staged changes\n     3. `git reset HEAD -- \u003Cunwanted-files>` to unstage\n     4. `git checkout -- \u003Cunwanted-files>` to discard\n     5. `git commit -m \"message\"`\n\n   **Strategy D: Manual Merge with Conflicts** (for complex merges)\n   - Best for: Full branch merge with control over resolution\n   - Steps:\n     1. `git merge --no-commit \u003Cbranch>`\n     2. Review all changes\n     3. Selectively stage\u002Funstage files\n     4. Resolve conflicts if any\n     5. `git commit -m \"message\"`\n\n   **Strategy E: Multi-Worktree Selective Merge** (combining from multiple sources)\n   - Best for: Taking different files from different worktrees\n   - Steps:\n     1. `git checkout \u003Cbranch1> -- \u003Cpath1>`\n     2. `git checkout \u003Cbranch2> -- \u003Cpath2>`\n     3. `git commit -m \"Merge selected files from multiple branches\"`\n\n5. **Execute the selected strategy**:\n   - Run pre-merge comparison if user wants to review (suggest `\u002Fgit:compare-worktrees` first)\n   - Execute git commands for the chosen strategy\n   - Handle any conflicts that arise\n   - Confirm changes before final commit\n\n6. **Post-merge summary**: Display what was merged:\n   - Files changed\u002Fadded\u002Fremoved\n   - Source worktree\u002Fbranch\n   - Merge strategy used\n\n7. **Cleanup prompt**: After successful merge, ask:\n   - \"Would you like to remove any worktrees to clean up local state?\"\n   - If yes: List worktrees and ask which to remove\n   - Execute `git worktree remove \u003Cpath>` for selected worktrees\n   - Remind about `git worktree prune` if needed\n\n## Merge Strategies Reference\n\n| Strategy | Use When | Command Pattern |\n|----------|----------|-----------------|\n| **Selective File** | Need complete file(s) from another branch | `git checkout \u003Cbranch> -- \u003Cpath>` |\n| **Interactive Patch** | Need specific changes within a file | `git checkout -p \u003Cbranch> -- \u003Cpath>` |\n| **Cherry-Pick Selective** | Need a commit but not all its changes | `git cherry-pick --no-commit` + selective staging |\n| **Manual Merge** | Full branch merge with control | `git merge --no-commit` + selective staging |\n| **Multi-Source** | Combining files from multiple branches | Multiple `git checkout \u003Cbranch> -- \u003Cpath>` |\n\n## Examples\n\n**Merge single file from worktree:**\n```bash\n> \u002Fgit:merge-worktree src\u002Fapp.js --from ..\u002Fproject-feature\n# Prompts for merge strategy\n# Executes: git checkout feature-branch -- src\u002Fapp.js\n```\n\n**Interactive patch selection:**\n```bash\n> \u002Fgit:merge-worktree src\u002Futils.js --patch\n# Lists available worktrees to select from\n# Runs: git checkout -p feature-branch -- src\u002Futils.js\n# User selects hunks interactively (y\u002Fn\u002Fs\u002Fe)\n```\n\n**Cherry-pick specific commit:**\n```bash\n> \u002Fgit:merge-worktree abc1234\n# Detects commit hash\n# Asks: Apply entire commit or selective?\n# If selective: git cherry-pick --no-commit abc1234\n# Then guides through unstaging unwanted changes\n```\n\n**Merge from multiple worktrees:**\n```bash\n> \u002Fgit:merge-worktree --interactive\n# \"Select files to merge from different worktrees:\"\n# \"From feature-1: src\u002FmoduleA.js\"\n# \"From feature-2: src\u002FmoduleB.js, src\u002FmoduleC.js\"\n# Executes selective checkouts from each\n```\n\n**Full guided mode:**\n```bash\n> \u002Fgit:merge-worktree\n# Lists all worktrees\n# Asks what to merge (files, commits, or branches)\n# Guides through appropriate strategy\n# Offers cleanup at end\n```\n\n**Directory merge with conflicts:**\n```bash\n> \u002Fgit:merge-worktree src\u002Fcomponents\u002F --from ..\u002Fproject-refactor\n# Strategy D: Manual merge with conflicts\n# git merge --no-commit refactor-branch\n# Helps resolve any conflicts\n# Reviews and commits selected changes\n```\n\n## Interactive Patch Mode Guide\n\nWhen using `--patch` or Strategy B, the user sees prompts for each change hunk:\n\n```\n@@ -10,6 +10,8 @@ function processData(input) {\n   const result = transform(input);\n+  \u002F\u002F Added validation\n+  if (!isValid(result)) throw new Error('Invalid');\n   return result;\n }\nApply this hunk? [y,n,q,a,d,s,e,?]\n```\n\n| Key | Action |\n|-----|--------|\n| `y` | Apply this hunk |\n| `n` | Skip this hunk |\n| `q` | Quit (don't apply this or remaining hunks) |\n| `a` | Apply this and all remaining hunks |\n| `d` | Don't apply this or remaining hunks in this file |\n| `s` | Split into smaller hunks |\n| `e` | Manually edit the hunk |\n| `?` | Show help |\n\n## Cherry-Pick Selective Workflow\n\nFor Strategy C (cherry-picking with selective staging):\n\n```bash\n# 1. Apply commit without committing\ngit cherry-pick --no-commit abc1234\n\n# 2. Check what was staged\ngit status\n\n# 3. Unstage files you don't want\ngit reset HEAD -- path\u002Fto\u002Funwanted.js\n\n# 4. Discard changes to those files\ngit checkout -- path\u002Fto\u002Funwanted.js\n\n# 5. Commit the remaining changes\ngit commit -m \"Cherry-pick selected changes from abc1234\"\n```\n\n## Multi-Worktree Merge Workflow\n\nFor Strategy E (merging from multiple worktrees):\n\n```bash\n# Get files from different branches\ngit checkout feature-auth -- src\u002Fauth\u002Flogin.js src\u002Fauth\u002Fsession.js\ngit checkout feature-api -- src\u002Fapi\u002Fendpoints.js\ngit checkout feature-ui -- src\u002Fcomponents\u002FHeader.js\n\n# Review all changes\ngit status\ngit diff --cached\n\n# Commit combined changes\ngit commit -m \"feat: combine auth, API, and UI improvements from feature branches\"\n```\n\n## Common Workflows\n\n### Take a Feature File Without Full Merge\n```bash\n> \u002Fgit:merge-worktree src\u002Fnew-feature.js --from ..\u002Fproject-feature\n# Gets just the file, not the entire branch\n```\n\n### Partial Bugfix from Hotfix Branch\n```bash\n> \u002Fgit:merge-worktree --patch src\u002Futils.js --from ..\u002Fproject-hotfix\n# Select only the specific bug fix hunks, not all changes\n```\n\n### Combine Multiple PRs' Changes\n```bash\n> \u002Fgit:merge-worktree --interactive\n# Select specific files from PR-1 worktree\n# Select other files from PR-2 worktree\n# Combine into single coherent commit\n```\n\n### Pre-Merge Review\n```bash\n# First review what will be merged\n> \u002Fgit:compare-worktrees src\u002Fmodule.js\n# Then merge with confidence\n> \u002Fgit:merge-worktree src\u002Fmodule.js --from ..\u002Fproject-feature\n```\n\n## Important Notes\n\n- **Working directory state**: Always ensure your working directory is clean before merging. Uncommitted changes can cause conflicts.\n\n- **Pre-merge review**: Consider using `\u002Fgit:compare-worktrees` before merging to understand what changes will be applied.\n\n- **Conflict resolution**: If conflicts occur during merge, the command will help identify and resolve them before committing.\n\n- **No-commit flag**: Most strategies use `--no-commit` to give you control over the final commit message and what gets included.\n\n- **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.\n\n- **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.\n\n## Cleanup After Merge\n\nAfter merging, consider cleaning up worktrees that are no longer needed:\n\n```bash\n# List worktrees\ngit worktree list\n\n# Remove specific worktree (clean state required)\ngit worktree remove ..\u002Fproject-feature\n\n# Force remove (discards uncommitted changes)\ngit worktree remove --force ..\u002Fproject-feature\n\n# Clean up stale worktree references\ngit worktree prune\n```\n\nThe command will prompt you about cleanup after each successful merge to help maintain a tidy workspace.\n\n## Troubleshooting\n\n**\"Cannot merge: working directory has uncommitted changes\"**\n- Commit or stash your current changes first\n- Or use `git stash` before merge, `git stash pop` after\n\n**\"Merge conflict in \u003Cfile>\"**\n- The command will show conflicted files\n- Open files and resolve conflicts (look for `\u003C\u003C\u003C\u003C\u003C\u003C\u003C` markers)\n- Stage resolved files with `git add \u003Cfile>`\n- Continue with `git commit`\n\n**\"Commit not found\" when cherry-picking**\n- Ensure the commit hash is correct\n- Run `git log \u003Cbranch>` in any worktree to find commits\n- Commits are shared across all worktrees\n\n**\"Cannot checkout: file exists in working tree\"**\n- File has local modifications\n- Either commit, stash, or discard local changes first\n- Then retry the merge operation\n\n**\"Branch not found for worktree\"**\n- The specified worktree may have been removed\n- Run `git worktree list` to see current worktrees\n- Use `git worktree prune` to clean up stale references\n\n## Integration with Other Commands\n\n**Pre-merge review:**\n```bash\n> \u002Fgit:compare-worktrees src\u002F\n> \u002Fgit:merge-worktree src\u002Fspecific-file.js\n```\n\n**Create worktree, merge, cleanup:**\n```bash\n> \u002Fgit:create-worktree feature-branch\n> \u002Fgit:compare-worktrees src\u002F\n> \u002Fgit:merge-worktree src\u002Fmodule.js --from ..\u002Fproject-feature-branch\n# After merge, cleanup is offered automatically\n```\n","# Claude Command: Merge Worktree\n\nYour 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.\n\n## Instructions\n\nCRITICAL: Perform the following steps exactly as described:\n\n1. **Current state check**: Run `git worktree list` to show all existing worktrees and `git status` to verify working directory state\n\n2. **Parse user input**: Determine what merge operation the user wants:\n   - **`--interactive` or no arguments**: Guided interactive mode\n   - **File\u002Fdirectory path**: Merge specific file(s) or directory from a worktree\n   - **Commit name**: Cherry-pick a specific commit\n   - **Branch name**: Merge from that branch's worktree\n   - **`--from \u003Cworktree>`**: Specify source worktree explicitly\n   - **`--patch` or `-p`**: Use interactive patch selection mode\n\n3. **Determine source worktree\u002Fbranch**:\n   a. If user specified `--from \u003Cworktree>`: Use that worktree path directly\n   b. If user specified a branch name: Find worktree for that branch from `git worktree list`\n   c. If only one other worktree exists: Ask to confirm using it as source\n   d. If multiple worktrees exist: Present list and ask user which to merge from\n   e. If no other worktrees exist: Explain and offer to use branch-based merge instead\n\n4. **Determine merge strategy**: Present options based on user's needs:\n\n   **Strategy A: Selective File Checkout** (for specific files\u002Fdirectories)\n   - Best for: Getting complete file(s) from another branch\n   - Command: `git checkout \u003Cbranch> -- \u003Cpath>`\n\n   **Strategy B: Interactive Patch Selection** (for partial file changes)\n   - Best for: Selecting specific hunks\u002Flines from a file\n   - Command: `git checkout -p \u003Cbranch> -- \u003Cpath>`\n   - Prompts user for each hunk: y (apply), n (skip), s (split), e (edit)\n\n   **Strategy C: Cherry-Pick with Selective Staging** (for specific commits)\n   - Best for: Applying a commit but excluding some changes\n   - Steps:\n     1. `git cherry-pick --no-commit \u003Ccommit>`\n     2. Review staged changes\n     3. `git reset HEAD -- \u003Cunwanted-files>` to unstage\n     4. `git checkout -- \u003Cunwanted-files>` to discard\n     5. `git commit -m \"message\"`\n\n   **Strategy D: Manual Merge with Conflicts** (for complex merges)\n   - Best for: Full branch merge with control over resolution\n   - Steps:\n     1. `git merge --no-commit \u003Cbranch>`\n     2. Review all changes\n     3. Selectively stage\u002Funstage files\n     4. Resolve conflicts if any\n     5. `git commit -m \"message\"`\n\n   **Strategy E: Multi-Worktree Selective Merge** (combining from multiple sources)\n   - Best for: Taking different files from different worktrees\n   - Steps:\n     1. `git checkout \u003Cbranch1> -- \u003Cpath1>`\n     2. `git checkout \u003Cbranch2> -- \u003Cpath2>`\n     3. `git commit -m \"Merge selected files from multiple branches\"`\n\n5. **Execute the selected strategy**:\n   - Run pre-merge comparison if user wants to review (suggest `\u002Fgit:compare-worktrees` first)\n   - Execute git commands for the chosen strategy\n   - Handle any conflicts that arise\n   - Confirm changes before final commit\n\n6. **Post-merge summary**: Display what was merged:\n   - Files changed\u002Fadded\u002Fremoved\n   - Source worktree\u002Fbranch\n   - Merge strategy used\n\n7. **Cleanup prompt**: After successful merge, ask:\n   - \"Would you like to remove any worktrees to clean up local state?\"\n   - If yes: List worktrees and ask which to remove\n   - Execute `git worktree remove \u003Cpath>` for selected worktrees\n   - Remind about `git worktree prune` if needed\n\n## Merge Strategies Reference\n\n| Strategy | Use When | Command Pattern |\n|----------|----------|-----------------|\n| **Selective File** | Need complete file(s) from another branch | `git checkout \u003Cbranch> -- \u003Cpath>` |\n| **Interactive Patch** | Need specific changes within a file | `git checkout -p \u003Cbranch> -- \u003Cpath>` |\n| **Cherry-Pick Selective** | Need a commit but not all its changes | `git cherry-pick --no-commit` + selective staging |\n| **Manual Merge** | Full branch merge with control | `git merge --no-commit` + selective staging |\n| **Multi-Source** | Combining files from multiple branches | Multiple `git checkout \u003Cbranch> -- \u003Cpath>` |\n\n## Examples\n\n**Merge single file from worktree:**\n```bash\n> \u002Fgit:merge-worktree src\u002Fapp.js --from ..\u002Fproject-feature\n# Prompts for merge strategy\n# Executes: git checkout feature-branch -- src\u002Fapp.js\n```\n\n**Interactive patch selection:**\n```bash\n> \u002Fgit:merge-worktree src\u002Futils.js --patch\n# Lists available worktrees to select from\n# Runs: git checkout -p feature-branch -- src\u002Futils.js\n# User selects hunks interactively (y\u002Fn\u002Fs\u002Fe)\n```\n\n**Cherry-pick specific commit:**\n```bash\n> \u002Fgit:merge-worktree abc1234\n# Detects commit hash\n# Asks: Apply entire commit or selective?\n# If selective: git cherry-pick --no-commit abc1234\n# Then guides through unstaging unwanted changes\n```\n\n**Merge from multiple worktrees:**\n```bash\n> \u002Fgit:merge-worktree --interactive\n# \"Select files to merge from different worktrees:\"\n# \"From feature-1: src\u002FmoduleA.js\"\n# \"From feature-2: src\u002FmoduleB.js, src\u002FmoduleC.js\"\n# Executes selective checkouts from each\n```\n\n**Full guided mode:**\n```bash\n> \u002Fgit:merge-worktree\n# Lists all worktrees\n# Asks what to merge (files, commits, or branches)\n# Guides through appropriate strategy\n# Offers cleanup at end\n```\n\n**Directory merge with conflicts:**\n```bash\n> \u002Fgit:merge-worktree src\u002Fcomponents\u002F --from ..\u002Fproject-refactor\n# Strategy D: Manual merge with conflicts\n# git merge --no-commit refactor-branch\n# Helps resolve any conflicts\n# Reviews and commits selected changes\n```\n\n## Interactive Patch Mode Guide\n\nWhen using `--patch` or Strategy B, the user sees prompts for each change hunk:\n\n```\n@@ -10,6 +10,8 @@ function processData(input) {\n   const result = transform(input);\n+  \u002F\u002F Added validation\n+  if (!isValid(result)) throw new Error('Invalid');\n   return result;\n }\nApply this hunk? [y,n,q,a,d,s,e,?]\n```\n\n| Key | Action |\n|-----|--------|\n| `y` | Apply this hunk |\n| `n` | Skip this hunk |\n| `q` | Quit (don't apply this or remaining hunks) |\n| `a` | Apply this and all remaining hunks |\n| `d` | Don't apply this or remaining hunks in this file |\n| `s` | Split into smaller hunks |\n| `e` | Manually edit the hunk |\n| `?` | Show help |\n\n## Cherry-Pick Selective Workflow\n\nFor Strategy C (cherry-picking with selective staging):\n\n```bash\n# 1. Apply commit without committing\ngit cherry-pick --no-commit abc1234\n\n# 2. Check what was staged\ngit status\n\n# 3. Unstage files you don't want\ngit reset HEAD -- path\u002Fto\u002Funwanted.js\n\n# 4. Discard changes to those files\ngit checkout -- path\u002Fto\u002Funwanted.js\n\n# 5. Commit the remaining changes\ngit commit -m \"Cherry-pick selected changes from abc1234\"\n```\n\n## Multi-Worktree Merge Workflow\n\nFor Strategy E (merging from multiple worktrees):\n\n```bash\n# Get files from different branches\ngit checkout feature-auth -- src\u002Fauth\u002Flogin.js src\u002Fauth\u002Fsession.js\ngit checkout feature-api -- src\u002Fapi\u002Fendpoints.js\ngit checkout feature-ui -- src\u002Fcomponents\u002FHeader.js\n\n# Review all changes\ngit status\ngit diff --cached\n\n# Commit combined changes\ngit commit -m \"feat: combine auth, API, and UI improvements from feature branches\"\n```\n\n## Common Workflows\n\n### Take a Feature File Without Full Merge\n```bash\n> \u002Fgit:merge-worktree src\u002Fnew-feature.js --from ..\u002Fproject-feature\n# Gets just the file, not the entire branch\n```\n\n### Partial Bugfix from Hotfix Branch\n```bash\n> \u002Fgit:merge-worktree --patch src\u002Futils.js --from ..\u002Fproject-hotfix\n# Select only the specific bug fix hunks, not all changes\n```\n\n### Combine Multiple PRs' Changes\n```bash\n> \u002Fgit:merge-worktree --interactive\n# Select specific files from PR-1 worktree\n# Select other files from PR-2 worktree\n# Combine into single coherent commit\n```\n\n### Pre-Merge Review\n```bash\n# First review what will be merged\n> \u002Fgit:compare-worktrees src\u002Fmodule.js\n# Then merge with confidence\n> \u002Fgit:merge-worktree src\u002Fmodule.js --from ..\u002Fproject-feature\n```\n\n## Important Notes\n\n- **Working directory state**: Always ensure your working directory is clean before merging. Uncommitted changes can cause conflicts.\n\n- **Pre-merge review**: Consider using `\u002Fgit:compare-worktrees` before merging to understand what changes will be applied.\n\n- **Conflict resolution**: If conflicts occur during merge, the command will help identify and resolve them before committing.\n\n- **No-commit flag**: Most strategies use `--no-commit` to give you control over the final commit message and what gets included.\n\n- **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.\n\n- **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.\n\n## Cleanup After Merge\n\nAfter merging, consider cleaning up worktrees that are no longer needed:\n\n```bash\n# List worktrees\ngit worktree list\n\n# Remove specific worktree (clean state required)\ngit worktree remove ..\u002Fproject-feature\n\n# Force remove (discards uncommitted changes)\ngit worktree remove --force ..\u002Fproject-feature\n\n# Clean up stale worktree references\ngit worktree prune\n```\n\nThe command will prompt you about cleanup after each successful merge to help maintain a tidy workspace.\n\n## Troubleshooting\n\n**\"Cannot merge: working directory has uncommitted changes\"**\n- Commit or stash your current changes first\n- Or use `git stash` before merge, `git stash pop` after\n\n**\"Merge conflict in \u003Cfile>\"**\n- The command will show conflicted files\n- Open files and resolve conflicts (look for `\u003C\u003C\u003C\u003C\u003C\u003C\u003C` markers)\n- Stage resolved files with `git add \u003Cfile>`\n- Continue with `git commit`\n\n**\"Commit not found\" when cherry-picking**\n- Ensure the commit hash is correct\n- Run `git log \u003Cbranch>` in any worktree to find commits\n- Commits are shared across all worktrees\n\n**\"Cannot checkout: file exists in working tree\"**\n- File has local modifications\n- Either commit, stash, or discard local changes first\n- Then retry the merge operation\n\n**\"Branch not found for worktree\"**\n- The specified worktree may have been removed\n- Run `git worktree list` to see current worktrees\n- Use `git worktree prune` to clean up stale references\n\n## Integration with Other Commands\n\n**Pre-merge review:**\n```bash\n> \u002Fgit:compare-worktrees src\u002F\n> \u002Fgit:merge-worktree src\u002Fspecific-file.js\n```\n\n**Create worktree, merge, cleanup:**\n```bash\n> \u002Fgit:create-worktree feature-branch\n> \u002Fgit:compare-worktrees src\u002F\n> \u002Fgit:merge-worktree src\u002Fmodule.js --from ..\u002Fproject-feature-branch\n# After merge, cleanup is offered automatically\n```\n",{"name":5,"model":43,"description":7,"allowed-tools":44,"argument-hint":45},"opus","Bash(git worktree:*), Bash(git branch:*), Bash(git diff:*), Bash(git status:*), Bash(git checkout:*), Bash(git cherry-pick:*), Bash(git merge:*), Bash(git reset:*), Bash(git log:*), Bash(git restore:*), Bash(git add:*), Bash(ls:*), Bash(pwd:*), Bash(diff:*)","file\u002Fdirectory path, commit name, branch name, or --interactive for guided mode","master","c73386b305dec167db7654e0e6feacb462d4f9dc","assets\u002Fskills\u002Fdev\u002Fmerge-worktree",1,"https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code","https:\u002F\u002Fgithub.com\u002FAntifragileTech","2026-10-02 14:22:14",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add AntifragileTech\u002Fantifragile-claude-code --skill \"git:merge-worktree\"",{"tool":59,"command":60},"bunx","bunx skills add AntifragileTech\u002Fantifragile-claude-code --skill \"git:merge-worktree\"",{"tool":62,"command":63},"pnpm","pnpm dlx skills add AntifragileTech\u002Fantifragile-claude-code --skill \"git:merge-worktree\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fdev\u002Fmerge-worktree\u002FSKILL.md",true,[],[68,81,94,107,120,133],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":38},"01M6DT9Q6VYA615SCXR757TZZ7","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fthinking\u002Fwriting-skills\u002FSKILL.md",[],[75,76,77,78,79,80],"writing skills","writing","use","editing","work","deployment",{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":38},"01M6DT9GFHDNY90P41WGAE1TV0","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fthinking\u002Fwriting-plans\u002FSKILL.md",[],[88,89,76,90,91,77,92,93],"plans","writing plans","requirements","task","code","spec",{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":38},"01M6DT9C6PFGD86WS3HY7YE3XG","docs:write-concisely","Apply writing rules to any documentation that humans will read. Makes your writing clearer, stronger, and more professional.","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fthinking\u002Fwrite-concisely\u002FSKILL.md",[],[101,102,103,104,105,106,76],"docs:write concisely","write","docs","read","Rules","documentation",{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":38},"01M6DT98AWQ27P0N1CG97WAG66","kaizen:why","Iterative Five Whys root cause analysis drilling from symptoms to fundamentals","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fthinking\u002Fwhy\u002FSKILL.md",[],[109,114,115,116,117,118,119],"why","kaizen","issue","five whys","analysis","root cause analysis",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":38},"01M6DT93EH25NAX19R3WGE1P53","verification-loop","A comprehensive verification system for Claude Code sessions.","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fthinking\u002Fverification-loop\u002FSKILL.md",[],[127,128,129,130,92,131,132],"verification loop","verification","loop","sessions","claude code sessions","system",{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":38},"01M6DT90GW7Z7VCN98P9DVYSNC","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fthinking\u002Fverification-before-completion\u002FSKILL.md",[],[140,128,141,79,77,142,143,144],"verification before completion","commands","evidence","claim","complete"]