This is your go-to reference for working with Word documents programmatically. It covers the full lifecycle: converting legacy .doc files, reading content with pandoc, creating new documents from scratch using docx-js, and the unpack-edit-repack workflow for modifying existing files. The real value is in the detailed examples and gotchas. You'll find specifics on page sizes (docx-js defaults to A4, not US Letter), proper list formatting (never use unicode bullets directly), table width calculations that actually work across platforms, and why you need to set widths in two places. If you're generating reports, processing document templates, or building document workflows, this covers the practical details that usually take hours to figure out through trial and error.

skills.sh installs
143
GitHub stars
1
last updated
Jun 3, 2026

Install

$ npx -y skills add jackiexiao/jackie-skills-starter --skill docx --agent claude-code

Installs into .claude/skills of the current project.

Files

(中文)DOCX creation, editing, and analysis

Overview

A .docx file is a ZIP archive containing XML files.

Quick Reference

TaskApproach
Read/analyze contentpandoc or unpack for raw XML
Create new documentUse docx-js - see Creating New Documents below
Edit existing documentUnpack → edit XML → repack - see Editing Existing Documents below

Converting .doc to .docx

Legacy .doc files must be converted before editing:

python scripts/office/soffice.py --headless --convert-to docx document.doc

Reading Content

# Text extraction with tracked changes
pandoc --track-changes=all document.docx -o output.md

# Raw XML access
python scripts/office/unpack.py document.docx unpacked/

Converting to Images

python scripts/office/soffice.py --headless --convert-to pdf document.docx
pdftoppm -jpeg -r 150 document.pdf page

Accepting Tracked Changes

To produce a clean document with all tracked changes accepted (requires LibreOffice):

python scripts/accept_changes.py input.docx output.docx

Creating New Documents

Sponsors

Details

Repository
github.com/jackiexiao/jackie-skills-starter
Category
Office & Documents
First seen
Jun 3, 2026

More from jackiexiao/jackie-skills-starter

All 2
1absolutelyskilled avatarpresentation-designabsolutelyskilled/absolutelyskilledpresentation design135skills.sh installs
2op7418 avatarmagazine-web-pptop7418/guizang-ppt-skillmagazine web ppt132skills.sh installs
3syahiidkamil avatarpdfsyahiidkamil/software-engineer-ai-agent-atlasThis is your Swiss Army knife for PDF operations.0skills.sh installs
4thinkinaixyz avatardocxthinkinaixyz/deepchatComprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude nee0skills.sh installs
5thinkinaixyz avatarpdfthinkinaixyz/deepchatComprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to 0skills.sh installs
6mattpocock avatarobsidian-vaultmattpocock/skillsSearch, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.195.5Kskills.sh installs