Agent skill

Merge PR

by joshukraine in joshukraine/dotfiles

Merge a pull request with status checks, squash merge, and branch cleanup.

MITAuto-check passedDevelopment

Install Merge PR

skills CLI
$ npx skills add joshukraine/dotfiles --skill merge-pr -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install joshukraine/dotfiles merge-pr --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/joshukraine/dotfiles.git skills-src && mkdir -p .claude/skills && cp -r skills-src/claude/.claude/skills/merge-pr .claude/skills/merge-pr && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
merge-pr
GitHub stars
429
Token cost
~997 tokens
SKILL.md length
486 words
Files
1
Skills in repo
24
Repo updated
First seen
Licence
MIT

At a glance

Merge a pull request with status checks, squash merge, and branch cleanup.

  • Works in 5 steps: Identify the PR → Verify merge readiness → Merge the PR → …
  • Tasks that involve Git worktrees
  • SKILL.md covers Command Options, Your task and Important
  • Calls git and gh

What it does

Merge PR is an agent skill from joshukraine/dotfiles. Merge a pull request with status checks, squash merge, and branch cleanup. Handles worktree contexts.

Its SKILL.md is about 1000 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git worktrees and Pull requests. It works with Git. The repository describes itself as: :roundpushpin: My dotfiles for macOS using Neovim, Zsh, and Ghostty + Tmux. The licence is MIT.

When your agent uses it

  • Tasks that involve Git worktrees
  • Tasks that involve Pull requests

Example prompts

  • “/merge-pr”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Identify the PR
  2. Verify merge readiness
  3. Merge the PR
  4. Detect worktree context
  5. Confirm completion

What it can do on your machine

Read from SKILL.md and the folder at commit b59ad5b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Merge PR loads about 997 tokens when it runs. Until then it costs about 28 tokens; SKILL.md has 486 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~28
When it runs · the whole SKILL.md, loaded when a task matches
~997

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from joshukraine/dotfiles at commit b59ad5b, republished under its MIT licence (© joshukraine). 486 words, ~997 tokens.

Download SKILL.mdSave it as .claude/skills/merge-pr/SKILL.md (or your agent's skills folder).
name
merge-pr
description
Merge a pull request with status checks, squash merge, and branch cleanup. Handles worktree contexts.
disable-model-invocation
true
argument-hint
[PR-number]

Merge Pull Request

Merge a pull request with consistent practices: verify checks, squash merge, clean up the branch, and pull the latest base branch.

Command Options

  • $ARGUMENTS: PR number (optional — defaults to the PR for the current branch)

Your task

Step 1: Identify the PR
  • If a PR number was provided, use it
  • Otherwise, detect from the current branch: gh pr view --json number,title,state,headRefName,baseRefName
  • Confirm the PR exists and is open
  • Display the PR title and number before proceeding
Step 2: Verify merge readiness

Check each of the following and report status:

  • CI status: Run gh pr checks to verify all required checks have passed
  • Merge conflicts: Run gh pr view --json mergeable to verify no conflicts
  • Review feedback: Run gh pr view --json reviewDecision,reviews to surface any unresolved review threads or a pending "changes requested" — advisory, not a hard gate. (Carries over the review-thread awareness from the retired /review-pr.)

If CI has not passed, stop and report. Do not proceed with the merge.

Step 3: Merge the PR
  • Squash merge: gh pr merge --squash
  • Do not pass --delete-branch — GitHub is configured to auto-delete remote branches on merge. Local branch cleanup is handled in Step 4.
Step 4: Detect worktree context

Before updating local state, determine whether you are inside a git worktree:

bash
git rev-parse --git-dir
git rev-parse --git-common-dir
  • If these values are identical, you are in a normal repo — proceed with Step 5a.
  • If they differ, you are in a worktree — proceed with Step 5b.
Step 5a: Update local state (normal repo)

After gh pr merge completes:

  • Switch to the base branch (e.g., main, master, or whatever baseRefName was detected in Step 1) and pull: git switch <base-branch> && git pull
  • Delete the local feature branch with git branch -D <branch-name> (force-delete is required because squash merges produce a different SHA, so -d cannot detect the branch as merged)

Then skip to Step 6.

Show full SKILL.md (188 more words)Show less
Step 5b: Update local state (worktree)

When inside a worktree, git switch to the base branch will fail because it is checked out in another worktree. Handle this differently:

  1. Find the primary worktree on the base branch:

    bash
    git worktree list --porcelain

    Parse the output to find the worktree entry whose branch matches refs/heads/<base-branch>. Extract its path.

  2. Pull the base branch from the primary worktree:

    bash
    git -C <primary-worktree-path> pull
  3. Do not delete the branch or remove the worktree automatically. The branch cannot be deleted while it is checked out in a worktree, and removing the worktree would destroy the user's current working directory. Instead, provide the cleanup commands in the completion report.

Step 6: Confirm completion

Normal repo — report:

text
## Merge Complete

- PR: #N — [title]
- Remote branch: deleted
- Local branch: deleted (or kept — reason)
- Local <base-branch>: up to date

Worktree — report:

text
## Merge Complete

- PR: #N — [title]
- Remote branch: deleted
- Local <base-branch>: up to date (pulled in primary worktree)

## Worktree cleanup (run from outside this directory)

    git worktree remove <this-worktree-path>
    git branch -D <branch-name>

Important

  • Always squash merge. This keeps main history clean with one commit per PR.
  • Do not merge if CI has not passed. This is the one hard gate.
  • Do not amend or rewrite commits as part of the merge process.
  • Squash merges require force-delete. git branch -d cannot detect squash-merged branches, so -D is the correct flag for cleanup after a confirmed merge.

© joshukraine, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in claude/.claude/skills/merge-pr of joshukraine/dotfiles.

Open the folder on GitHubat commit b59ad5b

Compare with similar skills

Merge PR next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Merge PR compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Merge PR this skilljoshukraine/dotfiles429—~997Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Pre-Release PR Triagejamiepine/voicebox57k—~3.1kAutomated safety check: PassMIT
Cap Feature Building WorkflowCapSoftware/Cap23k—~2.5kAutomated safety check: WarnCustom licence
Clean Complete Branchesjtenniswood/espcontrol1.1k—~820Automated safety check: PassCustom licence
BackportDependencyTrack/frontend172—~1.9kAutomated safety check: NotesApache-2.0

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Pre-Release PR Triage

    jamiepine/voicebox

    Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.

    57k GitHub stars~3.1k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Builds a Cap feature in an isolated Git worktree with disposable dev resources, verification, a recorded demo and a neutral pull request, started with /building.

    23k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check: warnings
  • Clean Complete Branches

    jtenniswood/espcontrol

    Clean up completed Git branches and worktrees for this repository both locally and on GitHub.

    1.1k GitHub stars~820 tokensUpdated today
    DevelopmentAuto-check passed
  • Backport

    DependencyTrack/frontend

    Backports a merged pull request from main onto a patch-release branch, e.g.

    172 GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check: notes
  • Swamp

    swamp-club/swamp

    Swamp CLI — create and run models, build and validate workflows, query and manage data, store and retrieve vault secrets, develop and publish extensions, initialize repos, run reports, file issues…

    646 GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed

More from joshukraine/dotfiles

All 24 skills in this repo
  • Todoist CLI

    joshukraine/dotfiles

    Manage Todoist tasks, projects, labels, filters, sections, comments, reminders, and workspaces via the td CLI.

    429 GitHub starsUsed in 1 repo~6.9k tokens
    Auto-check passed
  • Autopilot Triage

    joshukraine/dotfiles

    Vet open issues for autonomous resolution and queue the qualifying ones with the autopilot-queued label — the start-of-day "fill the queue" half of the triage → run split.

    429 GitHub stars~2.1k tokensUpdated 4 days ago
    Auto-check passed
  • Checkpoint

    joshukraine/dotfiles

    Quick 2-minute status update on current phase, completed work, blockers, and health check.

    429 GitHub stars~600 tokensUpdated 4 days ago
    Auto-check passed
  • Create PR

    joshukraine/dotfiles

    Create a pull request with auto-generated description, issue linking, ROADMAP updates, and PR-metadata validation.

    429 GitHub stars~1.3k tokensUpdated 4 days ago
    Auto-check passed
  • Debrief

    joshukraine/dotfiles

    Detailed technical walkthrough covering architecture, test coverage, product tour, and key design decisions.

    429 GitHub stars~2.5k tokensUpdated 4 days ago
    Auto-check passed
  • Drift Check

    joshukraine/dotfiles

    Pre-PR advisory check for deviations from the project spec. An agent skill from joshukraine/dotfiles.

    429 GitHub stars~1.2k tokensUpdated 4 days ago
    Auto-check passed

Works with

Categories

Questions about Merge PR

What does Merge PR do?

Merge a pull request with status checks, squash merge, and branch cleanup. Merge PR is an agent skill from joshukraine/dotfiles. Merge a pull request with status checks, squash merge, and branch cleanup.

When should I use Merge PR?

Merge PR fits situations like: tasks that involve Git worktrees; tasks that involve Pull requests.

How do I install Merge PR in Claude Code?

Run `npx skills add joshukraine/dotfiles --skill merge-pr -a claude-code`. Or copy the skill folder (claude/.claude/skills/merge-pr in joshukraine/dotfiles) into .claude/skills/merge-pr in your project. Claude Code loads it when a task matches its description.

How do I install Merge PR in Codex?

Run `npx skills add joshukraine/dotfiles --skill merge-pr -a codex`. Or copy the skill folder (claude/.claude/skills/merge-pr in joshukraine/dotfiles) into .agents/skills/merge-pr in your project. Codex loads it when a task matches its description.

Can I use Merge PR in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add joshukraine/dotfiles --skill merge-pr -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/merge-pr, .gemini/skills/merge-pr, .github/skills/merge-pr and .opencode/skills/merge-pr in your project.

What does Merge PR need to run?

Going by SKILL.md and its folder, Merge PR needs the command-line tools its instructions call (git and gh).

Does Merge PR access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Merge PR safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Merge PR use?

Merge PR is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Merge PR use?

About 997 tokens (SKILL.md is roughly 4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Merge PR?

Skills that share tags, products or a category with Merge PR: Finishing a Development Branch (obra/superpowers, 297k stars), Pre-Release PR Triage (jamiepine/voicebox, 57k stars), Cap Feature Building Workflow (CapSoftware/Cap, 23k stars) and Clean Complete Branches (jtenniswood/espcontrol, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Merge PR?

joshukraine (a GitHub user) maintains it in joshukraine/dotfiles, which has 429 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on October 6, 2026.

Source: joshukraine/dotfiles on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.