plugins/merge-pr/skills/merge-pr/SKILL.md
Use when a pull request is ready to merge — verifies CI and review status, syncs with the base branch, confirms with the user, then squash merges and cleans up. Trigger when the user says "merge this", "merge this PR", "squash merge", or "merge it". Works on any open PR — does not require /open-pr to have created it. If no PR exists, redirects to /open-pr. Does NOT deploy to any environment.
npx skillsauth add harnessprotocol/harness-kit merge-prInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Takes a ready PR and lands it: verify → sync → confirm → squash merge → cleanup.
Announce at start: "I'm using the merge-pr skill to merge this PR."
Check for an open PR on the current branch, or use a user-specified PR number:
# Current branch
gh pr view --json number,title,url,state,baseRefName,headRefName 2>/dev/null
# Or if user specified #N:
gh pr view <N> --json number,title,url,state,baseRefName,headRefName
No PR found: Stop and redirect:
"No open PR found on this branch. Use
/open-prto create one first."
PR found: Note the PR number, title, base branch, and URL. Continue.
Check CI status and review state:
gh pr checks <N>
gh pr view <N> --json reviews --jq '.reviews[] | select(.state == "CHANGES_REQUESTED")'
CI failing: Stop and report which checks are failing. Do not merge.
"CI is failing on [check names]. Fix these before merging, or use
/open-prto address them."
CHANGES_REQUESTED review: Stop and report who requested changes.
"PR has CHANGES_REQUESTED from [reviewer]. Resolve this before merging."
All clear: Continue.
Check whether the base branch has moved since branching:
BASE=$(gh pr view <N> --json baseRefName --jq '.baseRefName')
git fetch origin $BASE
git log HEAD..origin/$BASE --oneline
New commits exist: Rebase and force-push:
git rebase origin/$BASE
git push --force-with-lease
If rebase has conflicts, resolve them, then git rebase --continue. After force-push, re-verify CI passes before continuing.
No new commits: Skip.
Before merging, confirm:
Ready to squash merge PR #<N> ("<title>") into <base>.
All checks passed. Proceed?
Wait for confirmation. If the user says to always proceed without asking (e.g. "auto-merge", "no need to confirm"), skip this prompt for the rest of the session.
Once confirmed:
gh pr merge <N> --squash --delete-branch
After merge, sync locally:
git checkout $BASE
git pull
git branch -d <feature-branch> 2>/dev/null || true
Report: "PR #<N> merged. Branch cleaned up. Done."
| Step | Action | Block on failure? |
|------|--------|-------------------|
| 1. Identify PR | Current branch or #N | Yes — redirect to /open-pr |
| 2. Verify readiness | CI + review state | Yes — fix first |
| 3. Base sync | Rebase if behind | Yes — resolve conflicts |
| 4. Confirm | Wait for user | Yes — wait |
| 5. Squash merge | gh pr merge --squash + cleanup | — |
Never:
Always:
/open-prtools
Harness Kit documentation — installation, plugin catalog, creating plugins, cross-harness setup, architecture, and FAQ. Use when working with or configuring harness-kit plugins, understanding the plugin/skill system, installing slash commands, setting up AI coding tool configuration, answering questions about the plugin marketplace, writing SKILL.md files, using harness.yaml, or integrating with Copilot, Cursor, or Codex. Do NOT use for general Claude Code questions unrelated to harness-kit.
development
Use when user invokes /stats or asks about Claude Code usage, token consumption, session history, model distribution, or activity patterns. Generates an interactive HTML dashboard with charts and tables, auto-opens in browser. Also triggers on "how much have I used Claude", "show my usage", "token usage", "session stats", "usage report", "usage dashboard". Do NOT use for API billing or cost estimation — token counts are not costs.
development
Use when user invokes /review to review code changes. Also triggers on "review my code", "check this PR", "look at my changes". Accepts a PR number (e.g. /review 123), a path filter (e.g. /review src/auth/), or no argument (reviews current branch vs base). Produces structured per-file review with severity labels, cross-file analysis, and an overall verdict. Do NOT use for explaining what code does — use /explain instead.
testing
Use when user invokes /research command with any source — URL, GitHub repo, YouTube video, podcast, Reddit post, academic paper, documentation page, product site, local file, or empty. Processes and indexes research materials with raw source preservation and topic-level synthesis coalescing. Do NOT use for quick factual questions — use /explain instead.