CommandMate: Command for Claude Code

.claude/commands/pr-merge-pipeline.md

pr-merge-pipeline is a command for Claude Code from Kewton/CommandMate. It costs 26 tokens per session (2,697 once invoked), scanned A, original, MIT.

A pull-request merge pipeline coordinates several completed feature branches, creates or reuses pull requests, waits for continuous-integration checks, merges them into develop in order, and runs an integration build. A pull request is a proposed code change for review; continuous integration automatically checks code changes.

In plain words
What is it for?
Use it to merge multiple issue branches, wait for their checks, control merge order, and verify the combined build.
Why use it?
It removes the manual coordination needed when several issue branches must be merged safely and in a chosen order.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is Kewton/CommandMate's own configuration. It tells Claude Code how to work on CommandMate itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything CommandMate configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Kewton/CommandMate. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Kewton/CommandMate/main/.claude/commands/pr-merge-pipeline.md
Clone the repo
git clone --depth 1 https://github.com/Kewton/CommandMate

Made for: Claude Code.

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-pipeline

README.md
[![agentmods](https://agentmods.dev/badge/commands/kewton/commandmate/pr-merge-pipeline.svg)](https://agentmods.dev/commands/kewton/commandmate/pr-merge-pipeline)
Your own site
<a href="https://agentmods.dev/commands/kewton/commandmate/pr-merge-pipeline"><img src="https://agentmods.dev/badge/commands/kewton/commandmate/pr-merge-pipeline.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,697 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00026 $0.02697
Opus 5 $0.00013 $0.01349
Sonnet 5 $0.00005 $0.00539
Haiku 4.5 $0.00003 $0.00270

Measured 7d ago against content hash 017574634abc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

pr-merge-pipeline 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 7d 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.

.claude/commands/pr-merge-pipeline.md · 316 lines

How it starts

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

PR Merge Pipeline

概要

複数ワーカー(featureブランチ worktree)のPR作成からdevelopへのマージ完了までを一貫して自動化するパイプラインです。commandmatedev CLIで各ワーカーを制御し、PR作成→CI通過待ち→順次マージ→統合ビルド検証を行います。

使用方法

  • /pr-merge-pipeline [Issue番号1] [Issue番号2] ...
  • /pr-merge-pipeline [Issue番号1] [Issue番号2] --merge-order 24,25 (マージ順序を指定)
  • /pr-merge-pipeline [Issue番号1] [Issue番号2] --skip-pr (PR作成済みの場合)

前提条件

  • developブランチ上で実行すること
  • 各Issueの開発がfeatureブランチで完了していること
  • CommandMateサーバーが稼働していること
  • 各Issueのworktreeが commandmatedev ls で表示されること

実行内容

あなたはリリースマネージャーとして、複数IssueのPR作成からマージまでを統括します。

パラメータ

  • issue_numbers: 対象のIssue番号(スペース区切り)
  • --merge-order: マージ順序をカンマ区切りで指定(省略時は自動決定)
  • --skip-pr: 既存PRがある場合、PR作成をスキップ

Step 1: 事前チェック

1-1. ブランチ確認

current_branch=$(git branch --show-current)
if [ "$current_branch" != "develop" ]; then
  echo "ERROR: developブランチで実行してください(現在: $current_branch)"
  exit 1
fi

1-2. ワーカー存在確認

各Issueに対応するworktreeが存在し、利用可能か確認:

commandmatedev ls --json

各worktreeについて:

  • 存在しない: エラー報告して中断
  • running(処理中): commandmatedev wait で完了を待つ
  • ready / idle: 続行可能

1-3. 既存PR確認

for issue_num in {issue_numbers}; do
  gh pr list --repo Kewton/CommandMate --head "feature/${issue_num}-worktree" --json number,title,state
done
  • open なPRが既にある → PR作成をスキップ
  • closed / なし → Step 2 でPR作成

Step 2: PR作成(並列)

--skip-pr 指定時はこのステップをスキップ。

2-1. 各ワーカーにPR作成を送信

for each worktree:
  commandmatedev send <worktree-id> "/create-pr" --auto-yes --duration 1h

2-2. 完了待機

for each worktree:
  commandmatedev wait <worktree-id> --timeout 600

2-3. PR番号の取得・記録

for issue_num in {issue_numbers}; do
  PR_NUM=$(gh pr list --repo Kewton/CommandMate --head "feature/${issue_num}-worktree" --json number -q '.[0].number')
  echo "Issue #${issue_num} → PR #${PR_NUM}"
done

PR番号を記録し、以降のステップで使用する。


Step 3: CI通過待ち(並列)

3-1. 各PRのCIステータスを確認

for each PR:
  gh pr checks <PR_NUM> --repo Kewton/CommandMate

Read the full file on GitHub · 316 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. 7d ago First seen · 316 lines · 26 tokens per session scan A 017574634abc

Subscribe to this mod's changes

pr-merge-pipeline is a command published in the GitHub repository Kewton/CommandMate (39 stars, last pushed today), licensed MIT. It adds 26 tokens to every session and 2,697 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.