pr-branch-rescue

Merge a long-diverged base branch into a stale PR branch without losing either side's work.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/timikalo7/Execute --skill pr-branch-rescue-timikalo7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pr-branch-rescue
Source: https://github.com/timikalo7/Execute/tree/main/.claude/skills/pr-branch-rescue
Command: npx skills add https://github.com/timikalo7/Execute --skill pr-branch-rescue-timikalo7

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Stale pull requests that sat while the base branch advanced often accumulate dozens of conflicts across unrelated file classes, and ad-hoc file-by-file resolution silently drops one side's security fixes, accessibility patches, or redesigns. This Skill provides a disciplined procedure to inventory conflicts, resolve them by lineage class, re-apply clobbered fixes, and re-verify the merged tree. ## Core Features & Use Cases - Trial-merge conflict inventory: Runs a no-commit merge to capture the full conflict list in one shot before touching any file. - Lineage-based conflict triage: Classifies conflicts into meta/config files, append-only knowledge files, and branch-owned product surfaces, each with a mechanical resolution rule. - Fix re-application and gate re-verification: Re-applies base-branch security and accessibility fixes onto kept branch code, invalidates stale gate stamps, and re-runs the full build, test, a11y, and security gates on the merged tree. - Use Case: A feature PR sat for weeks while main gained new CI gates and an auth-pattern migration; use this Skill to merge main in, keep the branch's redesign, re-apply the new auth pattern, and prove the merged tree passes every gate. ## Quick Start Ask the agent to rescue the stale PR branch by merging the latest base branch into it, triaging conflicts by file class, and re-running all quality gates on the merged tree.

Frequently Asked Questions about pr-branch-rescue

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

FAQPage Schema
How do I update a stale PR branch that has many merge conflicts?

Run a trial merge with git merge --no-commit --no-ff to capture the full conflict list, then classify conflicts by lineage: base-owned config and CI files take the base side, append-only logs union both sides, and branch-owned product files keep the branch version with base fixes re-applied by hand.

Should I rebase or merge to bring a long-diverged branch up to date?

This procedure uses a merge of the base branch into the PR branch rather than rebasing, because it lets you inventory all conflicts in one shot and resolve them by class. Rebasing replays commits one at a time, which thrashes on heavily diverged branches.

Why do merged branches regress even when both sides passed CI?

Each side passing separately does not guarantee the merged composition passes, since the merge creates new code interactions. The procedure invalidates all stale gate stamps and re-runs the full build, test, accessibility, and security gates on the merged tree.

How do I avoid losing security fixes when resolving merge conflicts?

For every file where you keep the branch's version, inspect what the base changed with git log from the merge base, then manually re-apply security patches, accessibility fixes, and API-pattern migrations onto the branch's newer code.

When should I abort a branch rescue instead of resolving it?

If the trial merge reveals the branch is hopeless to reconcile, git merge --abort costs nothing since the inventory step never commits. The trial-merge-first approach exists precisely to allow cheap abandonment before any resolution work begins.