Packs / legal-ops-public
contract-redline-compare
Produce a redline (HTML with insertions and deletions) and a change summary between two versions of a contract
Install
logicpacks pack use legal-ops-public/contract-redline-compareget_pack legal-ops-public/contract-redline-compareThe second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.
Keys it needs (names only)
None.
Playbooks included
- Spec:
spec/SPEC.md(goal, steps, edge cases, don’ts) - Routes:
local-python - Checks: 2 in
outcome/checks.yaml - Code:
redline.py - Tools: python3
Usage, last 8 weeks
New: no recorded use yet.
Purpose (from spec/SPEC.md)
Goal
An HTML redline (deleted text struck in red, inserted text underlined in green) plus a list of changed clauses, from two plain-text versions of a document.
Verified by: Fixture versions differ in 3 clauses (3.1, 4.1, 7.x); the summary lists exactly those and the HTML contains / marks.
Steps
- Convert both versions to text (
pdftotext -layout a.pdf a.txt; for .docx usetextutil -convert txton macOS). - Run
python3 code/redline.py old.txt new.txt out/redline.html. - Read the clause summary first, then open the HTML to review each change.
Edge cases
- Re-numbered clauses show as changes in many places; compare by heading text if numbering moved.
- Formatting-only changes (bold, fonts) are invisible in text diff.
Don'ts
- Don't present the output as legal advice; a qualified lawyer reviews anything that will be signed.
- Don't send the redline to the other side without a human review.