AGENT SKILL

squash-merge-pr

Use only when the user explicitly invokes squash-merge-pr.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 0
Forks
0

01 前言 Front Matter

name
squash-merge-pr
description
Use only when the user explicitly invokes squash-merge-pr.
disable-model-invocation
true

02 资源文件 1

03 SKILL.md 正文

Squash merge PR

Run only when the user explicitly invokes this skill. A general request to merge a PR does not invoke it. Invoking it authorizes, without asking again: the squash merge into the PR's base branch, updating the local copy of that base branch, pointing open PRs based on this PR's branch at that base, and deleting this PR's local and remote branches. When the checkout is a linked git worktree, it also authorizes removing that worktree.

Run the script from the PR's branch checkout with this exact command. Add the PR number or URL after the script name only if the user gave one. The script does every git and gh step and every check. Do not run those steps yourself.

~/.local/bin/squash-merge-pr; rc=$?; cd ~; (exit "$rc")

The cd ~ keeps the shell out of a removed worktree. Without it, some tools report a failure after the script has succeeded. The (exit "$rc") keeps the script's exit code. Run later commands from another directory.

If the script exits with an error, report its output (the step it stopped at and whether the PR was merged) and stop. Do not retry, work around it, or finish the remaining steps by hand.

If it succeeds, report the PR link, the merge result, the base branch update, the branch cleanup result, and the worktree removal if there was one, from its output. Also report every follow-up command it printed for the PRs that were based on this one. Do not run them: they rewrite other branches.

04 同仓库更多 Skills