Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Merge Pr This

ASecurity

Merge one PR via gh with a merge commit matching the repo's git history — readiness-gated, CI-watched, trunk synced after

3 stars
0 votes
0 copies
1 views
Added 9/19/2026
ai-agentsgobashgit

Works with

claude code

Security Analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned 9/19/2026

$npx -y skills add tony/skills --skill merge-pr-this --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Merge Pr This?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Merge Pr This
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tony-merge-pr-this/badge)](https://www.skillsdirectory.com/skills/tony-merge-pr-this)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: merge-pr-this
description: >-
  Merge one PR via gh with a merge commit matching the repo's git history —
  readiness-gated, CI-watched, trunk synced after
disable-model-invocation: true
allowed-tools: ["Bash", "Read", "Grep", "Edit", "AskUserQuestion"]
metadata:
  argument-hint: "[PR number or URL] [--squash | --rebase | any other gh pr merge flag]"
  source: "plugins/merge-pr/skills/this/SKILL.md"
---

# Merge This PR

Merge a single pull request — the one this conversation is about, or
the one the current branch belongs to — via `gh pr merge`, with a
merge commit whose message matches the repository's own
`git log --merges` history. Nothing merges until the readiness gate
passes.

Read `references/merge-readiness.md` first; it
defines the readiness gate, the rebase procedure, the merge-message
derivation, flag passthrough, the `--admin` policy, and the rule that
merging is not releasing.

User arguments: $ARGUMENTS

## Context

Current branch — run this command and read the output:

```bash
git branch --show-current
```

PR for the current branch — run this command and read the output:

```bash
gh pr view --json number,title,url,state,isDraft,baseRefName,mergeable,mergeStateStatus,reviewDecision 2>/dev/null || echo "(no PR for current branch)"
```

Checks — run this command and read the output:

```bash
gh pr checks 2>/dev/null || echo "(no PR or no checks)"
```

## Procedure

### 1. Identify the PR

Precedence: an explicit argument (number or URL) > the PR this
conversation has been working on > the current branch's PR. If the
candidates disagree — the argument names one PR while the
conversation is about another — ask via `ask-user-choice` before
proceeding.

### 2. Run the readiness gate

Apply the readiness gate from the reference. Pending checks are
waited on with `gh pr checks <n> --watch`; failing checks, a draft
state, or `CHANGES_REQUESTED` halt with a report. If the PR is
`BEHIND` or `DIRTY`, confirm with the user, then follow the rebase
procedure: rebase, resolve conflicts, verify content did not drift,
`git push --force-with-lease`, and watch CI again.

### 3. Compose the merge commit message

Follow the merge-message section of the reference: study
`git log --merges` on trunk, match the observed format, keep the body
proportional to the change, and stay provincial — no release or
version claims unless the PR itself is release work. Skip this step
when the user's flags make the message theirs to control (their own
`-t`/`-b`, or `--rebase`, which produces no merge commit).

### 4. Merge

Default to a merge commit; pass the user's `gh pr merge` flags
through verbatim:

```console
gh pr merge <n> --merge -t "<subject>" -b "<body>"
```

Use `--admin` only within the reference's policy — CI green, blocked
purely by branch protection, nothing violating AGENTS.md — and ask
first if the user did not pass it.

### 5. Sync trunk and stand by

Checkout trunk, pull, and confirm the PR reports merged. Then stop:
no tagging, no releasing, no follow-on work.

## Rules

- The merge goes through `gh pr merge`, never a local `git merge`
  pushed to trunk.
- Never merge over failing or pending CI, with or without `--admin`.
- Force-pushes use `--force-with-lease` and only ever target the PR
  branch.
- When in doubt at any step, ask — an unnecessary question costs a
  moment; a wrong merge costs an afternoon.

## Output

Open with a one-line hero (`✓ Merged #N: <title>` or
`⚠ Blocked: <reason>`), then exactly these sections:

1. `## Merge readiness` — the gate results, including anything that
   required a rebase or a wait on CI.
2. `## Merge` — strategy used, flags passed through, and the merge
   commit subject (or why no merge happened).
3. `## Trunk` — the post-merge trunk state after checkout and pull.

End with an `ask-user-choice` panel offering next steps (for example:
cut a release from the merged trunk, merge another PR, delete the
local branch, stop here) — skip the panel only in plan mode.

Offer the release when the merged trunk is a releasable state and the
repo carries the version files a release touches; name the skill that
cuts it rather than the git commands. Tagging and pushing stay the
user's explicit act either way.


## Portability notes

- `ask-user-choice` — present the listed options and wait for the user to pick one. Hosts with a structured multiple-choice tool (Claude Code's `AskUserQuestion`) should use it; otherwise print a numbered list and wait for a numbered reply. Never proceed on an assumed answer.
- `$ARGUMENTS` — the text the user passed when invoking this skill. If your host does not substitute it, read it as the user's request in the current turn, and ask when there is none.
- Bundled files — every relative path in this skill points at a file shipped inside this skill directory. Read them from here, not from the host's plugin tree.

Attribution

tonytony
View sourceSee grades on GitHubMore from tony →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →