merge-check

merge-check is a command for Claude Code from s977043/river-review. It costs 39 tokens per session (4,517 once invoked), scanned A, original, MIT.

A pre-merge checklist command for a GitHub pull request. A pull request is a proposed code change, and the command checks whether it meets the project’s documented requirements before merging.

In plain words
What is it for?
Use it immediately before merging a pull request to identify failed checks, unresolved human comments, or other conditions that should block the merge.
Why use it?
It replaces informal checks with commands that verify passing CI, pending or failed checks, and both kinds of GitHub review comments. CI means automated builds and tests run for the change.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the river-review plugin — 138 skills, 18 commands, 5 agents, 3 hooks shipped together

Good fit Use it immediately before merging a pull request to identify failed checks, unresolved human comments, or other conditions that should block the merge.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/s977043/river-review/merge-check
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.

Clone the repo
git clone --depth 1 https://github.com/s977043/river-review

Made for: Claude Code.

Or install river-review, the plugin that ships this one along with the rest of its 138 skills, 18 commands, 5 agents, 3 hooks.

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 merge-check

README.md
[![agentmods](https://agentmods.dev/badge/commands/s977043/river-review/merge-check/github.svg)](https://agentmods.dev/commands/s977043/river-review/merge-check)
Your own site
<a href="https://agentmods.dev/commands/s977043/river-review/merge-check"><img src="https://agentmods.dev/badge/commands/s977043/river-review/merge-check/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for merge-check

Your own site · 80×15
<a href="https://agentmods.dev/commands/s977043/river-review/merge-check"><img src="https://agentmods.dev/badge/commands/s977043/river-review/merge-check.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,517 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.00039 $0.04517
Opus 5 $0.00019 $0.02259
Sonnet 5 $0.00008 $0.00903
Haiku 4.5 $0.00004 $0.00452

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

Security

Grade A, and why

merge-check 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 4d 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/merge-check.md · 185 lines

How it starts

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

マージ前チェック: PR #$ARGUMENTS が gh pr merge 可能な状態か、docs/governance.md § 「PR レビューとマージ」>「マージ前チェックリスト」(SSoT) の全項目を実コマンドで検証して判定する。

このスキルは gh pr merge を実行する 直前 に呼び出すことを想定している。抽象的な確認でなく、以下の検証コマンドを実際に実行して MERGE_OK / BLOCKED の判定まで行う。詳細な背景・pagination の落とし穴・disposition ルールの正は docs/governance.md にあり、本コマンドは実行手順の具体化のみを担う。

検証手順

Step 1. CI green の確認

gh pr checks $ARGUMENTS --json name,bucket,startedAt --jq 'group_by(.name) | map(if any(.[]; .bucket == "pending") then (map(select(.bucket == "pending")) | first) else max_by(.startedAt) end) | .[] | select(.bucket != "skipping")'
  • 全チェックが pass バケットであることを確認する(skipping は除外可)
  • group_by(.name) 以降は同名 check のうち pending があればそれを、無ければ startedAt が最新の run を残す。queued の run は startedAt がゼロ時刻(0001-01-01T00:00:00Z)で並ぶため、max_by だけでは古い cancel / pass を最新と誤って採り、pending を隠す。gh pr checks は同じ head に対する全 run(concurrency で cancel された古い run を含む)を並べるため、これが無いと再実行済みの cancelfail と読む(2026-09-04..05 に 3 回発生)
  • pending が残る場合はマージせず、完了まで待ってから再実行する
  • fail がある場合はマージ不可。pre-existing の main 失敗でも本 PR を直接マージせず、先に main を green に戻す(governance.md § 1 参照)

Step 2. レビュアーコメントの全件列挙と disposition 確認

2 つのエンドポイントを両方実行する。 pulls/<N>/comments は line comments(差分の行に紐づくレビューコメント)しか返さず、PR 本体に投稿された通常コメント(issue comment)は issues/<N>/comments からしか取得できない。

まず、列挙そのものはスクリプトで実行する。2 系統の --paginate 取得と bot の切り分けを決定論で行い、disposition の作業リストを出力する(refs #1827)。

npm run check:comment-disposition -- $ARGUMENTS
  • 終了コード 0 = 人間由来のコメントなし(Step 2 は pass)、1 = 人間由来のコメントあり(出力された各件の disposition を確定するまで pass にしない)、2 = 使い方の誤りまたは gh の失敗
  • exit 1 は「マージ禁止」ではなく「確認せよ」を意味する。disposition 済みかどうかをスクリプトは判定しない(判定できないため。理由は下記「なぜスクリプトは disposition の完了まで見ないか」)
  • 人間 / bot の切り分けは GitHub API の user.typeBot / User)で行い、bot 名の除外リストは持たない。ただし PAT で動く自動化は user.type: "User" を返すため、bot が人間として列挙されることがある。その場合は投稿者名で判断する
  • スクリプトが gh の失敗などで exit 2 になった場合は、下記の生コマンドへフォールバックする

生コマンド(スクリプトが使えない場合、または本文全体を読みたい場合):

gh api --paginate "repos/:owner/:repo/pulls/$ARGUMENTS/comments?per_page=100" \
  --jq '.[] | {id, in_reply_to_id, user: .user.login, path, line, commit: .commit_id, body}'

Read the full file on GitHub · 185 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. 4d ago Changed · +1 lines 7a0784eef4fe
  2. 9d ago First seen · 184 lines · 39 tokens per session scan A 11a5fd70ccae

Subscribe to this mod's changes

merge-check is a command published in the GitHub repository s977043/river-review (3 stars, last pushed today), licensed MIT. It adds 39 tokens to every session and 4,517 once invoked, about $0.0002 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-31.