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-codeInstalls 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
| Task | Approach |
|---|---|
| Read/analyze content | pandoc or unpack for raw XML |
| Create new document | Use docx-js - see Creating New Documents below |
| Edit existing document | Unpack → 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
