merge-queue — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited merge-queue (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use when serializing merges across multiple agent branches, resolving conflicts between agent outputs, or cleaning stale task branches.
What is this skill? This skill manages the serialized merge queue for agent branches. Covers atomic locking, idempotency checks, non-fast-forward merges, and worktree cleanup. Use when merging multiple agent tasks to master, resolving merge conflicts between agents, or cleaning up stale task branches. Do NOT use for standard git operations (use version-control).
This skill manages the serialized merge queue for agent branches. The sections below contain the detailed rules, examples, and boundaries for using this skill correctly.
| File | Purpose |
|---|---|
scripts/agent/merge-queue.sh | The primary CLI for managing the queue. |
agent-orchestration/logs/events.jsonl | Emits merge_started and merge_completed events. |
Use the ordered phases, checklists, and guardrails in the sections below as the canonical workflow for this skill. When multiple subsections describe steps, follow them in the order presented.
Atomic merge locking (merge.lock), branch idempotency checks, --no-ff (non-fast-forward) merge policy, automated worktree and branch cleanup, and event emission.
The "Gatekeeper" for the master branch. Prevents agents from causing race conditions during the final commit phase.
Merge queues exist to protect the main branch from concurrent merge failures. When multiple agents modify overlapping code simultaneously, merging them independently creates a false sense of safety — each agent's work may pass CI alone but break when combined. A merge queue serializes merges, ensuring every commit is tested against the current state of main plus all queued predecessors before pushing. The result is a main branch that is always in a known-good state, with clear task-level history preserved via non-fast-forward commits. This prevents both silent conflicts (where two agents unwittingly overwrite each other's work) and long debugging sessions trying to untangle which merge introduced a regression.
To prevent merge conflicts and history pollution, all agents must submit their finished tasks to the merge queue.
| Phase | Action | Tool |
|---|---|---|
| Lock | Acquire merge.lock | scripts/agent/merge-queue.sh (merge subcommand) |
| Verify | Check branch state | Verify branch is up to date with master and passes tests. |
| Merge | Non-FF Merge | Merge with --no-ff to preserve task history. |
| Cleanup | Delete branch/worktree | Remove the git worktree and the remote task branch. |
| Release | Release merge.lock | Allow the next agent in the queue to proceed. |
merge-queue.sh automatically deletes the task-specific worktree (/tmp/worktrees/SH-XXXX) to save disk space.bash scripts/agent/merge-queue.sh merge --task SH-XXXXbash scripts/agent/merge-queue.sh statusbash scripts/agent/merge-queue.sh cleanup --task SH-XXXX| File | Purpose |
|---|---|
scripts/agent/merge-queue.sh | The primary CLI for managing the queue. |
.git/merge.lock | (Virtual) The lock file preventing concurrent merges. |
agent-orchestration/logs/events.jsonl | Emits merge_started and merge_completed events. |
--no-ff merge commits for agent tasks./tmp/worktrees/ directory is pruned after successful merges.| Instead of this skill | Use | Why |
|---|---|---|
| Ordinary branching, rebasing, committing, or tag management | version-control | Version-control owns general git history shape; this skill owns only serialized agent-branch integration. |
| Reviewing whether a branch's code is correct before merge | code-review | Code-review owns behavioral approval; this skill owns the queue mechanics after a branch is ready. |
| Explaining what changed in a branch or patch | diff-analysis | Diff-analysis owns patch interpretation; this skill owns merge ordering, locks, and cleanup. |
| Investigating a failed test or production bug after merge | debugging | Debugging owns failure localization; this skill only preserves merge order and records queue state. |
After applying this skill, verify:
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.