Open PR: before running gh pr create, verify gh is authenticated:
gh auth status
If the output contains "not logged in" or exits non-zero, stop and ask the user to run:
gh auth login
Wait for confirmation that login succeeded, then proceed. Create a pull request targeting main:
gh pr create --title "Release vX.Y.Z" --body "$(cat <<'EOF'
## Summary
<CHANGELOG [vX.Y.Z] content here>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Print the PR URL.
Merge the PR via gh (preferred over the GitHub UI — keeps the flow in
the terminal and avoids context-switching). Ask the user to confirm the merge
strategy (--squash, --merge, or --rebase), then run:
gh pr merge <PR-NUMBER> --<strategy> --delete-branch
--delete-branch removes the remote branch after a successful merge. If
required checks are still running, add --auto so the merge fires once they
pass; otherwise omit it for an immediate merge. Stop and surface any merge
error (conflicts, failing required checks) — do not retry blindly.
CI merge gate. Branch protection on main requires every gating CI
check to be green and the branch to be up-to-date with main before a
merge is allowed (linear history is also enforced — only --squash or
--rebase work). If gh pr merge reports "required statuses must
pass" or similar, fail loudly: print the failing check names and
stop. Do not wait silently or poll the gate from this skill — the
user needs to see which check is red and decide how to resolve it
(fix and push, or open a separate task). The required-checks list and
the recipe for changing it live in
DEVELOPMENT_SETUP.md.
Note: --merge (true merge commit) is rejected by the linear-history
rule. If the user picks it, surface the constraint and ask them to
choose --squash (the project default) or --rebase instead.
Only fall back to "merge in the GitHub UI" if the user explicitly asks for a
manual review pass.