Skip to content

docs(agents): teach agents to merge via the Trunk merge queue#3203

Merged
charlesvien merged 2 commits into
mainfrom
posthog-code/merge-queue-agent-skill
Jul 7, 2026
Merged

docs(agents): teach agents to merge via the Trunk merge queue#3203
charlesvien merged 2 commits into
mainfrom
posthog-code/merge-queue-agent-skill

Conversation

@gantoine

@gantoine gantoine commented Jul 6, 2026

Copy link
Copy Markdown
Member

What

Teaches in-app coding agents (Claude, Codex) to merge via the Trunk queue instead of gh pr merge.

  • New ## Merging PRs section in AGENTS.md (read by both Claude and Codex via the CLAUDE.md symlink): merges go through the queue, enqueue with gh pr comment <n> --body "/trunk merge", never gh pr merge, never force-push a queued branch.
  • New repo skill .claude/skills/merging-prs/SKILL.md — the enqueue + babysit loop: preflight → enqueue → poll the Trunk Merge Queue check 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

  • Docs/skill-only change. The skill's frontmatter triggers on "merge this PR", "merge when ready", "land/ship it", "babysit".

Created with PostHog Code

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
@trunk-io

trunk-io Bot commented Jul 6, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

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

@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "docs(agents): teach agents to merge via ..." | Re-trigger Greptile

Comment thread AGENTS.md
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
@gantoine gantoine marked this pull request as ready for review July 6, 2026 19:18
@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Reviews (2): Last reviewed commit: "docs(agents): drop redundant merge-queue..." | Re-trigger Greptile

@charlesvien charlesvien added the Create Release This will trigger a new release label Jul 7, 2026
@charlesvien charlesvien merged commit caa021f into main Jul 7, 2026
29 checks passed
@charlesvien charlesvien deleted the posthog-code/merge-queue-agent-skill branch July 7, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Create Release This will trigger a new release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants