Diff applier

From Nhqvu2005/VibeGravityKit · View interactive version

Diff applier is an AI agent skill from the GitHub repository Nhqvu2005/VibeGravityKit. Smart Patcher — Apply Diff, Lint, and Auto-Index.

How to use this skill

Skill file

Diff Applier

Purpose

Apply code changes ("patches") safely, saving tokens by not rewriting the whole file. Automatically checks for lint errors and updates the codebase index.

Usage

1. Create a Patch File

The patch file must use SEARCH/REPLACE blocks:

<<<<<<< SEARCH
def old_function():
    return True
=======
def new_function():
    return False
>>>>>>> REPLACE

2. Apply Patch

python .agent/skills/diff-applier/scripts/apply_patch.py src/main.py my_patch.txt

Workflow

  1. Backup: Creates src/main.py.bak.
  2. Apply: Replaces exact text matches.
  3. Lint: Runs flake8 (Python) or eslint (JS) if available.
  4. Index: Calls codebase-navigator to update the project index.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.