mergetrain
llms.txt7 starsChanged 3 months agoMITView on GitHub
Queue committed branches from parallel LLM coding agents in Git worktrees. Test the combined tree in a local merge queue, require approval for Git pushes, and recover interrupted pushes. The normal product grammar is intentionally small:
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms-full.txtllms.txt
- mergetrainSkill
The file
We split this llms.txt into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 4
Test the combined tree in a local merge queue, require approval for Git pushes, and recover interrupted pushes.
- Very specific: line 26
Start with mergetrain status --json.
- Distinctive: line 33
Commit a clean HEAD before handing work off.
- Very specific: line 34
Read mergetrain status --json before handoff.
- Distinctive: line 36
Never push configured integration refs directly.
- Very specific: line 42
Only a separately authorized runner uses deploy or a daemon.
- Very specific: line 46
After fixing a blocked/failed job, use the retry_command from inspect with its clean committed owning branch.
- Very specific: line 50
Every JSON payload carries contract_version.
- Very specific: line 62
After ordinary enqueue, stop.
≈ “Common” is an estimate: at least 1 in 5 of the 4,067 llms.txt files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
# mergetrain for LLM agents Queue committed branches from parallel LLM coding agents in Git worktrees. Test the combined tree in a local merge queue, require approval for Git pushes, and recover interrupted pushes. The normal product grammar is intentionally small: ```text init status enqueue validate deploy inspect ``` ## Shared operating protocol <!-- BEGIN GENERATED: mergetrain-agent-protocol --> Purpose: Serialize committed local task branches through one merge/test/push/verify runner. ### Existing queues and explanations - Existing mergetrain repositories keep status → enqueue → stop even for one branch. Queue counts alone do not establish health, runner ownership, or recovery needs; read `health`, `state`, and `next_action` together. - For explanation-only requests, read the skill documentation when permitted and explain the procedure without Git or product commands. Distinguish hypothetical steps from observed state. ### Current command reference - The v3 core commands are `init`, `status`, `enqueue`, `validate`, `deploy`, and `inspect`. - Start with `mergetrain status --json`. Use `mergetrain status --diagnose --json` only for configuration, Git, runtime, or lock detail, and `mergetrain inspect JOB_ID --json` for job evidence. `doctor` is removed, not an alias for `status --diagnose`. - MCP calls default to the launch repository. If a task uses an explicit `repo`, keep that same value on every call; a status read does not change later scope. - Confirm uncertain syntax with the installed `mergetrain --version` and command-specific `--help` only when command execution is permitted. Otherwise use this reference and identify missing details; do not invent commands or copy older syntax from unversioned web results. Inspection and `next_action` do not authorize recovery or deployment. ### Rules 1. Work on a task-specific branch and worktree. 2. Commit a clean HEAD before handing work off. 3. Read mergetrain status --json before handoff. Task agents submit finished branches; an authorized runner follows next_action for validation, deployment, and recovery. 4. Enqueue every named finished branch in the requested order using only its task and branch; mergetrain resolves the worktree and captures the exact commits. Stop after the last successful enqueue unless the user explicitly authorized validation or the complete validation-and-deployment workflow. 5. Never push configured integration refs directly. One authorized runner owns validation and deployment; recovery and destructive actions require their stated approval. ### Safety boundary - A task agent enqueues every named finished branch, then stops. "Queue for validation" authorizes enqueue only; only an explicit request to run validation or the complete end-to-end workflow authorizes `validate`. - Another runner's wait or validation action does not prevent a task agent from submitting its clean branch. Enqueue checks submission preconditions; task agents do not run the runner's next action. - Only a separately authorized runner uses `deploy` or a daemon. - Deployment requires either confirmation of the human-readable exact plan or prior bounded unattended approval. Agents never select train IDs or supply plan hashes; structured evidence may include identifiers for inspection. - Unattended approval is bound to the exact destination and execution policy. Any change blocks before push. - Recovery and destructive cleanup require their stated approval. Follow `status.next_action`; never rewrite permanent deploy audit refs. - After fixing a blocked/failed job, use the `retry_command` from `inspect` with its clean committed owning branch. The tool determines whether approval can be retained; read `status` after retry. A deployed job's verification warning is not a failed submission to retry. ### Stable machine contract - Every JSON payload carries `contract_version`; ignore unknown keys and fail closed on unknown safety actions. - Requested upgrades keep the target release: check CLI, live daemon, and MCP versions separately, read the migration, and adapt affected consumers. A contract/version mismatch alone is not grounds for rollback. Preserve queued work and destination/policy bindings; follow [the upgrade procedure](https://github.com/yongjip/mergetrain/blob/main/docs/upgrading.md). - `deploy` means the atomic Git ref update plus configured verification. A downstream provider release is separate. <!-- END GENERATED: mergetrain-agent-protocol --> ## Normal workflow ```sh mergetrain status --json mergetrain enqueue --task "TASK" --branch BRANCH ``` After ordinary enqueue, stop. With explicit end-to-end authority, the operator path is `mergetrain status` followed by `mergetrain deploy`. `deploy` validates if needed, shows one exact plan, requires human confirmation, rechecks the plan, and only then may push. `validate` is the optional non-pushing path for running gates earlier. Use `inspect JOB_ID --json` only when status points to a job. `status` projects internal detail into Waiting, Running, Ready, Attention, and Done. If exceptional recovery is needed, follow its exact `next_action.command`; do not guess or edit the SQLite database. ## Integrations - MCP: install `mergetrain[mcp]` and run `mergetrain mcp`; the default server exposes exactly five tools matching status, inspect, enqueue, validate, and deploy. - Claude Code: install `mergetrain@mergetrain` from the `yongjip/mergetrain` marketplace. `/mergetrain:deploy` still requires the MCP client's human confirmation dialog. - agy: install `https://github.com/yongjip/mergetrain` as a native plugin. Its skill uses the same generated protocol and its MCP configuration launches the release-pinned wheel through `uvx`. See `docs/agent-contract.md`, `docs/contract.md`, and `docs/cli.md` for the authoritative details.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

