Skip to main content
skill CX Codex

jackin-checkout-pr — Claude Code skill: what it does, install

Moves the current repository to a pull request branch with gh pr checkout after checking for local changes. It runs only when explicitly requested.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add jackin-project/jackin-dev --skill jackin-checkout-pr -a claude-code
Open on GitHub

What jackin-checkout-pr does

The skill accepts a pull request number, URL, or branch name. Numbers and URLs go straight to gh pr checkout; a branch is resolved with gh pr list --head <branch> --state all --json number -q '.[0].number'. If no PR matches, it stops instead of falling back to raw git checkout.

Before changing branches, it runs git status --porcelain and records the current branch. A dirty worktree stops the process and requires the operator to commit, stash, or discard the changes; the skill never stashes automatically. It checks the PR state, asks for confirmation on merged or closed requests, verifies the resulting branch, and reports git switch <old> as the way back.

What it helps with

  • move a repository to a pull request branch
  • resolve a PR from its head branch
  • block checkout when local changes exist
  • check whether a PR is still open
  • show how to return to the previous branch

Example prompts for the agent

  • Explicitly use jackin-checkout-pr to switch to pull request 123.
  • Use jackin-checkout-pr to reach the pull request for branch feature/login.
  • Run jackin-checkout-pr with the pull request URL and check the worktree first.

How to install jackin-checkout-pr

1Skills CLI (Vercel)

npx skills add jackin-project/jackin-dev --skill jackin-checkout-pr -a claude-code

2Manually: put the files in place

~/.claude/skills/jackin-checkout-pr/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/jackin-checkout-pr/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about jackin-checkout-pr

How do I install jackin-checkout-pr in Claude Code?

Run npx skills add jackin-project/jackin-dev --skill jackin-checkout-pr -a claude-code, then inspect ~/.claude/skills/jackin-checkout-pr/SKILL.md.

What does jackin-checkout-pr do?

It resolves a pull request from a number, URL, or branch, checks the worktree, and changes branches with gh pr checkout. It then verifies the branch and gives the command for switching back.

What happens when the worktree is dirty?

The skill stops and asks you to commit, stash, or discard the changes. It does not auto-stash them.

Source text

SKILL.md · Apache-2.0
---
name: jackin-checkout-pr
description: Use only when the user explicitly requests this skill. Switches the current jackin❯ repo onto a pull request's branch via gh pr checkout, guarding the working tree first.
argument-hint: "<PR number | URL | branch>"
disable-model-invocation: true
license: Apache-2.0
user-invocable: true
---

# jackin-checkout-pr

Switch the working repo onto a PR's branch via `gh pr checkout`. Accepts a number, URL, or branch name.

## Process

1. **Resolve to a PR number.** Number or URL → pass to `gh pr checkout` directly. Branch name → `gh pr list --head <branch> --state all --json number -q '.[0].number'`; no match → STOP, do not fall back to raw `git checkout`.

2. **Guard the working tree.** `git status --porcelain` — if dirty, STOP and ask the operator to commit, stash, or discard first. Never auto-stash. Note `git branch --show-current` (the way back).

3. **Check the PR is open.** `gh pr view <N> --json state,headRefName`. `MERGED` or `CLOSED` → warn (the branch may be stale) and confirm before proceeding.

4. **Switch.** `gh pr checkout <N>`. Verify `git branch --show-current` matches `headRefName`.

5. **Report.** Switched from `<old>` to `<headRefName>` (PR #N). Way back: `git switch <old>`.

© jackin-project · Apache-2.0 · jackin-project/jackin-dev

Similar skills

All skills for Git and GitHub →

From the same set8

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor