
Docx
This handles the full lifecycle of Word documents: creating new .docx files from scratch with docx-js, reading and extracting content with pandoc, and editing existing documents by unpacking the underlying XML. It covers the tricky parts like setting US Letter page size (docx-js defaults to A4), dual-width table configurations that actually render correctly across platforms, and proper list formatting without unicode hacks. You can accept tracked changes, convert legacy .doc files, and even render documents as images. The documentation is unusually detailed about gotchas like Google Docs breaking percentage-based table widths and the need to use ShadingType.CLEAR instead of SOLID. Use this when you need reliable Word document generation with real formatting control, not just text dumps.
- GitHub stars
- 460
- last updated
- Jun 7, 2026
Install
$ npx -y skills add malob/nix-config --skill docx --agent claude-codeInstalls into .claude/skills of the current project.
Files
DOCX creation, editing, and analysis
A .docx is a ZIP archive of XML files. Choose your approach by task:
| Task | Approach |
|---|---|
| Create a new document | Write a docx (npm) script — see gotchas below |
| Edit an existing document | unzip → edit word/document.xml → zip (docx-js cannot open existing files) |
| Read content | pandoc -t markdown file.docx |
Script paths below are relative to this skill's directory.
Creating with docx-js — gotchas
docx is preinstalled — do not run npm install first; write the script and require('docx') directly. Only if that require fails: npm install docx. The model knows the API; these are the footguns:
Sponsors
Details
- Repository
- github.com/malob/nix-config
- Category
- Office & Documents
- License
- MIT
- First seen
- Jun 11, 2026