Skip to content
Skill

docx

by anthropics

AI Summary

The docx skill enables AI assistants to create, read, edit, and manipulate Word documents with professional formatting, tables of contents, images, and tracked changes. It's useful for developers and users who need to programmatically generate or process .docx files as part of their workflows.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to install the "docx" skill in my project.

Please run this command in my terminal:
# Install skill into your project (5 files)
mkdir -p .claude/skills/docx && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/docx/SKILL.md "https://raw.githubusercontent.com/anthropics/skills/main/skills/docx/SKILL.md" && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/docx/LICENSE.txt "https://raw.githubusercontent.com/anthropics/skills/main/skills/docx/LICENSE.txt" && mkdir -p .claude/skills/docx/scripts && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/docx/scripts/__init__.py "https://raw.githubusercontent.com/anthropics/skills/main/skills/docx/scripts/__init__.py" && mkdir -p .claude/skills/docx/scripts && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/docx/scripts/accept_changes.py "https://raw.githubusercontent.com/anthropics/skills/main/skills/docx/scripts/accept_changes.py" && mkdir -p .claude/skills/docx/scripts && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/docx/scripts/comment.py "https://raw.githubusercontent.com/anthropics/skills/main/skills/docx/scripts/comment.py"

Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.

Description

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.

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: `bash python scripts/office/soffice.py --headless --convert-to docx document.doc `

Text extraction with tracked changes

pandoc --track-changes=all document.docx -o output.md

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted Today
Active
Adoption1K+ stars on GitHub
117.3k ★ · Popular
DocsREADME + description
Well-documented

GitHub Signals

Stars117.3k
Forks13.5k
Issues693
UpdatedToday
View on GitHub
No License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code