mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-22 09:29:42 +01:00
1.9 KiB
1.9 KiB
description, allowed-tools
| description | allowed-tools |
|---|---|
| Review a PR in a new worktree | Bash(git worktree:*), Bash(gh pr:*), Bash(git branch:*) |
Check out a GitHub pull request for review.
Usage
/check-out-pr <PR_NUMBER>
What to do
- If no PR number is provided, list all open pull requests and ask the user to select one
- Get PR information using
gh pr view <PR_NUMBER> --json number,headRefName - Ask the user whether they want to:
- A) Check out in current directory — simple
gh pr checkout <PR_NUMBER> - B) Create a new worktree — isolated copy at
../yaak-worktrees/pr-<PR_NUMBER>
- A) Check out in current directory — simple
- Follow the appropriate path below
Option A: Check out in current directory
- Run
gh pr checkout <PR_NUMBER> - Inform the user which branch they're now on
Option B: Create a new worktree
- Create a new worktree at
../yaak-worktrees/pr-<PR_NUMBER>usinggit worktree addwith a timeout of at least 300000ms (5 minutes) since the post-checkout hook runs a bootstrap script - Checkout the PR branch in the new worktree using
gh pr checkout <PR_NUMBER> - The post-checkout hook will automatically:
- Create
.env.localwith unique ports - Copy editor config folders
- Run
npm install && npm run bootstrap
- Create
- Inform the user:
- Where the worktree was created
- What ports were assigned
- How to access it (cd command)
- How to run the dev server
- How to remove the worktree when done
Example worktree output
Created worktree for PR #123 at ../yaak-worktrees/pr-123
Branch: feature-auth
Ports: Vite (1421), MCP (64344)
To start working:
cd ../yaak-worktrees/pr-123
npm run app-dev
To remove when done:
git worktree remove ../yaak-worktrees/pr-123
Error Handling
- If the PR doesn't exist, show a helpful error
- If the worktree already exists, inform the user and ask if they want to remove and recreate it
- If
ghCLI is not available, inform the user to install it