Squash Merge PR
Overview
Squash merge a PR using GitHub (not local git), with a properly formatted commit message that follows the project's commit standards.
Use this skill only when the user explicitly requests a squash merge. Some PRs are rebased instead - this skill is not for those.
This is a two-phase skill. Phase 1 drafts the message and stops. Phase 2 executes the merge after user approval.
Phase 0: Brivlo
If brivlo:send_event is available, use brivlo:send_event scm-tools:squash-merge as your first step.
Phase 1: Draft Commit Message
Step 1: Get PR Details
gh pr view --json title,body,commits,files
Step 2: Review the Changes
Understand what the PR accomplishes by reviewing:
- •PR title and description
- •List of commits
- •Files changed
Step 3: Draft Commit Message
Follow the commit message rules from /commit:
- •Subject line ≤50 characters
- •Capitalize the subject
- •No period at the end
- •Imperative mood — "Add", "Fix", "Update" (not "Added", "Fixed")
- •Wrap body at 72 characters (if body needed)
- •Explain what and why, not how
- •NEVER add branding or footers
Step 4: Present and STOP
Show the drafted message to the user:
Proposed commit message: ─────────────────────── <subject line> <optional body> ───────────────────────
STOP HERE. Take no further action until the user approves.
Phase 2: Execute Merge
Only proceed when the user explicitly approves the message.
Step 1: Squash Merge via GitHub
gh pr merge --squash --subject "<subject>" --body "<body>"
- •Use
--subjectfor the first line - •Use
--bodyfor the rest (if any) - •Add
--delete-branchif user wants remote branch deleted
IMPORTANT: Do NOT perform local git operations. This uses GitHub's merge, not local squash.
Step 2: Confirm
Report:
- •PR merged successfully
- •Final commit message used
- •Whether branch was deleted
Red Flags
If you catch yourself doing these, STOP:
- •Merging without approval - Always show message first and wait
- •Using local git merge/squash - Use
gh pr mergeonly - •Adding Co-Authored-By or footers - Never add branding
- •Subject over 50 chars - Shorten it
- •Past tense verbs - Use imperative mood
- •Using this for rebase merges - This skill is for squash only
Quick Reference
| Phase | Action | Output |
|---|---|---|
| 1. Get PR | gh pr view --json ... | PR details |
| 1. Draft | Follow commit rules | Message draft |
| 1. Present | Show message | STOP |
| 2. Merge | gh pr merge --squash | PR merged |
| 2. Confirm | Report result | Done |