1

    A multi-format patch utility for AI edits featuring fuzzy matching and atomic writes.

    $12

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    mend

    Example session with this skill installed

    Use mend to apply this unified diff to update the README. The line numbers might be slightly off.

    --- README.md
    +++ README.md
    @@ -1,3 +1,3 @@
    -# Old Title
    +# New Project Title
    
    • Read your context and instructions
    • Compiled the mend

    I have applied the unified diff to update the project title in the README.md file. The tool successfully handled the line matching despite potential offsets.

    Patch Execution Result

    StatusPathOperationMatch Type
    MREADME.mdUpdate HeadingContent-Anchored
    ok1 file
    
    # Execution Log
    M README.md
    ok: 1 file
    

    Next steps

    • Verify the changes in README.md to ensure the title reflects "New Project Title".
    • Run your test suite to confirm the documentation change didn't impact any related build scripts.
    • Stage the modified file using git add README.md.
    the unified diff to update the project title in the README.md

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

    About this skill

    Applying AI-generated edits to a codebase often fails due to line number shifts or varying output formats. This skill provides a single, reliable utility to parse and apply patches regardless of how the LLM formatted them. It handles unified diffs, SEARCH/REPLACE blocks, V4A patches, and JSON tool-call edits using a three-tier fuzzy matching system.

    What it does

    • Multi-format parsing handles unified diffs, SEARCH/REPLACE blocks, V4A patches, and JSON tool-call edits automatically.
    • Fuzzy matching implements a three-tier logic that falls back from exact matching to whitespace-tolerant and content-anchored strategies.
    • Atomic writes ensure all-or-nothing execution per edit, preventing half-written files or corrupted states when a patch fails.
    • Validation prevents directory traversal by refusing absolute paths or .. references in patch files.
    • Dry run mode allows for checking patch applicability without committing any changes to the disk.

    How it works

    1. Run the utility via Node.js pointing to a patch file or piping content via standard input.
    2. Select a format mode using --format or let the tool auto-detect the patch style from the source text.
    3. Use the --check flag to verify if the patch applies cleanly to the current directory.
    4. Review the stdout for status codes like M for modified, A for added, or D for deleted files.

    Frameworks & tools

    Built for Node.js 22 using only the standard library. It requires no external dependencies and works entirely offline without network access.

    Why this beats prompting it yourself

    LLMs frequently hallucinate line numbers or mix patch formats in a single response. This tool provides a deterministic execution layer that recovers from common LLM formatting errors using content-anchored matching that raw patch commands often reject.

    Use cases

    • Applying SEARCH/REPLACE blocks generated by Claude or GPT-4o.
    • Executing JSON-based tool calls for automated refactoring scripts.
    • Patching files where the local source has drifted slightly from the LLM's training data or context window.
    • Batch processing multiple diffs in CI/CD pipelines.

    Known limitations

    Requires Node.js 22. Paths in patches must be relative and strictly contained within the current working directory.

    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

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 11 days ago

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access
    Environment Variables
    Listed11 days ago

    What's inside

    Frequently Asked Questions

    Mend solves the "hallucination" problem where LLMs provide valid code but incorrect line numbers or inconsistent diff formats. It uses a three-tier fuzzy matching system to anchor edits to actual file content rather than unreliable line markers.

    Mend is a standalone Node.js utility that works with any LLM—including Claude, GPT-4o, and Llama—regardless of whether they output unified diffs, SEARCH/REPLACE blocks, or JSON tool calls. It acts as a deterministic execution layer for any agentic workflow.

    No external dependencies are required; Mend is built using the Node.js 22 standard library for maximum security and portability. Simply run it via Node.js pointing to your patch file or pipe the LLM output directly into the utility.

    Mend includes a built-in validation layer that rejects absolute paths and parent directory references (`..`). This ensures that the AI can only modify files within your designated project folder, preventing unauthorized system access.

    You receive the full source code of the utility, optimized for Node.js 22, along with documentation on integrating it into your existing CI/CD or agent pipelines. The package is designed for immediate use as a CLI tool or a library module.

    Mend features a 'Dry Run' mode (`--check`) that simulates the entire patching process without writing to disk. This allows your agent to verify if a patch is valid before committing any permanent changes to your codebase.

    New in LLM Ops

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