From principled-implementation
Merge a completed and validated task's worktree branch back to the working branch. Verifies checks passed, performs the merge, cleans up the worktree, and updates the task manifest. Directly invocable by users and by the orchestrate skill.
How this skill is triggered — by the user, by Claude, or both
Slash command
/principled-implementation:merge-workThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Merge a task's implementation from its worktree branch back to the working branch, then clean up the worktree.
Merge a task's implementation from its worktree branch back to the working branch, then clean up the worktree.
/merge-work <task-id> [--force] [--no-cleanup]
| Argument | Required | Description |
|---|---|---|
<task-id> | Yes | Task to merge |
--force | No | Merge even if checks have not passed (not recommended) |
--no-cleanup | No | Keep the worktree after merge for inspection |
Parse arguments. Extract <task-id> and flags from $ARGUMENTS.
Load task from manifest. Run:
bash scripts/task-manifest.sh --get-task --task-id <task-id>
Verify:
passed (or any status if --force)Without --force, if status is not passed: "Task <task-id> has status '<status>'. Run /check-impl --task <task-id> first, or use --force to merge without validation."
Discover branch and worktree path. Get the branch name from the manifest. If not recorded, search for it:
git branch --list 'impl/*' | grep <task-id-sanitized>
Find the worktree path:
git worktree list | grep <branch>
Merge branch. From the main working tree:
git merge <branch> --no-ff \
-m "impl(<plan-number>): merge task <task-id> — <description>"
If merge conflict:
conflict/merge-work <task-id> again."Clean up worktree (unless --no-cleanup):
git worktree remove <worktree-path>
git branch -d <branch>
Update manifest. Run:
bash scripts/task-manifest.sh --update-status \
--task-id <task-id> \
--status merged
Report results. Display:
scripts/task-manifest.sh — Task manifest CRUD (copy from decompose)npx claudepluginhub alexnodeland/principled --plugin principled-implementationSquash-merges git worktree branch to target branch with structured commit message based on change categorization. Validates retrospective completion and clean tree first.
Lands a subagent worktree branch onto an integration branch with preflight checks and recorded rollback. Local git operation, not remote PR merging.