Checkout PR to Worktree
You are checking out a pull request into an isolated git worktree so the user can review or test it.
Input
The user provides a PR number, #number, or a full GitHub PR URL as the argument.
Steps
Parse the PR identifier from the argument. Extract just the number.
Fetch PR metadata using
mcp__github__pull_request_readwith the repoumbraco/Umbraco.AIand the PR number. Note the:- Branch name (
headRefName) - Title
- Author
- Base branch
- Branch name (
Fetch the latest from origin so the branch is available locally:
git fetch origin <branch-name>Enter the worktree using
EnterWorktreewithnameset to the PR's branch name (e.g.,feature/add-streaming). The branch name contains a/, so the worktree hook will treat it as an explicit branch and track the remote.Show a summary to the user:
- PR title and number
- Author
- Branch name
- Base branch
- A note that they're now in an isolated worktree
Important
- The worktree hook handles the
/convention: branch names with/are used as-is (nofeature/prefix added). - If the PR branch doesn't exist on origin, report the error clearly.
- Do NOT modify any files or make commits. This is a read-only checkout for review.