
I built an open-source Word redlining engine
Hi all,
I started this because I couldn’t find a library with wide support for programmatically editing existing DOCX files while preserving native Word tracked changes.
I was also skeptical of agents editing the underlying OOXML directly, so I thought there was an opportunity to build something better there. I was partly wrong there, Claude is surprisingly capable at chopping up Word XML and putting it back together.
But I still wanted an actual engine for the cases where you need this to be programmatic, repeatable, and bounded rather than relying on the model to manipulate XML correctly every time.
That became stemma. You give it an existing DOCX and explicit changes (such as replace text, change formatting, edit tables/content controls, etc.), and it produces a new DOCX with those edits represented as native Microsoft Word tracked changes.
I figured I’d share it here. If you’re building legal AI, contract automation, CLM, templating, or anything else that needs to hand users a real Word redline, it might save you from having to build the OOXML layer yourself.