Create git worktrees for the specified PRs so they can be developed in parallel, each in its own isolated working copy.
$ARGUMENTS names which PRs to create worktrees for (e.g., "C D E").
Steps
Read the active sprint doc in
docs/sprints/and extract the branch name for each requested PR (from the- Branch: ...line in each PR spec).Detect the repository layout. This project uses a git-bare layout:
- Bare repo: find it by reading the
.gitfile in the current worktree (it containsgitdir: <path>) or by checking common locations like../.git-bare. - Worktrees directory:
../worktrees/relative to the primary worktree. - Primary worktree: the current working directory (should be
main/).
- Bare repo: find it by reading the
Validate preconditions before creating anything:
- Confirm the bare repo and worktrees directory exist.
- For each PR, check that the worktree path doesn't already exist (skip if it does, with a note to the user).
- Check that no branch with the target name already exists locally (if it does, offer to reuse it or warn).
Create worktrees. For each PR, run:
git -C <bare-repo-path> worktree add <worktrees-dir>/<dir-name> -b <branch-name> mainUse the branch name from the sprint doc (e.g.,
feat/inputs-from). The worktree directory name should start with the PR label followed by a short subject derived from the branch name. For example, PR A with branchfeat/inputs-fromgets directory namepr-A-inputs-from. This makes it easy to identify which worktree corresponds to which sprint PR.Report results. Print a summary table:
- PR identifier (e.g., "PR C")
- Branch name
- Worktree path
- Status (created / already exists / error)
Print next steps for the user:
- How to open a Claude Code session in each worktree
- Remind that
/kickoff <prX>can be used in each session - Note: the last PR to merge should re-render diagrams with
pixi run diagramto pick up all changes