coach: Command for Gemini CLI

.gemini/commands/github/merge-pr.toml

merge-pr is a command for Gemini CLI from watt-mind/coach. It costs 0 tokens per session (868 once invoked), scanned A, original, Apache-2.0.

A command for merging a GitHub Pull Request, which is a proposed set of code changes, into a local branch or remote repository. It checks for uncommitted work and reviews the pull request context before merging.

In plain words
What is it for?
It helps inspect open pull requests, handle the working tree, and merge an approved pull request with a commit message.
Why use it?
It helps prevent accidental merges over unsaved local changes and ensures the pull request and its related information are checked first.

Command for Gemini CLI

Written for Gemini CLI: installed under .gemini/. Also seen: mentions Gemini CLI.

This is watt-mind/coach's own configuration. It tells Gemini CLI how to work on coach 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 coach configures →

Reuse

Borrowing it

Nothing to install: this file belongs to watt-mind/coach. 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/watt-mind/coach/master/.gemini/commands/github/merge-pr.toml
Clone the repo
git clone --depth 1 https://github.com/watt-mind/coach

Made for: Gemini CLI.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/watt-mind/coach/merge-pr.svg)](https://agentmods.dev/commands/watt-mind/coach/merge-pr)
Your own site
<a href="https://agentmods.dev/commands/watt-mind/coach/merge-pr"><img src="https://agentmods.dev/badge/commands/watt-mind/coach/merge-pr.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 868 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.00000 $0.00868
Opus 5 $0.00000 $0.00434
Sonnet 5 $0.00000 $0.00174
Haiku 4.5 $0.00000 $0.00087

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

Security

Grade A, and why

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

.gemini/commands/github/merge-pr.toml · 48 lines

What it actually says

description = "Merges a GitHub Pull Request locally or remotely, ensuring non-interactive execution and inline commit messages." prompt = """ Your goal is to help the user merge a GitHub Pull Request (PR) into their current local branch or the remote repository.

User input: {{args}}

Workflow

  1. Ensure Clean State (CRITICAL):

    • Run git status --porcelain to check for uncommitted changes.
    • If there are local changes, STOP and ask the user if they want to commit them before proceeding with the merge.
    • If the user agrees, run git add . && git commit -m "chore: save local changes before merging PR" (or ask for a specific message).
    • DO NOT attempt to merge if the working directory is not clean, as this can lead to data loss or conflict complexities.
  2. Identify the Pull Request:

    • Parse {{args}} to find a PR number or URL.
    • If no PR is specified, list open PRs using search_pull_requests (filtered by state:open) or gh pr list --json number,title,author -L 10 to help the user choose.
  3. Analyze Context, Comments & Linked Issues (CRITICAL):

    • Fetch PR Details: Use pull_request_read (method='get') to get the PR details (branch name, author, description).
    • Identify Linked Issues: Parse the PR description and comments for issue references (e.g., #123, fixes #123). If none are found, use github__search_issues with keywords from the PR title to find potentially related issues.
    • Read Comments: Use gh pr view <pr_number> --comments or pull_request_read (method='get_comments').
    • Analyze: Specifically look for "suggestions", "requirements", or "feedback" that might block the merge.
    • Report: Briefly summarize the PR, list any identified issues, and report any crucial feedback found in the comments before merging. Confirm with the user if the identified issues should be linked/closed.
  4. Fetch and Merge (Non-Interactive):

    • Local Merge (Preferred for Testing):
      • Fetch the PR branch: git fetch origin pull/<pr_number>/head:pr-<pr_number>.
      • Merge the branch using the --no-edit flag and a message that references the linked issues (e.g., Merge PR #86; Closes #120): git merge pr-<pr_number> -m "Merge pull request #<pr_number> from <head_ref>. Closes <linked_issues>" --no-edit.
    • Remote Merge (GitHub CLI):
      • If the user wants to merge directly on GitHub: gh pr merge <pr_number> --merge --subject "Merge pull request #<pr_number>" --body "Merged via Gemini CLI. Closes <linked_issues>" (Always specify --merge, --squash, or --rebase and a subject to ensure non-interactive execution).
    • Handle Conflicts: If git merge reports conflicts, stop immediately. Do not attempt to resolve them automatically unless specifically directed.
  5. Post-Merge Verification & Issue Closing:

    • Run git status and git log -n 1 to confirm the successful merge.
    • Close Linked Issues: For any identified issues that aren't automatically closed by GitHub (e.g., if keywords were missing), use issue_write (method='update', state='closed') to close them manually after the merge is confirmed.
    • Inform the user of the merge result and which issues were closed.
  6. Completion:

    • Ask the user if they want to:
      • Run verification scripts (lint/test).
      • Push the local changes if merged locally (git push).
      • Delete the temporary local PR branch (git branch -D pr-<pr_number>). """
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. 2d ago First seen · 48 lines · 0 tokens per session scan A e0dbecb19a37

Subscribe to this mod's changes

merge-pr is a command published in the GitHub repository watt-mind/coach (83 stars, last pushed 5d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 868 tokens. 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-09-04.