mergemain

mergemain is a skill for Claude Code, Codex from nazmulnahid-git/Ai-Stack. It costs 97 tokens per session (1,422 once invoked), scanned A, original, MIT.

A Git workflow that fetches the latest default branch and merges it into the branch you are working on.

In plain words
What is it for?
Use it before continuing feature work or opening a pull request when your branch has fallen behind the main project branch.
Why use it?
It helps bring in teammates’ changes while resolving conflicts by considering both versions, instead of blindly choosing one side.

Skill for Claude CodeCodex

Part of the ai-stack plugin — 4 skills shipped together

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.

agentmods
npx agentmods add skills/nazmulnahid-git/ai-stack/mergemain
Any agent
npx skills add nazmulnahid-git/Ai-Stack --skill mergemain
Clone the repo
git clone --depth 1 https://github.com/nazmulnahid-git/Ai-Stack

Made for: Claude Code, Codex.

Or install ai-stack, the plugin that ships this one along with the rest of its 4 skills.

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 mergemain

README.md
[![agentmods](https://agentmods.dev/badge/skills/nazmulnahid-git/ai-stack/mergemain.svg)](https://agentmods.dev/skills/nazmulnahid-git/ai-stack/mergemain)
Your own site
<a href="https://agentmods.dev/skills/nazmulnahid-git/ai-stack/mergemain"><img src="https://agentmods.dev/badge/skills/nazmulnahid-git/ai-stack/mergemain.svg" alt="Measured on agentmods" height="20"></a>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,422 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00097 $0.01422
Opus 5 $0.00048 $0.00711
Sonnet 5 $0.00019 $0.00284
Haiku 4.5 $0.00010 $0.00142

Measured 3d ago against content hash 89ab5a2d3498, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mergemain 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 3d 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/mergemain/SKILL.md · 132 lines

How it starts

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

mergemain

Merge the latest main into the current branch and resolve the conflicts correctly. The whole point is the conflict resolution: never resolve by picking a side because it is easier.

Step 1 — Pre-flight

git rev-parse --abbrev-ref HEAD          # current branch
git status --porcelain                   # must be clean
git remote -v
git rev-parse --abbrev-ref origin/HEAD   # real default branch (main/master/develop)
  • If HEAD is already the default branch, stop and tell the user — there is nothing to merge.
  • If the working tree is dirty, stop and ask: commit, stash, or abort. Do not stash silently; someone's uncommitted work is not yours to move.
  • Note the current HEAD sha so you can offer an exact rollback later.

Step 2 — Get main fresh

git fetch origin --prune

Merge from origin/<default> directly — do not check out main, and do not rely on a stale local copy. Report how far behind the branch was (git rev-list --count HEAD..origin/main) and how many files main touched.

Step 3 — Merge

git merge origin/main --no-edit

If it merges cleanly, jump to Step 6.

Step 4 — Understand before resolving

List the conflicts (git diff --name-only --diff-filter=U) and, for each file, build real context before touching it:

  • git log --oneline HEAD..origin/main -- <file> — why main changed it.
  • git log --oneline origin/main..HEAD -- <file> — why this branch changed it.
  • Read the whole file, not just the <<<<<<< hunks, plus the callers of anything whose signature moved.

Classify each conflicted hunk:

  • Disjoint — the two sides changed different concerns that happen to sit on adjacent lines. Keep both, ordered so the file still reads correctly.
  • Same concern, main is newer — main refactored/renamed/moved what the branch also edited. Take main's structure and re-apply the branch's intent on top of it (rename the branch's call sites, move its logic into main's new file, adapt to the new signature). Never discard the branch's behavior just because main rewrote the surroundings.
  • Same concern, genuinely competing — both sides implement the same thing differently. This is the only case that needs a decision, and it is the case you escalate if it is not obvious.

Read the full file on GitHub · 132 lines

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. 3d ago First seen · 132 lines · 97 tokens per session scan A 89ab5a2d3498

Subscribe to this mod's changes

mergemain is a skill published in the GitHub repository nazmulnahid-git/Ai-Stack (2 stars, last pushed 26d ago), licensed MIT. It adds 97 tokens to every session and 1,422 once invoked, about $0.0005 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-31.

Related

Other skills, from other repositories

x402

Set up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key. Two setups it works out up front — "just use it" (set up a wallet so you or Claude Code can run cloud browser tasks paid from the wallet — Claude writes and runs throwaway scripts, nothing…

browser-use/browser-use · 175 tokens

browser-use

Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work.

browser-use/browser-use · 26 tokens

open-source

Documentation reference for writing Python code using the browser-use open-source library. Use this skill whenever the user needs help with Agent, Browser, or Tools configuration, is writing code that imports from browseruse, asks about @sandbox deployment, supported LLM models, Actor API, custom tools, lifecycle…

browser-use/browser-use · 137 tokens

ocx

Drive a running opencodex (ocx) proxy from the CLI — account pools, provider routing, model catalog, usage and cost attribution, request logs, access keys, storage cleanup, and the management API. Use when a task involves controlling or inspecting an opencodex proxy rather than editing the opencodex codebase.…

lidge-jun/opencodex · 0 tokens

kayba-stage-5-action-plan

Triage each insight into discard/code-fix/prompt-fix and produce a prioritized action plan with specific recommendations. Trigger when the user says "run stage 5", "make action plan", "triage skills", or when invoked by the kayba-pipeline orchestrator. Requires eval outputs from stages 1-4.

kayba-ai/agentic-context-engine · 74 tokens

kayba-stage-2-domain-context

Gather domain context about the repository and agent — system prompt, tool definitions, domain docs, and behavior patterns from traces. Trigger when the user says "run stage 2", "gather context", "domain context", or when invoked by the kayba-pipeline orchestrator.

kayba-ai/agentic-context-engine · 64 tokens