ingenious: Command for Claude Code

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

pr-merge is a command for Claude Code from Insight-Services-APAC/ingenious. It costs 0 tokens per session (1,218 once invoked), scanned A, original, MIT.

A command for managing GitHub pull requests through selection, conflict handling, checks, and a two-stage merge from a staging branch to a production branch.

In plain words
What is it for?
Use it to list and inspect pull requests, compare their descriptions with their changes, resolve conflicts, and merge them through staging and production.
Why use it?
It organizes the merge process and adds checks before changes move toward production.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions Claude Code.

This is Insight-Services-APAC/ingenious's own configuration. It tells Claude Code how to work on ingenious 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 ingenious configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Insight-Services-APAC/ingenious. 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/Insight-Services-APAC/ingenious/main/.claude/commands/git/pr-merge.md
Clone the repo
git clone --depth 1 https://github.com/Insight-Services-APAC/ingenious

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/insight-services-apac/ingenious/pr-merge.svg)](https://agentmods.dev/commands/insight-services-apac/ingenious/pr-merge)
Your own site
<a href="https://agentmods.dev/commands/insight-services-apac/ingenious/pr-merge"><img src="https://agentmods.dev/badge/commands/insight-services-apac/ingenious/pr-merge.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 1,218 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.01218
Opus 5 $0.00000 $0.00609
Sonnet 5 $0.00000 $0.00244
Haiku 4.5 $0.00000 $0.00122

Measured 2d ago against content hash 81fd26165f9d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, 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 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.

.claude/commands/git/pr-merge.md · 114 lines

How it starts

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

Pull Request Merge Workflow

Arguments

  • $ARGUMENTS - Format: [staging-branch] [production-branch] (defaults: staging main)
    • First argument: Staging branch name (default: staging)
    • Second argument: Production branch name (default: main)

Overview

You are an expert GitHub repository manager and Python developer. Your task is to help the user manage pull requests by listing them, allowing selection for merging, and then handling all merge conflicts and quality checks using a two-stage merge process: first to the staging branch, then to the production branch.

Workflow Steps

  1. List Pull Requests: Use GitHub MCP to fetch and display all open pull requests with their details (number, title, author, branch, description, etc.)

  2. User Selection: Present the pull requests in a clear format and ask the user to select which pull request(s) they want to merge. Allow multiple selections.

2a. Verify PR Completeness: Before merging, verify the PR description accounts for all changes:

  • Run gh pr view <number> --json body to get current PR description
  • Run gh pr diff <number> to see all changes in the PR
  • Compare PR description against actual changes
  • If PR description is incomplete or missing changed files, update it with comprehensive summary
  • Ensure all modified files are explained in the PR description
  1. Merge Process: For each selected pull request:

    • Check if the PR can be merged cleanly into the staging branch
    • Attempt to merge the pull request into the staging branch
    • If merge conflicts occur, identify and resolve them intelligently by:
      • Analyzing the conflicting code
      • Understanding the intent of both changes
      • Creating a resolution that preserves functionality from both branches
      • Testing the resolution makes sense in context
  2. Quality Assurance Pipeline: After merging to the staging branch, run the complete quality pipeline:

    a. Test Suite: Run uv run pytest

    • If tests fail, analyze the failures and fix them
    • Re-run tests until they pass

Read the full file on GitHub · 114 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. 2d ago First seen · 114 lines · 0 tokens per session scan A 81fd26165f9d

Subscribe to this mod's changes

pr-merge is a command published in the GitHub repository Insight-Services-APAC/ingenious (24 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,218 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.