About jackin-checkout-pr
A repository skill for switching the working tree to a GitHub pull request branch with `gh pr checkout`. It accepts a PR number, URL, or branch name and checks for a clean tree and closed PRs before switching.
Key features
- 01Resolve PRs by number, URL, or branch
- 02Stop when the working tree is dirty
- 03Warn before checking out closed or merged PRs
- 04Verify the resulting branch and report how to return
Use cases
- 01Switch to a PR branch by number or URL
- 02Find and check out a PR from its head branch name
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ jackin-project/ jackin-dev --skill jackin-checkout-prAfter installing, type/jackin-checkout-prin Claude Code to confirm it loaded.
Bundled filesagents/openai.yaml
Details
From the project READMEjackin-checkout-pr
Switch the working repo onto a PR's branch via gh pr checkout. Accepts a number, URL, or branch name.
Process
-
Resolve to a PR number. Number or URL → pass to
gh pr checkoutdirectly. Branch name →gh pr list --head <branch> --state all --json number -q '.[0].number'; no match → STOP, do not fall back to rawgit checkout. -
Guard the working tree.
git status --porcelain— if dirty, STOP and ask the operator to commit, stash, or discard first. Never auto-stash. Notegit branch --show-current(the way back). -
Check the PR is open.
gh pr view <N> --json state,headRefName.MERGEDorCLOSED→ warn (the branch may be stale) and confirm before proceeding. -
Switch.
gh pr checkout <N>. Verifygit branch --show-currentmatchesheadRefName. -
Report. Switched from
<old>to<headRefName>(PR #N). Way back:git switch <old>.