| name | worktree-merge |
| description | Integrate any number of feature branches from parallel worktrees through one safe integration branch, validating after each merge and running the project's full check suite before touching the main line. Use when parallel worktree development is done and the branches need to be merged, or when the user says "merge my worktrees", "integrate these branches", or invokes /worktree-merge. |
| argument-hint | [branch ...] (two or more branch names; blank = ask) |
Worktree Merge
Integrate any number of feature branches into your working branch through a single throwaway integration
branch, so nothing lands on the main line until every branch is merged and the whole suite passes. Validation
commands are detected from the repo, never assumed.
Input
$ARGUMENTS is the list of branches to integrate.
- Fewer than two → ask which branches to integrate. Don't guess.
- Two or more → integrate them in the given order.
Detect the validation commands ONCE
Find the commands that prove this project works, preferring what CI already runs: read .github/workflows/*, a
Makefile, or the manifest's test/lint scripts, and reuse those exact commands (test runner, type checker,
linter). Do not hardcode pytest/mypy/pyright — use whatever this repo actually uses.
Steps
-
Preconditions. Confirm you're at the repository root, not inside worktrees/
( → error). Store the current branch. Verify every branch in the list exists
(). Abort early with a clear message if any check fails.