agentleFS
yongjipyongjip/mergetrain/AGENTS.md

mergetrain

AGENTS.md4 starsChanged 3 months agoMITView on GitHub

This repository contains mergetrain, a local deploy train for coding-agent worktrees. 1. Work on a task-specific branch and worktree. 2. Commit all changes before enqueueing. 3. Do not push deploy refs directly. For ordinary handoff, enqueue every named finished branch in the requested order with mergetrain enqueue --task <task> --branch <branch> and let mergetrain capture the exact SHAs. Stop after the last enqueue; asking to queue for validation does not authorize running validation. 4. Read mergetrain status --json first and…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,691 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository4 other files it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

14 rules. About 1 is common, 3 are distinctive, and 10 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Commit all changes before enqueueing.

    line 9
  2. Very specific:

    Do not push deploy refs directly.

    line 10
  3. Very specific:

    Read mergetrain status --json first and follow its structured next_action.

    line 15
  4. Very specific:

    Use --auto only after explicit unattended-deploy approval.

    line 18
  5. Very specific:

    Do not delete or rewrite remote refs/mergetrain/deploys/*.

    line 30
  6. Distinctive:

    Treat public product surface as an owner-evidence budget.

    line 32
  7. Very specific:

    Do not bump the version in feature or fix changes.

    line 38
  8. Very specific:

    When changing production imports, keep the one-way boundaries documented in docs/design.md.

    line 69
  9. Very specific:

    When changing public product surface, update the baseline and classification in docs/product-scope.md in the same change.

    line 73
  10. Very specific:

    Before asking the user to run gh auth login, retry authentication outside the sandbox and verify both credential access and the API, for …

    line 83
  11. Distinctive:

    If those external checks succeed, reuse the existing login.

    line 87
  12. Very specific:

    Prefer the connector for supported GitHub reads/writes.

    line 90
  13. Common:

    Never add provider-specific credentials to examples or tests.

    line 95
  14. Very specific:

    Keep core provider-neutral.

    line 96

≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

This repository contains mergetrain, a local deploy train for coding-agent worktrees.

Agent operating rules

  1. Work on a task-specific branch and worktree.
  2. Commit all changes before enqueueing.
  3. Do not push deploy refs directly. For ordinary handoff, enqueue every named finished branch in the requested order with mergetrain enqueue --task <task> --branch <branch> and let mergetrain capture the exact SHAs. Stop after the last enqueue; asking to queue for validation does not authorize running validation.
  4. Read mergetrain status --json first and follow its structured next_action. Use status --diagnose only for configuration, Git, runtime, or lock detail, and inspect <job-id> only for job evidence.
  5. Use --auto only after explicit unattended-deploy approval. A bounded instruction to QA, deploy, verify, and finish end-to-end grants that approval for the named task and destination; do not ask for each opaque train ID. Auto jobs are bound to that Git destination and the approved gate, reuse, and verify policy; they must block if either identity changes.
  6. Let one runner or daemon own merge and test. The default daemon may push and verify only --auto jobs; daemon --validate-only handles manual jobs but stops at a validated train and never deploys.
  7. Fix blocked or failed work in the owning branch, commit a clean result, then run mergetrain retry <job-id> to replace that outcome with a freshly pinned job. Do not enqueue the same active branch again. Retry is for blocked/failed jobs only and does not itself authorize validation or deployment.
  8. Do not delete or rewrite remote refs/mergetrain/deploys/*; they are permanent recovery evidence.
  9. Treat public product surface as an owner-evidence budget. Before adding a CLI command or flag, config field, UI or network listener, daemon/Hub behavior, MCP tool, recovery action, notification path, or reuse control, apply the admission test in docs/product-scope.md, prefer consolidation, and record the measured cost, repeated workflow, or incorrect state.
  10. Do not bump the version in feature or fix changes; add the changelog entry under ## Unreleased. Only a requested release-preparation change bumps the version, after applying the cadence rules in docs/release.md#when-to-cut-a-release; if the pending changes do not meet them, recommend waiting. When your change meets that section's patch-release criteria, say so at handoff and recommend a prompt patch release.
  11. For requested upgrades or mixed-version failures, read docs/upgrading.md. Keep the target release, check the live daemon as well as CLI/MCP, and adapt affected consumers using the release migration. Do not silently downgrade to satisfy an old contract assertion or stale process; preserve queued work and the existing approval scope.

Useful commands

python -m pytest -q -n auto --cov=mergetrain --cov-report=term-missing --cov-report=json:.coverage.json
python scripts/check_critical_coverage.py .coverage.json
PYTHONPATH=src python -m unittest discover -s tests
PYTHONPATH=src python -m mergetrain status --diagnose --json
PYTHONPATH=src python -m mergetrain init --project demo
python scripts/check_architecture.py

Pytest is configured to import the current src/ checkout without an external PYTHONPATH. If the full suite hits sandbox-only PermissionError failures for localhost sockets or process inspection, do not repeat it in the same sandbox: rerun it once outside the sandbox. Invoke mergetrain with the intended virtualenv's Python; gate commands automatically prioritize sibling tools from that environment.

When changing production imports, keep the one-way boundaries documented in docs/design.md; scripts/check_architecture.py is a blocking CI check. Do not silence it with broad exceptions—document and encode any legitimate new edge.

When changing public product surface, update the baseline and classification in docs/product-scope.md in the same change. Prefer consolidating an existing surface; do not turn an implementation possibility into a feature without a measured cost, concrete incorrect state, or repeated workflow need.

GitHub CLI authentication

  • The Codex sandbox may be unable to read gh credentials from the macOS Keychain. A sandboxed gh auth status or gh auth token failure is not proof that the stored token is invalid.
  • Before asking the user to run gh auth login, retry authentication outside the sandbox and verify both credential access and the API, for example with gh auth token -h github.com >/dev/null and gh api user --jq .login. Never print or log the token.
  • If those external checks succeed, reuse the existing login. Request a new login only when the same checks genuinely fail outside the sandbox.
  • The Codex GitHub connector and the local gh CLI use separate credentials. Prefer the connector for supported GitHub reads/writes; use externally run gh as the fallback when the connector lacks repository permission.

Boundaries

  • Never add provider-specific credentials to examples or tests.
  • Keep core provider-neutral; adapters belong under integrations/ or in a separate service repository.
  • Gate and verify commands run through /bin/sh; document new shell execution behavior clearly.

Imported Claude Cowork project instructions

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.