Agent Skills: Merge an ha PR

Merge a ca PR after confirming it is genuinely ready — open, not draft (in ca a draft means the Codex-Claude review loop has not approved it), green CI, mergeable, no unresolved blocking feedback. Use once the ca loop marked the PR ready and you want it merged from the CLI. Refuses to merge drafts, red checks, or conflicts. Invoke explicitly with /ca:merge-pr.

UncategorizedID: ken2403/.claude-paralell-dev-plugin/merge-pr

Install this agent skill to your local

pnpm dlx add-skill https://github.com/ken2403/claude-parallel-dev-plugin/tree/HEAD/ha/skills/merge-pr

Skill Files

Browse the full folder contents for merge-pr.

Download Skill

Loading file tree…

ha/skills/merge-pr/SKILL.md

Skill Metadata

Name
merge-pr
Description
Merge a reviewed PR after confirming it is genuinely ready — open, not draft, no changes requested, green CI, up to date with base, no unresolved blocking feedback. Use once /ha:review-pr approves a feature's PR. Refuses to merge on red checks, changes-requested reviews, or conflicts. Invoke explicitly with /ha:merge-pr.

Merge an ha PR

Input

$ARGUMENTS

Merging is the one irreversible step in the pipeline, so it gets a real gate. Confirm readiness with evidence before merging — never merge on assumption.

Step 1 — Preflight (all must pass)

PR="<pr-number from the arguments, or empty to auto-detect>"
[ -n "$PR" ] || PR="$(gh pr view --json number --jq .number 2>/dev/null)"  # no number given -> current branch's PR
[ -n "$PR" ] || { echo "no PR number given and none found for the current branch" >&2; exit 1; }
gh pr view "$PR" --json state,mergeable,mergeStateStatus,reviewDecision,statusCheckRollup,headRefName,isDraft

Block the merge and report if any of these hold:

  • state is not OPEN, or isDraft is true.
  • reviewDecision is CHANGES_REQUESTED (a human requested changes on GitHub). Do NOT require APPROVED: a /ha:review-pr APPROVE is a process gate that lands as a PR comment — it never sets reviewDecision (and the PR's own author cannot approve it on GitHub), so requiring APPROVED would block solo use forever.
  • CI (statusCheckRollup) is not all-green.
  • mergeable is false / mergeStateStatus indicates conflicts or out-of-date — in that case update from base first: run /ha:resolve-conflicts <pr> (it merges the base in the feature's isolated worktree and re-verifies), then re-run this skill.
  • There is unresolved blocking review feedback.

If anything fails, stop and say exactly what's missing — do not "force" it.

Step 2 — Merge

Default to the repo's convention (squash is common; respect any branch-protection rule). Delete the remote branch on merge to keep things tidy:

gh pr merge "$PR" --squash --delete-branch   # or --merge / --rebase per repo norm

This follows superpowers:finishing-a-development-branch's ordering — merge first, then reclaim the worktree (the next step), and never delete a branch that still has unmerged work.

Step 3 — Confirm and hand off

gh pr view "$PR" --json state,mergedAt

result: PR #<n> merged.

Remind the user that once the PR is merged, its isolated worktree and local branch can be reclaimed with /ha:clean-worktrees (it removes only worktrees whose PR is verified merged).