Works with the AI tools you already use
DiffValidator
Structural AST guardrail that prevents AI agents from silently deleting code or breaking syntax during patches.
$15
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
| Metric | Original | Patched | Result |
|---|---|---|---|
| Top-level Functions | 2 | 2 | Match |
| Classes | 1 | 1 | Match |
| Class Methods | 4 | 3 | MISSING |
| Imports | 5 | 5 | Match |
| Syntax Check | Valid | Valid | Pass |
🚨 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_statuscommand. - Review the diff at line 42 to see if it was a truncation error.
diffvalidator.pdf
PDF · document
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
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
- Parse Original reads the existing file and generates a baseline AST inventory of all top-level elements.
- Simulate Patch applies the diff to a temporary buffer and attempts to parse the result into a new AST.
- Compare Inventories checks every function, class, and import against the baseline to find discrepancies.
- 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.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 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