Awesome-claude-mcp pr-merge

Merge the current branch's PR using squash merge, delete the remote branch, switch to main, pull latest, and clean up the local branch. Use this skill whenever the user wants to merge a PR, finish a branch, land changes, or says things like "merge this", "land it", "ship it", "merge the PR", or "we're done with this branch".

install
source · Clone the upstream repo
git clone https://github.com/ondatra-ai/awesome-claude-mcp
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ondatra-ai/awesome-claude-mcp "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/pr-merge" ~/.claude/skills/ondatra-ai-awesome-claude-mcp-pr-merge && rm -rf "$T"
manifest: .claude/skills/pr-merge/SKILL.md
source content

PR Merge

Merge the current branch's pull request and clean up afterwards. This is a squash merge workflow that keeps the main branch history clean.

Steps

  1. Get the current branch name so you can clean it up later
  2. Run
    gh pr merge --squash --delete-branch
    to squash-merge and delete the remote branch
  3. Detect whether the main branch is called
    main
    or
    master
  4. Check out the main branch and pull latest changes
  5. Delete the local feature branch

Implementation

Run these commands in sequence. Stop and report if any step fails — don't continue blindly if the merge itself didn't succeed.

CURRENT_BRANCH=$(git branch --show-current)

gh pr merge --squash --delete-branch

MAIN_BRANCH="main"
if git show-ref --verify --quiet refs/heads/master; then
    MAIN_BRANCH="master"
fi

git checkout $MAIN_BRANCH
git pull origin $MAIN_BRANCH

if [ $? -eq 0 ]; then
    git branch -D $CURRENT_BRANCH
fi

Requirements

  • GitHub CLI (
    gh
    ) must be installed and authenticated
  • The current branch must have an open pull request