Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

merging-prs

БесплатноБез исполняемых скриптовНе проверен

Merge a PR into `master` through the Trunk merge queue and babysit it until it lands. Enqueue with the `trunk merge` CLI (the `/trunk merge` comment is the…

PostHogот PostHog★ 41 278 звёзд на 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 the trunk CLI, then watch it until Trunk lands it. Use the trunk CLI for queue actions (enqueue, status, cancel). Post a /trunk ... comment on the PR only when the CLI is not available, or for an option the CLI does not have (see step 2). The CLI talks to Trunk over an authenticated session and reports the result at once. A comment adds noise to the PR thread, and you only learn whether Trunk took it from the bot's reply.

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, request a stamphog review 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,isCrossRepository
  • 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.

  • Cancelled runs on the head → check for these before the failing-checks stop below, because a cancelled run also turns statusCheckRollup to FAILURE. A push can start two runs of a workflow for one head, and the concurrency group cancels one. GitHub keeps both runs' checks, and a newer green check with the same name does not clear them. A cancelled run that carries a required check (a workflow's ... Tests Pass gate, or the org-level semgrep workflow) keeps the merge box blocked and Trunk at "Not ready". Rerun every cancelled run rather than working out which ones carry one. Reruns need the developer's permission.

    # GitHub Actions. `gh run rerun` returns 404 for the org-level semgrep workflow; the API call works for every run.
    gh api "repos/$REPO/actions/runs?head_sha=<head-sha>&per_page=100" --paginate \
        --jq '.workflow_runs[] | select(.conclusion == "cancelled")
            | select((.pull_requests | length) == 0 or any(.pull_requests[]; .number == <n>))
            | "\(.id)\t\(.name)"'
    gh api -X POST "repos/$REPO/actions/runs/<run-id>/rerun"
    
    # Depot CI. A run with more than one workflow also needs --workflow <workflow-id>, listed by `depot ci status <run-id>`.
    depot ci run list --repo "$REPO" --sha <head-sha> --status cancelled
    depot ci rerun <run-id>
    
  • 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.

  • Head is on a fork (isCrossRepository == true) → Depot CI starts no backend run for a fork, so Backend CI on Depot / Test results stays pending and the queue cannot merge it. Report that and stop. After review, a PostHog engineer re-creates the change on a branch in this repository with /recreating-fork-prs.

  • Missing approval (reviewDecision == "REVIEW_REQUIRED", or a stamphog approval was dismissed) → ask stamphog for a review. Stamphog is the automated review-and-approve flow (the engine README): on an APPROVED verdict the Stamphog app posts the approval that satisfies the required review. Use the MCP route first, and the PR comment only when MCP is not available.

    • MCP (first choice). Call the PostHog MCP tool code-review-approvals-runs-create with repository (the $REPO slug) and pr_number. It returns the run at once, with status queued. Poll code-review-approvals-runs-get with the run id until status is completed, gated, failed, or superseded. Read verdict and reasoning there, not on GitHub. created: false means a run already covers the current head, so do not request again until the head moves. A request covers one head: after you push, request again.
    • Refusals. A 409 not_reviewable means stamphog does not review this PR at all (a draft, closed, bot-authored, from outside the repo, or an author without write access). The message says which. A PR comment cannot help there, so report it.
    • PR comment (fallback). Run gh pr comment <n> --body "@posthog stamp" wh
Полный SKILL.md на GitHub

Установить merging-prs в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл merging-prs?

Merge a PR into `master` through the Trunk merge queue and babysit it until it lands. Enqueue with the `trunk merge` CLI (the `/trunk merge` comment is the fallback), then watch `trunk merge status` and the PR state until it is MERGED or the queue kicks it out, reporting Trunk's own reason for the terminal transition. Use when asked to merge a PR, "merge when ready", "land it", "ship it", to merge a whole stack (enqueue the top PR — the queue merges it and every layer below atomically), to get a PR approved by stamphog (MCP review request first, a `@posthog stamp` PR comment as the fallback), or to babysit/watch a PR through the queue. Never use `gh pr merge` in this repo — the queue is the only path into master.

Как установить скилл merging-prs?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл merging-prs запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить merging-prs с