<!-- AUTO-GENERATED-RESOURCE-MAP:START -->
Resource Map
基准路径:
.claude/skills/documentation-specialist/references/domains/document-formats/docx/
docx/
├── ooxml/
│ ├── schemas/
│ │ ├── ecma/
│ │ │ └── fouth-edition/
│ │ │ ├── opc-contentTypes.xsd
│ │ │ ├── opc-coreProperties.xsd
│ │ │ ├── opc-digSig.xsd
│ │ │ └── opc-relationships.xsd
│ │ ├── ISO-IEC29500-4_2016/
│ │ │ ├── dml-chart.xsd
│ │ │ ├── dml-chartDrawing.xsd
│ │ │ ├── dml-diagram.xsd
│ │ │ ├── dml-lockedCanvas.xsd
│ │ │ ├── dml-main.xsd
│ │ │ ├── dml-picture.xsd
│ │ │ ├── dml-spreadsheetDrawing.xsd
│ │ │ ├── dml-wordprocessingDrawing.xsd
│ │ │ ├── pml.xsd
│ │ │ ├── shared-additionalCharacteristics.xsd
│ │ │ ├── shared-bibliography.xsd
│ │ │ ├── shared-commonSimpleTypes.xsd
│ │ │ ├── shared-customXmlDataProperties.xsd
│ │ │ ├── shared-customXmlSchemaProperties.xsd
│ │ │ ├── shared-documentPropertiesCustom.xsd
│ │ │ ├── shared-documentPropertiesExtended.xsd
│ │ │ ├── shared-documentPropertiesVariantTypes.xsd
│ │ │ ├── shared-math.xsd
│ │ │ ├── shared-relationshipReference.xsd
│ │ │ ├── sml.xsd
│ │ │ ├── vml-main.xsd
│ │ │ ├── vml-officeDrawing.xsd
│ │ │ ├── vml-presentationDrawing.xsd
│ │ │ ├── vml-spreadsheetDrawing.xsd
│ │ │ ├── vml-wordprocessingDrawing.xsd
│ │ │ ├── wml.xsd
│ │ │ └── xml.xsd
│ │ ├── mce/
│ │ │ └── mc.xsd
│ │ └── microsoft/
│ │ ├── wml-2010.xsd
│ │ ├── wml-2012.xsd
│ │ ├── wml-2018.xsd
│ │ ├── wml-cex-2018.xsd
│ │ ├── wml-cid-2016.xsd
│ │ ├── wml-sdtdatahash-2020.xsd
│ │ └── wml-symex-2015.xsd
│ └── scripts/
│ ├── validation/
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── docx.py
│ │ ├── pptx.py
│ │ └── redlining.py
│ ├── pack.py
│ ├── unpack.py
│ └── validate.py
├── scripts/
│ ├── templates/
│ │ ├── comments.xml
│ │ ├── commentsExtended.xml
│ │ ├── commentsExtensible.xml
│ │ ├── commentsIds.xml
│ │ └── people.xml
│ ├── __init__.py
│ ├── document.py
│ └── utilities.py
├── docx-js.md
├── LICENSE.txt
├── ooxml.md
└── SKILL.md
<!-- AUTO-GENERATED-RESOURCE-MAP:END -->
DOCX creation, editing, and analysis
Overview
A user may ask you to create, edit, or analyze the contents of a .docx file. A .docx file is essentially a ZIP archive containing XML files and other resources that you can read or edit. You have different tools and workflows available for different tasks.
Workflow Decision Tree
Reading/Analyzing Content
Use "Text extraction" or "Raw XML access" sections below
Creating New Document
Use "Creating a new Word document" workflow
Editing Existing Document
- Your own document + simple changes
Use "Basic OOXML editing" workflow
- Someone else's document
Use "Redlining workflow" (recommended default)
- Legal, academic, business, or government docs
Use "Redlining workflow" (required)
Reading and analyzing content
Text extraction
If you just need to read the text contents of a document, you should convert the document to markdown using pandoc. Pandoc provides excellent support for preserving document structure and can show tracked changes:
# Convert document to markdown with tracked changes
pandoc --track-changes=all path-to-file.docx -o output.md
# Options: --track-changes=accept/reject/all
Raw XML access
You need raw XML access for: comments, complex formatting, document structure, embedded media, and metadata. For any of these features, you'll need to unpack a document and read its raw XML contents.
Unpacking a file
python ooxml/scripts/unpack.py <office_file> <output_directory>
Key file structures
word/document.xml- Main document contentsword/comments.xml- Comments referenced in document.xmlword/media/- Embedded images and media files- Tracked changes use
<w:ins>(insertions) and<w:del>(deletions) tags
Creating a new Word document
When creating a new Word document from scratch, use docx-js, which allows you to create Word documents using JavaScript/TypeScript.