mend
by Haiyang Lan
A multi-format patch utility for AI edits featuring fuzzy matching and atomic writes.
$12
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
| Status | Path | Operation | Match Type |
|---|---|---|---|
| M | README.md | Update Heading | Content-Anchored |
| ok | 1 file |
# Execution Log
M README.md
ok: 1 file
Next steps
- Verify the changes in
README.mdto 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.
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
- Run the utility via Node.js pointing to a patch file or piping content via standard input.
- Select a format mode using
--formator let the tool auto-detect the patch style from the source text. - Use the
--checkflag to verify if the patch applies cleanly to the current directory. - Review the stdout for status codes like
Mfor modified,Afor added, orDfor 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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
What's inside
Frequently Asked Questions
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.