Works with the AI Agents you already use

    Merge Loss Guard

    by Nahid hossain

    1

    Dry-run any git merge and prove nothing was lost: reverted merges, forbidden branches, deleted files and dropped lines.

    Free

    Security scanned
    Merge Loss Guard

    Merge Loss Guard

    Example session with this skill installed

    Merge feature/billing into main. Ensure no code from the 'experimental-vault' branch leaks in.

    • Read your context and instructions
    • Compiled the merge loss guard

    I have previewed the merge without changing anything. A plain merge would bring in 4 commits from experimental-vault, would not bring back the billing work you reverted earlier, and would conflict on one file.

    Merge Guard Preview Report

    CheckResultDetails
    Reverted work❌ Foundd4e5f6a on main reverts the earlier merge of feature/billing. Git treats that work as already merged, so a plain merge would not bring it back
    Forbidden branch❌ Found4 commits from experimental-vault would reach main (the branch was started from it)
    Conflicts❌ 1 filesrc/gateways/stripe.js
    Files deleted✅ NoneNo unexpected deletions
    Commits to bring1612 billing commits and 4 from experimental-vault

    Verdict: Don't merge the branch. Cherry-pick only the 12 billing commits.

    Proposed Plan

    1. Cherry-pick the 12 billing commits onto main, skipping the 4 from experimental-vault. Replaying them as new commits also restores the reverted work, so the revert of the revert isn't needed.
    2. Resolve src/gateways/stripe.js by keeping both sides' changes.
    3. Before committing, run lost --ours main --theirs feature/billing. Lines from the 4 skipped commits will show as missing. That is expected. Anything else needs a look.
    4. Re-run the preview with --forbid experimental-vault to confirm nothing leaked, then run the tests.

    I will not run any command that changes a branch until you approve. Nothing is pushed unless you ask.

    Next steps

    • Approve the plan, or tell me if you would rather merge and use the revert of the revert instead.
    • Review the list of 12 commits I'm about to cherry-pick.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    Merges lose work quietly. A merge that was reverted earlier leaves its work out when you merge again. A branch started from the wrong place brings in commits nobody meant to ship. A conflict resolved by "take theirs" drops the other side's fixes.

    What it does

    • Previews the merge before it happens without changing your branches
    • Finds reverted merges and commits that a plain merge would silently skip
    • Flags commits from branches that must never reach the target
    • Lists files the merge deletes and files that lose many lines
    • After you resolve conflicts, lists every line either side added that is missing from the result
    • Proves the finished merge kept everything and that the tests pass

    Why not just prompt your agent?

    An agent will merge and report success. This skill adds a read-only preview and a line-by-line check that shows exactly what was lost.

    Works with

    Any git repository. Needs git 2.38 or newer and Python 3.8 or newer.

    Test prompts

    • Merge feature/payments into main.
    • We reverted that merge last week and now want it back in.
    • Code went missing after the merge. Find what was lost.
    • Merge this branch but nothing from the experimental branch may come along.

    Safety

    It never commits, pushes, resets or switches branches without your approval. The script only reads and uses no network.

    Where it stops

    It reports what is missing but cannot judge whether a dropped line was meant to go, so you confirm each one.

    Looks for reverts only in the last 3,000 commits of the target branch. Compares added lines of 4 or more characters, so very short lines, meaning changes and binary files are not checked, and a line moved elsewhere in the same file counts as present. Lines replaced on purpose are listed too, so review each one. A commit cherry-picked from a forbidden branch is not recognised as coming from it. Needs git 2.38+ and Python 3.8+. Review all changes.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Frequently Asked Questions

    This skill performs a read only dry run of a git merge to identify reverted work that might be silently skipped, forbidden branch contamination, and accidental data loss during conflict resolution. It provides mathematical proof that every intended line of code survived the merge process rather than relying on LLM guesswork.

    You need a repository running Git 2.38 or newer to use the preview features, along with Python 3.8 or higher to execute the included guard script. If you are using an older version of Git, the skill will instead guide the agent to perform the merge in a temporary throwaway worktree folder.

    The skill produces a verdict report that flags specific findings like reverted work, forbidden commits, and conflicted files. It also provides a list of specific git commands to resolve these issues, such as revert-the-revert or selective cherry-picking, followed by a proof report showing any lines lost during the process.

    This skill is not designed for rebasing or performing squash-merges. It focuses specifically on standard git merges and requires user approval before any commands that change branches, such as reverts or cherry-picks, are executed.

    You can prompt your agent to merge one specific branch into another while checking for data loss. You should also mention if there are any specific branches, such as private or experimental tracks, that must never be allowed to reach your target branch.

    No. The script only reads. Branch changes happen only after you approve them.

    The skill falls back to a merge in a throwaway worktree.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.

    Free