Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseOpenClawOpenClaw+21 more

    DiffValidator

    1

    Structural AST guardrail that prevents AI agents from silently deleting code or breaking syntax during patches.

    $15

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    Security scanned
    DiffValidator

    DiffValidator

    Example session with this skill installed

    Validate this patch for api_client.py. It should only update the timeout logic, but I suspect the agent might have trimmed the file.

    • Read your context and instructions
    • Compiled the diffvalidator
    • Generated the document

    I have analyzed the diff for api_client.py by comparing the Abstract Syntax Trees of the original and the patched versions. The validation failed because the patch removed a critical method without authorization.

    Diff Validation Report

    MetricOriginalPatchedResult
    Top-level Functions22Match
    Classes11Match
    Class Methods43MISSING
    Imports55Match
    Syntax CheckValidValidPass

    🚨 DIFF VALIDATION FAILED — BLOCKED

    ERR_ITEM_REMOVED: ApiClient.get_health_status (was line 42)
    No explicit delete command was issued for this method. The patch attempted to update request_timeout but silently dropped the health check method during the rewrite.

    Action: Patch rejected. The diff removes get_health_status() without authorization.

    Next steps

    • Re-run the generation with a strict "keep all existing methods" instruction.
    • If the removal was intentional, provide an explicit delete ApiClient.get_health_status command.
    • Review the diff at line 42 to see if it was a truncation error.

    diffvalidator.pdf

    PDF · document

    Generated

    Example file from a real run - the skill writes it into your workspace.

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

    What you get

    Block patches that silently drop class methods or imports.Ensure AI-generated code never breaks syntax before saving to disk.Detect unintentional renames during large-scale refactoring.Audit multi-agent code writes in CI/CD pipelines.

    About this skill

    AI agents often hallucinate when generating code patches, leading to silent regressions where critical functions or imports vanish. This skill provides a structural validation layer that compares Abstract Syntax Trees (AST) to ensure no code is lost during the refactoring process.

    What it does

    • AST Structural Comparison parses files before and after patches to detect missing functions, classes, or methods.
    • Silent Deletion Prevention blocks any patch that removes code elements without an explicit instruction to delete them.
    • Syntax Integrity Guard rejects any generated patch that results in broken, unparsable syntax.
    • Rename Detection identifies when code has moved or changed names rather than being deleted, flagging it for review.
    • Inventory Reporting generates a precise summary of additions, removals, and structural changes.

    How it works

    1. Parse Original reads the existing file and generates a baseline AST inventory of all top-level elements.
    2. Simulate Patch applies the diff to a temporary buffer and attempts to parse the result into a new AST.
    3. Compare Inventories checks every function, class, and import against the baseline to find discrepancies.
    4. Enforce Policy blocks the write operation if unauthorized removals or syntax errors are detected.

    Frameworks & tools

    Uses language-specific parsers including Python ast, JavaScript/TypeScript @babel/parser, and Go go/parser.

    Why this beats prompting it yourself

    Prompting an agent not to delete code is unreliable as the LLM often truncates output to save tokens or loses track of context. This skill uses deterministic AST analysis to provide a mathematical guarantee that the structure remains intact, regardless of the LLM's internal state.

    Use cases

    • Preventing AI agents from "cleaning up" required imports during refactors.
    • Validating PR suggestions in CI/CD pipelines to ensure no methods are dropped.
    • Guarding multi-agent workflows where one agent writes and this skill audits.

    Known limitations

    Does not support non-code files like YAML, JSON, or Markdown. Requires a supported language parser to be available in the environment.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 2 days ago

    • Passed all security checks, Safe to install

    Listed2 days ago

    What's inside

    Frequently Asked Questions