merging-prs

A procedure for merging a pull request, a proposed code change, into the master branch through Trunk's merge queue. The merge queue checks the change before it is added to the shared branch.

In plain words
What is it for?
Use it when asked to enqueue and watch a pull request until it is merged, or to report why Trunk removed it from the queue. It can inspect the pull request and monitor its checks and final state.
Why use it?
It prevents developers from using merge methods blocked by the repository's branch rules. It also requires explicit approval before an action that could make the pull request land and tells the agent to monitor the result.

Skill for Claude CodeCodex

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 skills/posthog/posthog-foss/merging-prs
Any agent
npx skills add PostHog/posthog-foss --skill merging-prs
Clone the repo
git clone --depth 1 https://github.com/PostHog/posthog-foss

Made for: Claude Code, Codex.

Per session 165 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,025 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.00165 $0.03025
Opus 5 $0.00082 $0.01512
Sonnet 5 $0.00033 $0.00605
Haiku 4.5 $0.00016 $0.00302

Measured today against content hash be375304e5d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

merging-prs 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 today.

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.

.agents/skills/merging-prs/SKILL.md · 162 lines

How it starts

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

Merge a PR through the Trunk merge queue

Merges into master go exclusively through the Trunk merge queue. gh pr merge and the GitHub merge button are blocked by branch ruleset. To merge, you enqueue the PR with a comment, then watch it until Trunk lands it.

Required user approval

Before posting /trunk merge, invoking trunk merge, or re-enqueueing, obtain explicit user approval in the current conversation for the identified PR or stack. These actions can cause a PR to land. Never infer approval from a request to prepare a PR, move it toward merge, make it ready, resolve blockers, monitor it, or babysit it. You may inspect status, address reviews and CI, apply stamphog when approval is missing, and report that the PR is ready; then wait for a direct instruction to merge or enqueue it.

<n> below is the PR number. Resolve the repo slug once if you need it: REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner).

1. Preflight

gh pr view <n> --json state,isDraft,mergeable,reviewDecision,statusCheckRollup,baseRefName
  • Not open (already merged/closed) → report and stop.
  • Draft → it can't be merged. Ask the developer to confirm, then gh pr ready <n> before continuing. Don't un-draft silently.
  • Failing required checks (statusCheckRollup) → the queue will just reject it. Report which checks are red and stop; fix them first. Pending checks are fine — the queue waits for them. To work out why a check is red, use /debugging-ci-failures.
  • Merge conflicts (mergeable == "CONFLICTING") → report and stop; merge master in first.
  • Missing approval (reviewDecision == "REVIEW_REQUIRED", or a stamphog approval was dismissed) → apply the stamphog label yourself: gh pr edit <n> --add-label stamphog. That triggers the automated review-and-approve flow (tools/pr-approval-agent/README.md); on an APPROVED verdict the Stamphog app posts the approval that satisfies the required review. Re-applying the label is always safe and is the intended retry path — it gets stripped on a REFUSED/ESCALATE verdict, and after addressing that feedback you re-apply it to request a fresh review. Read the reason first: every verdict is its own review from the Stamphog app, opening with whether it approved. Re-applying the label without changing anything just repeats the same verdict. It stays sticky across ordinary pushes (non-trivial deltas re-review automatically), and it never works on bot-authored PRs.
  • Part of a stack (baseRefName != "master", or the PR appears in gh api repos/$REPO/stacks) → the queue handles stacks natively: enqueueing a PR enqueues it and every unmerged layer below it, tests them together, and merges them atomically. After explicit user approval, comment /trunk merge on the top PR to merge the whole stack, or on the highest layer you want landed to merge just the bottom part. Run this preflight on every layer being merged, not only the one you comment on. /stacking-prs covers restack mechanics and the post-merge gh stack sync --prune.

Read the full file on GitHub · 162 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. today Changed be375304e5d1
  2. yesterday First seen · 162 lines · 165 tokens per session scan A 0c3afb4d6c37

Subscribe to this mod's changes

merging-prs is a skill published in the GitHub repository PostHog/posthog-foss (713 stars, last pushed today), licensed MIT. It adds 165 tokens to every session and 3,025 once invoked, about $0.0008 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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens