pr-merge

pr-merge is a command for coding agents from LeanAndMean/mach10. It costs 14 tokens per session (1,120 once invoked), scanned A, original, MIT.

A command workflow for merging a pull request, deleting its feature branch, and optionally making a release. A pull request is a proposed code change awaiting review and checks.

In plain words
What is it for?
Use it after review to verify a pull request, merge it safely, remove the feature branch, and optionally create release notes or a version tag.
Why use it?
It checks whether the pull request is ready and stops when reviews, automated checks, or mergeability are blocking the merge.

Command

Part of the mach10 plugin — 14 commands, 1 agent shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/leanandmean/mach10/pr-merge
Clone the repo
git clone --depth 1 https://github.com/LeanAndMean/mach10

Or install mach10, the plugin that ships this one along with the rest of its 14 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pr-merge

README.md
[![agentmods](https://agentmods.dev/badge/commands/leanandmean/mach10/pr-merge.svg)](https://agentmods.dev/commands/leanandmean/mach10/pr-merge)
Your own site
<a href="https://agentmods.dev/commands/leanandmean/mach10/pr-merge"><img src="https://agentmods.dev/badge/commands/leanandmean/mach10/pr-merge.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,120 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00014 $0.01120
Opus 5 $0.00007 $0.00560
Sonnet 5 $0.00003 $0.00224
Haiku 4.5 $0.00001 $0.00112

Measured 5d ago against content hash aaf045d80f78, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pr-merge scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/pr-merge.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Merge and Release

You are merging a PR that has passed review and the pre-merge checklist, then optionally creating a release.

User input: $ARGUMENTS

Step 1: Parse Input

The user's input contains:

  • A PR number (required)
  • Additional context or constraints (optional)

Extract the PR number from the input. If the input is ambiguous, ask the user to clarify. If context was provided, note it for use in later steps (e.g., release notes guidance, version tag preference).

Step 2: Verify Readiness

Confirm the PR is ready to merge:

gh pr view <pr-number> --json state,mergeable,mergeStateStatus,reviewDecision,statusCheckRollup

If there are blocking issues, report them to the user and stop. Do NOT force-merge.

  • Failed CI checks: Suggest /clear then /mach10:pr-ci-fix <pr-number> to diagnose and fix the failures.
  • Merge conflicts: Suggest resolving conflicts manually or rebasing the branch.
  • Missing review approval: Suggest requesting a review.
  • Branch behind main: When mergeStateStatus is BEHIND, suggest /clear then /mach10:pr-pre-merge <pr-number> to update the branch before merging.

Step 3: Merge

Merge the PR using the repository's default merge strategy, and delete the remote feature branch in the same command:

gh pr merge <pr-number> --delete-branch

Then update local main:

git checkout main && git pull

Clean up the local feature branch if it still exists. Get the branch name from the PR:

gh pr view <pr-number> --json headRefName --jq .headRefName

Then delete the local branch:

git branch -d <branch-name-from-above>

Step 4: Ask About Release

If the user provided context about release creation, honor it as guidance for this step:

  • Skip directives (e.g., "skip release", "no release this time"): Skip the AskUserQuestion below entirely and proceed directly to Step 6. Report in CLI output: "Skipping release per user request." The user has already declined; re-asking is friction without safety benefit. No release will be created; this is the safe path.
  • Release-creating directives (e.g., "tag as v2.0.0", "highlight the auth changes"): Still ask the question below, but frame it to acknowledge the user wants to create a release and present "Create release" as the recommended choice in the question text. Stash the specific details (tag, highlights, notes style) for the Step 5 draft. The yes/no gate is preserved because a release is a substantive action -- Claude should not draft and create one without an explicit confirmation, even if the user named a tag.
  • No release-relevant context: Ask the question below as a neutral yes/no.

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 121 lines · 14 tokens per session scan A aaf045d80f78

Subscribe to this mod's changes

pr-merge is a command published in the GitHub repository LeanAndMean/mach10 (20 stars, last pushed 3mo ago), licensed MIT. It adds 14 tokens to every session and 1,120 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.