This handles creating, reading, and editing Word documents through Claude. It's built around the docx-js library for generation and pandoc for reading, with solid coverage of the annoying parts: tracked changes, proper table formatting with dual width specs, page size defaults (watch out, docx-js defaults to A4 not Letter), and list numbering that actually works instead of unicode bullet hacks. The documentation is thorough on validation workflows and includes a Python helper for accepting all tracked changes via LibreOffice. Use this when you need programmatic Word document manipulation, not just text file generation. The XML unpacking approach for edits is old school but reliable.

skills.sh installs
524
GitHub stars
33.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add davila7/claude-code-templates --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/davila7/claude-code-templates
Categories
Documentation, Office & Documents
First seen
Jun 3, 2026

More from davila7/claude-code-templates

All 618
1revenuecat avatarrevenuecatrevenuecat/revenuecat-skillRevenueCat metrics, customer data, and documentation search. Use when querying subscription analytics, MRR, churn, customers, or RevenueCat docs.524skills.sh installs
2rstackjs avatarrspress-description-generatorrstackjs/agent-skillsGenerate and maintain description frontmatter for Rspress documentation files (.md/.mdx). Use when a user wants to add SEO descriptions, improve search engine s515skills.sh installs
3brianrwagner avatarvoice-extractorbrianrwagner/ai-marketing-claude-code-skillsExtract and document someone's authentic writing voice from samples. Use when someone needs a "voice guide," wants to capture their writing DNA, or needs to tra495skills.sh installs
4ncklrs avatarvsl-storyboard-writerncklrs/startup-os-skillsExpert VSL (Video Sales Letter) and product marketing video storyboard writer. Use when creating sales videos, product demos, explainer videos, social media vid489skills.sh installs
5atlassian avatarsearch-company-knowledgeatlassian/atlassian-mcp-serverSearch across company knowledge bases (Confluence, Jira, internal docs) to find and explain internal concepts, processes, and technical details. When an agent n488skills.sh installs
6mblode avatarcopywritingmblode/agent-skillsWrites and edits short product and marketing copy, including landing pages, CTAs, onboarding strings, product descriptions, email subjects, UI state copy, brand483skills.sh installs