DOCX creation, editing, and analysis

Creates, edits, and validates DOCX files via OOXML XML manipulation.

42|6|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/BoHeFan/academic-paper-writer-pro-2 --skill docx-creation-editing-and-analysis-bohefan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: DOCX creation, editing, and analysis
Source: https://github.com/BoHeFan/academic-paper-writer-pro-2/tree/main/docx
Command: npx skills add https://github.com/BoHeFan/academic-paper-writer-pro-2 --skill docx-creation-editing-and-analysis-bohefan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandoc, libreoffice, poppler, npm, docx-js, docx, and includes scripts (resource) components.

What problem does it solve?

This Skill solves the problem of unreliable DOCX editing by providing a repeatable workflow to unpack, modify, validate, and repack Word documents at the XML level—so generated or edited documents remain structurally correct and render properly.

Core Features & Use Cases

  • DOCX unpack → inspect → edit: Extracts DOCX ZIP contents into editable XML, with XML pretty-printing and smart-quote entity safety.
  • Safe DOCX packing + validation: Rebuilds DOCX from the unpacked directory with optional XSD-style validation and auto-repair of common OOXML issues.
  • Tracked changes & comments support: Provides guidance for inserting/accepting tracked changes and adding Word comments via the document XML relationship/content-type wiring.
  • Quality guardrails for generated documents: Enforces docx-js constraints (page size, table widths, bullet/numbering rules, page breaks, TOC headings) to reduce broken DOCX outputs.
  • Formula + image embedding support (Word-native): Includes instructions for converting LaTeX to OMML and wiring images via relationships and content types.

Quick Start

Use the docx Skill to unpack the attached file 'manuscript.docx' into an editable directory for safe XML-level modifications.

Frequently Asked Questions about DOCX creation, editing, and analysis

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

FAQPage Schema
How do I edit DOCX files at the XML level without breaking the document structure?

To edit DOCX files at the XML level safely, you unpack the DOCX into OOXML XML parts, apply XML-safe edits with whitespace preservation, and repack the archive with optional schema validation. This ensures modified documents remain structurally correct and render properly in Word.

Can I insert tracked changes and comments into a DOCX by modifying the OOXML directly?

Yes, you can insert tracked changes and comments into a DOCX by modifying the OOXML directly. The process involves wiring the document XML relationships and content-types correctly to ensure Word recognizes and displays the revisions and annotations natively.

What is the best way to generate publication-ready DOCX files with docx-js without formatting errors?

The best way to generate publication-ready DOCX files with docx-js is to enforce strict quality guardrails during generation. This involves setting constraints for page size, table widths, bullet/numbering rules, and page breaks to prevent broken outputs and ensure deterministic formatting.

How do I embed LaTeX formulas and images into a Word document natively?

To embed LaTeX formulas and images natively, you convert LaTeX to OMML format and wire images via OOXML relationships and content types. This ensures both mathematical formulas and graphics are properly integrated and rendered directly within the Word document.

Does this DOCX validation workflow require installing LibreOffice or pandoc?

Yes, this DOCX validation workflow requires installing LibreOffice and pandoc. These dependencies are used as helper utilities alongside poppler and npm packages like docx-js to support document unpacking, repacking, and format conversion processes.

Why do my generated OOXML artifacts render incorrectly in Word, and how can I fix them?

Generated OOXML artifacts render incorrectly due to malformed XML or missing content-type wiring. You can fix broken artifacts by unpacking the DOCX, applying auto-repair for common OOXML issues, enforcing whitespace preservation, and validating the structure before repacking.