docs(agents): teach agents to merge via the Trunk merge queue#3203
Merged
Conversation
Add a "Merging PRs" section to AGENTS.md and a merging-prs skill so Claude and Codex enqueue PRs with `/trunk merge` and babysit them through the queue (preflight, poll the "Trunk Merge Queue" check run, handle failures) instead of running `gh pr merge`, which the ruleset blocks. Generated-By: PostHog Code Task-Id: 2d321370-0c0e-4d63-89d7-e367ebd9ecee
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Contributor
|
Reviews (1): Last reviewed commit: "docs(agents): teach agents to merge via ..." | Re-trigger Greptile |
Remove the trailing "See docs/merge-queue.md" line from the Merging PRs section per review; the doc is already linked from the babysit-loop bullet. Generated-By: PostHog Code Task-Id: 2d321370-0c0e-4d63-89d7-e367ebd9ecee
Contributor
|
Reviews (2): Last reviewed commit: "docs(agents): drop redundant merge-queue..." | Re-trigger Greptile |
charlesvien
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Teaches in-app coding agents (Claude, Codex) to merge via the Trunk queue instead of
gh pr merge.## Merging PRssection inAGENTS.md(read by both Claude and Codex via theCLAUDE.mdsymlink): merges go through the queue, enqueue withgh pr comment <n> --body "/trunk merge", nevergh pr merge, never force-push a queued branch..claude/skills/merging-prs/SKILL.md— the enqueue + babysit loop: preflight → enqueue → poll theTrunk Merge Queuecheck run + PR state every ~60s (bounded) → report merged/failed with the Trunk bot's reason → cancel on request. Auto-discovered as a repo skill.Why
Devs want to tell an agent "merge this PR" and have it enqueue and watch the PR through the queue until it lands. Without guidance, an agent would reach for
gh pr merge, which the ruleset blocks.Notes
Created with PostHog Code