merge-pr

merge-pr is a command for coding agents from developerz-ai/ai-task-master. It costs 0 tokens per session (503 once invoked), scanned A, original, MIT.

A command for taking an open GitHub pull request through checks, review comments, fixes, and merging. A pull request is a proposed code change awaiting review.

In plain words
What is it for?
Use it to monitor CI, send failures to a worker for fixes, handle unresolved review comments, merge the change, and continue to the next work group.
Why use it?
It keeps checking until automated tests pass and reviewer comments are resolved, reducing the chance of merging unfinished work.

Command

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/developerz-ai/ai-task-master/merge-pr
Clone the repo
git clone --depth 1 https://github.com/developerz-ai/ai-task-master

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/developerz-ai/ai-task-master/merge-pr.svg)](https://agentmods.dev/commands/developerz-ai/ai-task-master/merge-pr)
Your own site
<a href="https://agentmods.dev/commands/developerz-ai/ai-task-master/merge-pr"><img src="https://agentmods.dev/badge/commands/developerz-ai/ai-task-master/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 503 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.00000 $0.00503
Opus 5 $0.00000 $0.00251
Sonnet 5 $0.00000 $0.00101
Haiku 4.5 $0.00000 $0.00050

Measured 3d ago against content hash a6edd84c65e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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.

packages/aitm/docs/commands/merge-pr.md · 54 lines

What it actually says

aitm merge-pr

Drive an open PR to merge, then advance to the next PR group.

In the default automerge-on flow this logic runs inline inside aitm start — you only invoke aitm merge-pr directly when --no-automerge was used, or to resume a paused run.

Signature

aitm merge-pr
  [--pr N]          # default: state.json.currentPr
  [--no-resume]     # default: continue to next PR group after merge

Preconditions

  • .ai-task-master/state.json exists with status: awaiting-pr (or --pr provided explicitly).
  • gh CLI authenticated.
  • OPENROUTER_API_KEY set.

Flow

  1. CLI loads state via StateStore.
  2. GitHubClient fetches PR status and CI checks. Polls with exponential backoff until checks are conclusive.
  3. On CI failure: Orchestrator invokes Worker with failure logs to fix and push.
  4. GitHubClient fetches unresolved review comments via GraphQL.
  5. On unresolved comments: Orchestrator invokes Reviewer to address each, push fixes, request re-review, resolve threads.
  6. Loop 2–5 until checks green AND no unresolved comments remain.
  7. GitHubClient merges (squash by default). StateStore marks the group merged.
  8. Unless --no-resume: re-enter WorkLoop on the next PR group. Otherwise exit 0.

Defaults

Behavior Default Override
Automerge after green on --no-automerge on aitm start
Merge strategy squash --merge-method merge|rebase
Resume to next group on --no-resume

Failure modes

Mode Handling
Merge conflict Worker rebases onto base, retries push.
CI flaky Backoff with jitter, retry within session cap.
Persistent failure Exit 1, state preserved for inspection / resume.

See also

  • ./start.md
  • ../task-groups.md
  • ../subagents.md
  • ../github-integration.md
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. 3d ago First seen · 54 lines · 0 tokens per session scan A a6edd84c65e6

Subscribe to this mod's changes

merge-pr is a command published in the GitHub repository developerz-ai/ai-task-master (5 stars, last pushed 28d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 503 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-08-31.