lightest-docx

Repair and edit .docx files via OpenXML while preserving formatting and revisions.

4|Updated Jun 4, 2026
One-click install
npx skills add https://github.com/lijiandao/lightest-skills --skill lightest-docx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lightest-docx
Source: https://github.com/lijiandao/lightest-skills/tree/main/skills/lightest-docx
Command: npx skills add https://github.com/lijiandao/lightest-skills --skill lightest-docx

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires lxml, matplotlib, numpy, playwright, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

It solves the hard part of working with Word documents safely: preserving layout, revisions, comments, headers, footers, and template structure while making real edits.

Core Features & Use Cases

  • Offline .docx creation and repair: Build new Word files with OpenXML, add covers, TOCs, charts, and validated page layout.
  • Template-preserving editing: Replace placeholders and modify existing documents by unzipping and editing the underlying XML instead of rebuilding the file.
  • Advanced review workflows: Add comments, replies, insertions, deletions, and track changes for collaborative editing and proofreading.
  • Use case: A research or business team can turn a draft report into a polished submission-ready document without breaking formatting or losing revision history.

Quick Start

Ask the skill to create or revise the attached .docx file while preserving formatting and validating the result.

Frequently Asked Questions about lightest-docx

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

FAQPage Schema
How do I edit a Word document without breaking the original formatting?

To edit Word docs without breaking formatting, you need template-preserving editing that modifies the underlying XML structure directly instead of rebuilding the file. This approach repairs and preserves layout, headers, footers, and template structure while making real edits to the document.

How does OOXML document repair work for corrupted docx files?

OOXML document repair works through unzip-based XML parsing and OpenXML validation to fix Word docx files. It targets the underlying XML structure to restore damaged page layouts, recover revisions and comments, and ensure deterministic script workflows verify the repaired file.

Can I programmatically add track changes and comments to a docx file?

Yes, you can add track changes and comments to a docx file for collaborative editing and proofreading. Advanced review workflows support inserting comments, replies, insertions, and deletions while preserving the existing revision history and document structure.

Does this docx editing approach support template filling and chart insertion?

Yes, offline docx creation supports template filling and chart insertion by building new Word files with OpenXML. You can add covers, tables of contents, charts, and validated page layouts to generate complete reports, papers, and business documents.

What dependencies do I need for offline Word document generation?

Offline Word document generation requires Python dependencies including lxml for XML parsing, matplotlib and numpy for chart generation, and playwright for rendering. These libraries enable deterministic script workflows for creating, editing, and verifying docx files.

Why does my docx file lose revisions when I edit it programmatically?

Your docx file loses revisions because standard editing approaches rebuild the file instead of preserving the XML structure. Template-preserving editing via unzip-based XML parsing maintains revision history, comments, and formatting by modifying the OpenXML directly.