Skip to content
Back to skills

Merge Train

ASecurity

Use when the user asks to merge a batch of pull requests, or asks in what order to merge them. Has <merge-order> propose the order, then runs the one <train command> on the user's go-ahead. Never merges with --admin and never merges a pull request outside the train.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
toolsgo

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add mnaimfaizy/agent-kit --skill merge-train --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Merge Train?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Merge Train
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mnaimfaizy-merge-train/badge)](https://www.skillsdirectory.com/skills/mnaimfaizy-merge-train)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
# Pattern guide skeleton: docs/patterns/merge-train.md in Agent-kit.
# Copy this folder's SKILL.md into your skills directory, fill in every
# <placeholder>, and delete these comment lines.
name: <merge-train>
description: Use when the user asks to merge a batch of pull requests, or asks in what order to merge them. Has <merge-order> propose the order, then runs the one <train command> on the user's go-ahead. Never merges with --admin and never merges a pull request outside the train.
---

# Merge a batch through the train

## Who does what

| Step                                                 | Owner                             |
| ---------------------------------------------------- | --------------------------------- |
| Propose the order and the command                    | `<merge-order>` agent (read-only) |
| Show the order and the command to the user           | You                               |
| Run the train                                        | The user, or you when they say so |
| Update, wait, merge, stop                            | `<train command>`                 |
| Decide whether a candidate may auto-merge (optional) | `<train command> --auto`          |

## Rules

- Never run `gh pr merge` yourself, and never pass `--admin`. The only way a batch merges is `<train command>`.
- Never run the train without the user's go-ahead for that batch. A merge cannot be taken back; a revert is a new change on the base branch.
- Do not apply any merge rule yourself: do not skip a pull request because its review "looks fine" or hold one because it "looks risky". Pass the order; the train reads its facts for each head.
- When the train stops, report the reason and the pull requests it never reached, exactly as it printed them. Do not rerun it past the stop until the cause is fixed.
- A pull request the train stopped on for a conflict is rebased by its author or by you on the user's say, then the train is run again **from that pull request**.
- `--auto` runs in the mode the base branch's `<path to your auto-merge mode file>` sets. Never edit that file to change what one pass does; a mode change is its own pull request.

## Steps

1. Call `<merge-order>` with the pull request numbers. Do not give it an order.
2. Show the user the `ORDER:`, the `LEFT OUT:` line with its reasons, and the `COMMAND:`.
3. When the user says to go, run the command and wait for it to finish. Do not background it or cancel it.
4. Report what merged, where it stopped and why, and what it never reached.

Files in this skill

  • SKILL.md2.5 KB
  • auto-merge-mode.json20 B
  • merge-order.agent.md1.9 KB
  • merge-train-core.mjs13.3 KB
  • merge-train-core.test.mjs7 KB
  • merge-train.mjs5.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.