Contract Diff for Openclaw

A sophisticated comparison tool that identifies every discrepancy between digital contract templates and scanned, signed documents.

russell-yu
v1.0.0
Apr 5, 2026
0
678
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install contract-diff

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install contract-diff using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Contract Diff?

Contract Diff is a powerful utility within the Openclaw Skills library designed to streamline the verification of legal documents. It addresses the common challenge of comparing a clean digital template (Word or PDF) against a physical, scanned, and stamped version that has been returned by a counterparty. By utilizing advanced optical character recognition and text alignment algorithms, the skill ensures that no unauthorized changes go unnoticed in the final signed version.

This tool is essential for legal teams and procurement professionals who need to maintain version control over physical documents. As part of the Openclaw Skills ecosystem, it provides a structured way to handle OCR errors and similarity matching, ensuring that even minor modifications in punctuation or wording are flagged for human review.

Contract Diff Use Cases

  • Verifying that a scanned signed contract matches the approved internal Word template.
  • Detecting hidden clause additions or deletions in stamped PDF documents.
  • Generating audit-ready reports of contract modifications for compliance and legal review.
  • Visualizing exactly where text was changed on a scanned image using color-coded highlights.

How Contract Diff Works

  1. Text is extracted from the source template using specialized libraries like python-docx for Word or PyMuPDF for digital PDFs.
  2. The scanned document is processed through an OCR engine to retrieve text content along with precise spatial coordinates (bounding boxes).
  3. A comparison engine uses sequence matching to categorize text segments into deletions (template only), additions (scanned only), or modifications (similar content).
  4. A visual highlight map is generated to show modified areas on the original scanned image.
  5. The skill produces a comprehensive report in Word format, detailing every change with similarity scores and risk levels.

Contract Diff Setup

To integrate this capability from Openclaw Skills, ensure you have the Tesseract OCR engine installed on your system.

# For Windows users
winget install tesseract-ocr.tesseract

# Install required Python libraries
pip install python-docx PyMuPDF pillow pytesseract

# Execute a comparison
python scripts/compare.py template.docx signed_contract.pdf -o report.docx

Contract Diff Data Schema & Taxonomy

The skill organizes comparison data into structured outputs to facilitate easy review. The following table describes the primary data outputs generated during the workflow:

Output Component Format Description
Comparison Report .docx A formatted Word document containing the summary, risk level, and detailed tables of changes.
Visual Highlight .png An image of the scanned contract with yellow highlights overlaid on modified text regions.
Difference Metadata JSON/Internal Structured data mapping template sentences to their scanned counterparts with similarity ratios.

Contract Diff Advanced Features

  • Intelligent similarity thresholding to distinguish between minor OCR noise and actual text modifications.
  • Risk level assessment that automatically flags documents as Low, Medium, or High risk based on the volume of changes.
  • Support for multi-page PDF processing with per-page OCR and alignment.
  • Built-in data masking to replace sensitive personal or financial information with placeholders during the report generation process.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*