Borrowing it
Nothing to install: this file belongs to apmantza/pi-lens. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/apmantza/pi-lens/master/.claude/skills/merge-train/SKILL.mdgit clone --depth 1 https://github.com/apmantza/pi-lensWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/apmantza/pi-lens/merge-train)<a href="https://agentmods.dev/skills/apmantza/pi-lens/merge-train"><img src="https://agentmods.dev/badge/skills/apmantza/pi-lens/merge-train/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/apmantza/pi-lens/merge-train"><img src="https://agentmods.dev/badge/skills/apmantza/pi-lens/merge-train.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 2 findings, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high Privilege Escalation · line 95 Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
- medium Data Exfiltration · line 94 Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00057 | $0.09121 |
| Opus 5 | $0.00028 | $0.04561 |
| Sonnet 5 | $0.00011 | $0.01824 |
| Haiku 4.5 | $0.00006 | $0.00912 |
Grade A, and why
merge-train scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 453 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Merge train
Source of truth for every rule below is
AGENTS.md("Role contracts for delegated work" → "Orchestrator rules", plus the defect catalog). This file is the procedure and the record; on any conflict AGENTS.md wins.
The policy that landed the 2026-08-17 arc (11 PRs, every one adversarially reviewed, zero unreviewed merges). Apply it to each PR in the queue.
The loop, per PR
- Review. Spawn
pi-lens-reviewer(worktree isolation) with the PR number, a one-paragraph summary of the claim, and any PR-specific attack angles. Self-authored and small PRs get reviewed too — the depth follows the review tier below, never the priority label. - Fix rounds. Send findings back to the PR's original author agent when
its worktree survives (SendMessage — cheapest context); otherwise spawn
pi-lens-fixeron the branch with the findings inlined. Since #2486,SubagentStopREAPS the stopped agent's own worktree (maintainer decision, 2026-09-02, reversing the earlier "never removes here" rule, which left ten stale trees in one afternoon). So by default an agent's tree is gone the moment it finishes, and SendMessage to it lands on a branch with no checkout. Its branch survives — a tree is never removed unless its HEAD is already in anorigin/*ref — so nothing committed is lost and a freshpi-lens-fixeron the branch always works. If this session intends to resume fixers by SendMessage, exportPILENS_HYGIENE_KEEP_AGENT_TREES=1for the session (or add--keep-agent-treeto the registered hook) and the reap is off. Kept trees are then reaped by theSessionStartsweep — which runs onstartupandresumeonly, not on/clear, compaction or a fork — once they have been idle ≥30m and are clean and pushed. Idle is measured from the checkout directory and the worktree's HEAD (and its reflog), never from the git index, so the sweep's own dirty check cannot make a finished tree look busy. A tree with uncommitted work, or with work not yet on anorigin/*ref, is never removed at any age, by any sweep — so a fix round in flight is safe by its own state, not by the clock. - Verify. The SAME reviewer verifies each fix round with its own probes.
Do not take the fixer's word; do not swap reviewers mid-PR. A reviewer's
worktree is an
agent-*tree too, so once its report lands the tree is clean+pushed andSubagentStopreaps it exactly like a fixer's — a SendMessage resume finds no checkout, same as above. Recreate it: the merge-train practice is a FRESH reviewer worktree per VERIFY round, not a kept one. Continuity is the reviewer AGENT (SendMessage still reaches the same identity, so the same judgment and probes carry over); the checkout under it is expected to be rebuilt each round, not preserved. Do not set--keep-agent-tree/PILENS_HYGIENE_KEEP_AGENT_TREES=1merely to dodge this — that decision stays off by default (see step 2). - Merge gate. Merge only when: verdict is merge-ready; every gating check
genuinely EXECUTED and passed on the exact head SHA
(
node scripts/ci-verdict.mjs <pr-number|sha>— a DIRTY PR silently skips them, absent is not green); every failing check was read and judged (infra failures — codeload 429/503, SARIF-upload errors, Initialize-CodeQL outages — may be waved through only with the log read and the judgment recorded). - Merge.
gh pr merge <N> --merge(merge commit, repo convention). If "not up to date",gh api -X PUT .../pulls/<N>/update-branch, wait for CI, re-gate, merge. On GitHub 503s: retry with backoff, never switch to raw-API merge endpoints. Alternative, once the verdict is in: apply thetrain:approvedlabel (addtrain:squashfor a squash merge) and let the merge-train lane workflow land it (#2185). The lane merges only when both required checks have CONCLUDED success on the exact current head, so a fix round pushed after labeling re-gates itself. Removing the label aborts. Steps 1 through 4 are unchanged: only the maintainer applies the label, and only after the review verdict. - After each merge. Master moved: check other open PRs for BEHIND/DIRTY,
check in-flight agents for file overlap with the merged diff and nudge
affected ones to merge origin/master before their next push.
Then prune the lane — and ONLY the lane: the merged-ness test is "this
tree's branch is the head of the PR just merged" (
gh pr view <n> --json headRefName), nevermerge-base --is-ancestor: a live fixer's branch with no commits yet passes the ancestor test, and on 2026-09-06 that removed #2358's tree with its uncommitted work.git worktree removeevery tree on the merged branch (fixer AND reviewer trees, wherever they were created) and delete the merged local branch. A lane's tree lives until its PR merges, not after — the orchestrator owns this step; the reaper only sees.claude/worktrees/agent-*, and on 2026-09-06 twenty-one merged trees were still standing at the regroup.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday Changed · +22 lines da10a9e08016
- 2d ago Changed · +106 lines 4659201563cb
- 4d ago Changed · +77 lines ed65b5b2a43c
- 5d ago Changed · +81 lines 025816830ed8
- 8d ago Changed · +109 lines 8705ae140904
- 13d ago First seen · 58 lines · 57 tokens per session scan A c72693bd7c2b
merge-train is a skill published in the GitHub repository apmantza/pi-lens (405 stars, last pushed today), licensed MIT. It adds 57 tokens to every session and 9,121 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
github-automation
GitHub workflow automation, PR management, issue tracking, and code review coordination. Integrates with GitHub Actions and repository management. Use when: PR creation, code review, issue management, release automation, workflow setup. Skip when: local-only changes, non-GitHub repositories.
github
GitHub via gh CLI: PRs, issues, reviews, repos, auth.
github
Full GitHub CLI control — issues, PRs, code reviews, repo management. Uses gh CLI with auth detection, rate limiting, and templates. Triggers on: github, issue, pull request, PR, code review, repo, branch, label, assignee, milestone, release, workflow, actions.
release
Release gentle-pi through GitHub and npm. Trigger: release, publish, npm publish, GitHub release, version bump.
release-pr-review
Review pass on an open release PR (release/ → main) — the step between git-wrapup and release-and-publish when a project releases in gated release PR mode. Reads the PR's commit range through the code-simplifier lens plus a correctness review, verifies whatever an automated reviewer left on the PR, lands fixes as…
pre-publish-review
Nuclear-grade 12-agent pre-publish release gate. Runs /get-unpublished-changes to detect all changes since last npm release, spawns up to 10 ultrabrain agents for deep per-change analysis, invokes /review-work (orchestrator manual QA plus one gate reviewer) for holistic review, and 1 oracle for overall release…