DOCX Document Processing
Paste the following prompt into your AI chat to install this skill:
Please install @user_9a74e0f8/docx-fromcpdex by following https://skillhub.cn/install/skillhub.md.
About this skill
Problem
Many .docx tasks go beyond plain text: creating formatted Word files, editing someone else’s document, preserving tracked changes, extracting comments/media/metadata, and visually checking pages all require separate XML, Pandoc, PDF, and OOXML handling. A common difficulty is that .docx files are ZIP archives of XML, so naive text replacement can corrupt runs, paragraphs, comments, revisions, and styles.
How it works
The skill routes each job and emphasizes reading the full reference docs before choosing a toolchain:
- Read and analyze: convert with
pandocto Markdown; for comments, media, and metadata, unpack and inspectword/document.xml,word/comments.xml, andword/media/. - Create documents: use
docx-jscomponents such asDocument,Paragraph, andTextRun, then export viaPacker.toBuffer(). - Edit documents: unpack OOXML, modify the DOM with the Python Document library, then repack into
.docx. - Redlining review: convert to Markdown with tracked changes, group 3-10 edits, locate XML nodes precisely, mark only changed text, preserve unchanged run
RSID, pack, and verify. - Visual checks: convert DOCX to PDF with LibreOffice, then render pages to
page-*.jpgwithpdftoppm.
Boundaries
Best for engineers who need precise Word XML control, not just simple text replacement. Markdown is enough for plain-text extraction, but legal documents with comments, revisions, and styles must be checked at the OOXML level. For third-party, legal, academic, business, or government documents, the material mandates a redlining workflow; generated code should stay concise, avoiding redundant variables and prints.
Use Cases
- Legal review: apply 3-10 contract edits as OOXML tracked changes while preserving unchanged RSIDs.
- Product docs: generate a Word file from TypeScript using docx-js paragraphs and TextRun components.
- Pre-release layout QA: convert DOCX to PDF with LibreOffice and render pages to JPEG for review.
- Tender analysis: extract text with Pandoc, then unpack comments.xml and media for structure review.
Best For
- Legal engineers who turn regulatory clause edits into OOXML tracked changes.
- Engineers generating structured Word deliverables from TypeScript via docx-js.
- Documentation engineers inspecting comments, media, and metadata with page renders.
- Automation engineers maintaining .docx XML workflows for document review.
Related Skills
Turns files, references, or chat context into styled single-page HTML reports with built-in templates and preset themes.
An engineering-oriented email automation solution for batch sending, Jinja2 templates, attachments, scheduled sending, inbox monitoring, and rule-based auto-reply.
Pre-submission scanner for Word/PDF blind-bid files that checks margins, fonts, page numbers, and metadata against tender requirements and flags residual bidder identities.
Convert Word, plain text, or existing LaTeX drafts into submission-oriented LaTeX structure while preserving scientific content and flagging missing template or compile assets.