merge-agent

merge-agent is a skill for Claude Code, Codex from EZotoff/ez-omo-config. It costs 0 tokens per session (1,981 once invoked), scanned A, original, MIT.

A guarded procedure for merging a worktree branch into the main branch. A worktree is a separate working directory for a Git branch, and the procedure tracks state, locks merges, rebases, cleans up, and rolls back failures.

In plain words
What is it for?
Use it to validate a feature worktree, rebase it onto origin/main, merge it into the main worktree, release merge locks, and clean up afterward.
Why use it?
Merging from the wrong directory or during a conflicting merge can lose work or leave the repository in an unclear state. This procedure adds checks and recovery steps.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument; mentions OpenCode.

Good fit Use it to validate a feature worktree, rebase it onto origin/main, merge it into the main worktree, release merge locks, and clean up afterward.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ezotoff/ez-omo-config/merge-agent
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add EZotoff/ez-omo-config --skill merge-agent
Clone the repo
git clone --depth 1 https://github.com/EZotoff/ez-omo-config

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for merge-agent

README.md
[![agentmods](https://agentmods.dev/badge/skills/ezotoff/ez-omo-config/merge-agent/github.svg)](https://agentmods.dev/skills/ezotoff/ez-omo-config/merge-agent)
Your own site
<a href="https://agentmods.dev/skills/ezotoff/ez-omo-config/merge-agent"><img src="https://agentmods.dev/badge/skills/ezotoff/ez-omo-config/merge-agent/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.

agentmods 80×15 button for merge-agent

Your own site · 80×15
<a href="https://agentmods.dev/skills/ezotoff/ez-omo-config/merge-agent"><img src="https://agentmods.dev/badge/skills/ezotoff/ez-omo-config/merge-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,981 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01981
Opus 5 $0.00000 $0.00991
Sonnet 5 $0.00000 $0.00396
Haiku 4.5 $0.00000 $0.00198

Measured 11d ago against content hash 6bbf5d3d6e23, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

merge-agent 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 11d ago.

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.

skills/merge-agent/SKILL.md · 302 lines

How it starts

The opening of the file, as written. The whole thing — 302 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/merge-worktree

Safely merge a worktree branch into main with strict local state tracking, lock discipline, and deterministic rollback.

  • Name: merge-agent
  • Description: Safely merge worktree branches into main with state tracking and conflict resolution
  • Triggers: /merge-worktree, merge branch, integrate worktree

Usage

/merge-worktree <branch>
/merge-worktree --branch=<branch>

Optional runtime context:

  • project-id: Used for state path resolution under ~/.local/share/opencode/worktree-state/<project-id>/
  • session-id: Used for merge lock ownership (lockedBy)

Overview

This skill performs a guarded local-only merge flow:

  1. Pre-Merge Validation — ensure we are in a feature worktree and clean
  2. Merge Lock Acquisition — serialize merges via merge.lock
  3. Rebase Before Merge — rebase branch onto origin/main
  4. Merge Execution — merge from the main worktree, never from feature worktree context
  5. Post-Merge Cleanup — finalize state, release resources, remove worktree
  6. Rollback — deterministic failure handling for each failure mode

Pre-Merge Validation

1) Verify we are in a worktree (NOT primary main checkout)

Run:

git rev-parse --git-common-dir

Rules:

  • If result equals .git (or resolves to primary checkout root), STOP.
  • Merge execution must originate from a feature worktree session, but actual merge command runs in the main worktree path using git -C.

2) Verify working tree is clean

Run:

git status --porcelain

Rules:

  • Any output means uncommitted changes exist.
  • STOP until all changes are committed.

3) Load branch state

Read state file:

~/.local/share/opencode/worktree-state/<project-id>/worktrees/<branch>.json

Validate:

  • file exists
  • branch matches target branch
  • status is eligible (ready or merging recovery state)
  • worktreePath exists

If validation fails: mark state failed if possible and stop.

Read the full file on GitHub · 302 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 11d ago First seen · 302 lines · 0 tokens per session scan A 6bbf5d3d6e23

Subscribe to this mod's changes

merge-agent is a skill published in the GitHub repository EZotoff/ez-omo-config (6 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,981 tokens. 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-31.