contract-cleaner

Normalize Chinese contract terms, numbering, and structure into standardized Markdown.

4|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/MarvinLann/contract-cleaner --skill contract-cleaner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: contract-cleaner
Source: https://github.com/MarvinLann/contract-cleaner/tree/main
Command: npx skills add https://github.com/MarvinLann/contract-cleaner --skill contract-cleaner

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, lxml, pypandoc, python-docx, pdf2image, pytesseract, Pillow, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Contract Cleaner is a Chinese contract text cleaning and formatting tool that converts messy Word/PDF/Markdown contracts into clean, standardized Markdown that conforms to legal language conventions.

Core Features & Use Cases

  • Multi-format input support: Word (.docx/.doc), PDF (OCR), Markdown, and plain text.
  • Deterministic rule engine + AI cleaning: term normalization, amount formatting, numbering normalization, structure normalization, and final polish.
  • End-to-end deliverables: cleaned Markdown, comparison baselines, and optional Word deliverables for review.
  • Use Case: Legal teams consolidating thousands of contracts to ensure consistent terminology and formatting across an archive.

Quick Start

Start by supplying a contract file to Contract Cleaner and obtain a cleaned Markdown version (with optional Word export) in the output directory.

Frequently Asked Questions about contract-cleaner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean and standardize messy Chinese contract text into Markdown?

To clean Chinese contract text, Contract Cleaner applies deterministic preprocessing rules and AI-powered cleaning to standardize terminology, numbering, and formatting. It converts messy Word, PDF, and Markdown inputs into a clean, standardized Markdown output.

Can I extract and clean contract terms from scanned PDF documents using OCR?

Yes, contract cleaning supports PDF inputs through OCR. The tool utilizes OCR dependencies to extract text from scanned PDF contracts, which is then processed through the deterministic rule engine and multi-pass AI cleaning to deliver standardized Markdown.

What is the best way to normalize numbering and legal terminology across a large contract archive?

Normalizing legal terminology and numbering across contracts requires a deterministic rule engine combined with AI cleaning. Contract Cleaner applies term normalization, amount formatting, and numbering normalization to deliver consistently structured Markdown documents for legal archives.

Does contract cleaning support Word document inputs or only plain text and Markdown?

Contract cleaning supports multiple input formats including Word documents (.docx and .doc), PDF, Markdown, and plain text. The process extracts the content, applies standardization rules, and can optionally export a final cleaned .docx file for legal review.

How does the AI cleaning process verify the consistency of standardized contract documents?

The AI cleaning process ensures consistency through multi-pass cleaning and final verification. After deterministic preprocessing normalizes terms and structure, the AI performs multiple cleaning passes and a final verification step to deliver standardized Markdown outputs.

Are there limitations when processing long Chinese contracts with complex formatting?

Processing long Chinese contracts involves chunking to handle complex formatting and length. The tool targets legal workflows requiring consistent terminology across long documents, but users should review the final Markdown and optional Word deliverables to verify structural accuracy.