doc — Claude Code skill: edit .docx and check the layout
A skill for reading, creating and editing .docx files when layout matters — tables, page breaks, fonts. Useful when the document goes to a client.
npx claude-code-templates@latest --skill document-processing/docWhat doc does
The skill handles .docx work through python-docx: headings, styles, tables, lists. Edits stay structured instead of hand-patching XML.
Visual review is the point. With soffice and pdftoppm available, the document goes DOCX to PDF to PNG. The other route is the bundled scripts/render_docx.py, which needs pdf2image and Poppler. Every meaningful change gets re-rendered and the pages inspected. If neither tool is there, the skill extracts text with python-docx and flags the layout risk instead of pretending it checked.
Intermediate files live in tmp/docs/, final artifacts in output/doc/. No environment variables are required. Python packages install with uv pip install python-docx pdf2image; system tools with brew install libreoffice poppler on macOS or sudo apt-get install -y libreoffice poppler-utils on Ubuntu/Debian. When installation is not possible in the current environment, the skill names the missing dependency and how to get it locally.
What it helps with
- read a
.docxwith tables and see how it is laid out - build a document with headings and styles via
python-docx - render pages and catch overlapping text
- check pagination before sending a file to a client
- extract text when rendering is unavailable
Example prompts for the agent
- read
report.docxand tell me if the table breaks on page two - add a second-level heading section to
contract.docxand re-render the pages - render
output/doc/final.docxto PNG and check the margins
How to install doc
1claude-code-templates
npx claude-code-templates@latest --skill document-processing/doc2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill doc -a claude-code3Manually: put the files in place
~/.claude/skills/doc/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/doc/
Manually: put the files in place
.agents/skills/doc/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/doc/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates doc2Manually: put the files in place
.github/skills/doc/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/document-processing/docManually: put the files in place
.devin/skills/doc/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about doc
How do I install doc in Claude?
Through the templates: npx claude-code-templates@latest --skill document-processing/doc. Or with the skills manager: npx skills add davila7/claude-code-templates --skill doc -a claude-code.
What does the doc skill do?
It reads and edits .docx files with python-docx, then renders the pages after changes to check the layout. When rendering is not possible, it extracts the text and warns about layout risk.
What is needed to render pages?
Either soffice and pdftoppm, or scripts/render_docx.py with pdf2image and Poppler. Without them the visual check does not happen.