ralph-merge-worktrees
Installation
SKILL.md
Ralph Merge Worktrees
Analyze completed Ralph worktree PRDs, build a dependency-aware merge queue, and sequentially squash-merge each branch into main — removing the worktree after each successful merge.
Overview
Ralph worktrees live at .claude/worktrees/ralph/<feature>/ with PRDs at scripts/ralph/prd.json inside each worktree. A worktree is "completed" when every user story in its PRD has passes: true. This skill finds all completed worktrees, determines the safest merge order, presents the plan for approval, and then executes it one branch at a time.
Step 1: Scan and Identify Completed Worktrees
Read every .claude/worktrees/ralph/*/scripts/ralph/prd.json file. For each PRD:
- Parse the JSON — extract
branchName,description, anduserStories[] - A worktree is completed when ALL stories have
passes: true - Skip any worktree whose PRD has at least one story with
passes: false - Also skip worktrees that don't have a
prd.json(malformed or empty)
If no completed worktrees are found, tell the user and stop.