What problem does it solve?
Manually setting up an isolated git worktree for a GitHub pull request, checking out the PR code, and exporting the PR diff is time-consuming and error-prone, especially when you don't have the gh CLI authenticated or are working outside the target repository.
Core Features & Use Cases
- Isolated PR Worktree Creation: Automatically creates a unique, isolated git worktree under the target repository's
worktrees/ directory to avoid disrupting your main working copy.
- Flexible PR Checkout: Supports checking out PRs via authenticated
gh pr checkout or a public git fetch fallback for unauthenticated use cases.
- Automatic Diff Export: Saves the PR diff as a
<pr-number>.diff file in the worktree root, using gh pr diff or a direct GitHub URL fallback.
- Use Case: A software engineer needs to review changes in a large open source PR without cloning the entire repo or affecting their local feature branch, even if they don't have a GitHub auth token configured.
Quick Start
Use this skill to create an isolated worktree for the GitHub pull request at https://github.com/tidb/tidb/pull/12345, export its diff, and get the worktree path and metadata for your review workflow.