merge-worktree

Merge a story worktree into the development branch and clean up resources.

1|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/kelsi-andrewss/claude-multi-agent-pipeline --skill merge-worktree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-worktree
Source: https://github.com/kelsi-andrewss/claude-multi-agent-pipeline/tree/main/skills/merge-worktree
Command: npx skills add https://github.com/kelsi-andrewss/claude-multi-agent-pipeline --skill merge-worktree

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Merges a story worktree into the development branch, handles the necessary Git operations, and cleans up the worktree and branches, while updating the story state as needed.

Core Features & Use Cases

  • Identify the story worktree and its associated story/epic, then perform a no-FF merge into dev.
  • Create a temporary worktree for the dev branch when needed, pull the latest changes, and push updates after merging.
  • Remove the story worktree, delete local and remote branches, and reflect the merge in the story/epic state in the database.

Quick Start

Invoke the merge-worktree command with an optional story ID to merge the target story worktree into dev and clean up afterward.

Frequently Asked Questions about merge-worktree

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

FAQPage Schema
How do I merge a git worktree into the dev branch?

To merge a git worktree, the Skill creates a temporary dev worktree, pulls latest changes, performs a no-FF merge of the story worktree, and pushes updates to the dev branch automatically.

How do I clean up local and remote branches after merging a story worktree?

Branch cleanup after merging removes the story worktree directory and deletes both local and remote story branches, ensuring the repository remains tidy without leaving orphaned references.

What is a no-FF merge and when should I use it for development branches?

A no-FF merge forces the creation of a merge commit even when fast-forwarding is possible, preserving the historical context of the story branch within the development branch history.

Can I update story and epic status in the database automatically after a branch merge?

Yes, the workflow updates related story and epic states in the database automatically after successfully merging the worktree and cleaning up the associated branches.

Do I need a specific worktree directory structure to automate git branch cleanup?

The workflow requires stories to have associated worktrees located under the .claude/worktrees/story directory path to correctly identify, merge, and remove them during the cleanup process.

What happens to temporary worktrees created for pulling dev branch changes?

The temporary dev worktree is created solely to pull the latest changes and push merge updates, and it is removed as part of the worktree cleanup process after the merge completes.