From 4cd4cb57222905aa64726860d3ad15dfa12283fe Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Sat, 3 Jan 2026 09:41:19 -0800 Subject: [PATCH] Add check-out-pr claude command --- .claude/commands/release/check-out-pr.md | 51 +++++++++++++++++++ .../{ => release}/generate-release-notes.md | 0 2 files changed, 51 insertions(+) create mode 100644 .claude/commands/release/check-out-pr.md rename .claude/commands/{ => release}/generate-release-notes.md (100%) diff --git a/.claude/commands/release/check-out-pr.md b/.claude/commands/release/check-out-pr.md new file mode 100644 index 00000000..aec44400 --- /dev/null +++ b/.claude/commands/release/check-out-pr.md @@ -0,0 +1,51 @@ +--- +description: Review a PR in a new worktree +allowed-tools: Bash(git worktree:*), Bash(gh pr:*) +--- + +Review a GitHub pull request in a new git worktree. + +## Usage + +``` +/review-pr +``` + +## What to do + +1. List all open pull requests and ask the user to select one +2. Get PR information using `gh pr view --json number,headRefName` +3. Extract the branch name from the PR +4. Create a new worktree at `../yaak-worktrees/pr-` +5. Checkout the PR branch in the new worktree using `gh pr checkout ` +6. The post-checkout hook will automatically: + - Create `.env.local` with unique ports + - Copy editor config folders + - Run `npm install && npm run bootstrap` +7. 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 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 `gh` CLI is not available, inform the user to install it diff --git a/.claude/commands/generate-release-notes.md b/.claude/commands/release/generate-release-notes.md similarity index 100% rename from .claude/commands/generate-release-notes.md rename to .claude/commands/release/generate-release-notes.md