Applies wording changes to a Word contract as tracked changes by a named reviewer, with comments and a redline PDF.
Say it in your own words; the assistant finds this recipe by itself. Examples:
Redline a Word contract or any .docx in ONE command: apply a list of wording changes as tracked changes by a named reviewer (Legal, Procurement, your name), attach review comments to the clauses they concern, insert new clauses after a given heading, and hand back the edited .docx plus a redline PDF where every change and comment is visible, plus a short change summary. Also: add comments only, accept or reject all tracked changes, or report who changed what in a document. Use for: redline this contract, make these changes with track changes on, mark up the agreement for the other side, comment on clauses, accept all changes before signing, ændringer med korrekturspor. Triggers: redline, tracked changes, track changes, markup, comments on a contract, revise the agreement, accept all changes, reject changes, korrektur, ændringsforslag, kontrakt.
python3 /skills/contract-redline/scripts/redline.py <verb> … wraps wordcraft-cli, a native
engine that reads and writes real .docx without Word. Edits land as tracked changes by the
author you name; comments sit on the text they concern. Inputs are in /work/in, results in
/work/out. Every verb prints one OK … line or one ERROR … line.
| Need | Command |
|---|---|
| Apply changes as tracked changes, with redline PDF and summary | redline.py apply /work/in/contract.docx /work/out/contract-redline.docx --changes /work/changes.json --author "Legal review" --pdf /work/out/contract-redline.pdf --summary /work/out/changes.md |
| Comments only, nothing else changed | redline.py comments /work/in/contract.docx /work/out/contract-commented.docx --comments /work/comments.json --author "Anna Berg" --pdf /work/out/contract-commented.pdf |
| Accept every tracked change (clean copy) | redline.py accept /work/in/contract.docx /work/out/contract-clean.docx |
| Reject every tracked change | redline.py reject /work/in/contract.docx /work/out/contract-original.docx |
| Who changed what | redline.py changes /work/in/contract.docx |
A list; each item is one of three shapes. Text must match the document exactly (copy it from
wordcraft-cli text /work/in/contract.docx). find replaces every occurrence.
[
{"find": "30 days' written notice", "replace": "45 days' written notice"},
{"find": "the fees paid in the 6 months before the claim", "replace": "the fees paid in the 12 months before the claim", "comment": "Aligned with our standard cap."},
{"after": "4. Confidentiality", "insert": "4.1 The Client may share confidential information with its auditors under equivalent confidentiality terms.", "comment": "New clause requested by the Client."},
{"comment_on": "8 % per annum", "comment": "Finance: please confirm the interest rate."},
{"find": "Copenhagen City Court", "replace": ""}
]
after puts a new paragraph after the paragraph that follows the matched heading (that is,
after the clause's body text). An empty replace deletes the text (tracked). comments.json
is a list of {"on": "exact text", "comment": "…"}.
After apply, the --pdf is rendered with the markup (deletions struck through, insertions
underlined, comments in the margin): give the person the docx, the PDF and the summary links.
SKILL.mdgate.jsonscripts/__pycache__/redline.cpython-311.pycscripts/__pycache__/redline.cpython-313.pycscripts/redline.pyWritten by Percerno, MIT licence.