post-merge

Syncs main, deletes merged feature branches, and suggests the next issue after a PR merge.

Updated Apr 22, 2026
One-click install
npx skills add https://github.com/rpmcdougall/claude-skills --skill post-merge-rpmcdougall
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: post-merge
Source: https://github.com/rpmcdougall/claude-skills/tree/main/skills/post-merge
Command: npx skills add https://github.com/rpmcdougall/claude-skills --skill post-merge-rpmcdougall

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? After a pull request merges, developers often forget to sync their local main branch, leave stale feature branches cluttering the repo, and lose track of what to work on next. This Skill automates the post-merge cleanup routine safely and surfaces the next task. ## Core Features & Use Cases - Verified branch cleanup: Confirms the PR is actually merged via gh pr view before deleting the local branch, and only uses the safe git branch -d flag. - Main branch sync: Checks out main and fast-forward pulls to keep the local repository current. - Next pickup suggestion: Reads the latest checkpoint file's "Next pickup" section and cross-references open GitHub issues to recommend the next task. - Use Case: After merging PR #42 for a combat mechanic, run this Skill to sync main, delete the feature branch, and get a recommendation for the next issue based on your checkpoint notes. ## Quick Start Tell the AI "PR #42 just merged" and it will sync main, clean up the branch, and suggest what to work on next.

Frequently Asked Questions about post-merge

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely delete a git branch after merging a PR?▼

Verify the merge first with gh pr view to confirm the state is MERGED, then use git branch -d (not -D) to delete the local branch. The -d flag refuses deletion if the branch contains unmerged commits, preventing accidental work loss.

How to sync local main branch after a pull request merges?▼

Run git checkout main followed by git pull --ff-only to fast-forward your local main to match the remote. The --ff-only flag prevents accidental merge commits and fails safely if your local main has diverged.

What is the difference between git branch -d and -D?▼

git branch -d only deletes branches that have been fully merged, refusing otherwise. git branch -D force-deletes regardless of merge status, which can destroy unmerged work. This Skill strictly uses -d and stops if deletion fails.

Does this work if the PR was closed without merging?▼

No. The Skill checks the PR state via gh pr view first and stops immediately if the state is not MERGED, telling you instead of deleting anything. It never force-deletes unmerged branches.

What happens if there is no checkpoint file after the merge?▼

The Skill flags the missing checkpoint as a process gap, since pre-merge housekeeping should have created one. It does not fail, but it surfaces the omission so you can address documentation hygiene.