check-merge

Detects whether a PR's merge target advanced or the PR landed since last attestation.

Updated Nov 17, 2025
One-click install
npx skills add https://github.com/vzakharov/vovazakharov.com --skill check-merge-vzakharov
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: check-merge
Source: https://github.com/vzakharov/vovazakharov.com/tree/main/.claude/skills/check-merge
Command: npx skills add https://github.com/vzakharov/vovazakharov.com --skill check-merge-vzakharov

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? After a branch is attested and its pull request is open, the base branch can move forward or the PR can land without any signal to the session. This Skill performs a single stateless check that tells you whether the merge target advanced, the PR merged or closed, or the branch is still current, so stale attestations never slip through unnoticed. ## Core Features & Use Cases - One-shot merge-target check: Runs scripts/check-merge.sh once and classifies the result via exit codes — contained (0), target advanced (10), PR merged (20), PR closed (21), or hard error (1). - Base-aware resolution: Resolves the merge target from the PR's actual base branch rather than assuming main, so promotion branches and long-lived feature branches are handled correctly. - Squash comment reconciliation: While the PR is open, invokes the squash-message skill in update-only mode to edit the stale 'Proposed squash title/body:' PR comment in place when the branch has drifted. - Use Case: You return to a session whose branch was attested yesterday. Run the check to learn that origin/main advanced three commits, hand control back to the enclosing finalize flow to re-verify, and have the squash message comment refreshed automatically. ## Quick Start Ask the assistant to run /check-merge on the current branch to see whether the merge target moved since the branch was last attested.

Frequently Asked Questions about check-merge

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

FAQPage Schema
How do I check if main advanced since my branch was last verified?

Run the check-merge script once; it fetches the current target tip and tests ancestry against your branch's history. Exit code 0 means your branch still contains the target tip, while exit code 10 means the target advanced and needs attention.

How do I detect whether my GitHub pull request was merged or closed?

The check resolves the PR with a single gh pr list call that returns both the base ref and PR state. Exit code 20 indicates the PR merged, and exit code 21 indicates it was closed without merging.

Does the merge check work for PRs based on branches other than main?

Yes. The merge target is resolved from the PR's actual base branch rather than being hardcoded to main, so PRs based on promotion branches or long-lived feature branches are checked against the correct target.

Can I check a different branch or PR than the current one?

Yes. Pass a branch name, PR number, or PR URL as the first argument, and the skill attaches to that branch first using the from-branch flow before running the check.

Why does the check not decide what to do when the base advanced?

The skill only detects movement and hands control back to the enclosing flow, such as finalize, which owns the re-verification and re-attestation rules. This separation keeps detection stateless and decision logic in one place.