Skip to content
Back to skills

Processing Docx

BSecurity

Processes Word document files (.docx). Creates, edits, annotates, tracks revisions, analyzes OOXML structure, and preserves formatting for contracts, policies, academic papers, and business documents. Use when working with .docx files or Word documents. Do NOT use for PDFs, spreadsheets, presentations, or plain text files.

  • 239 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 26, 2026
ai-agentspythongobash

Security analysis

B84/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 19 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add telagod/code-abyss --skill processing-docx --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Processing Docx?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Processing Docx
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/telagod-processing-docx/badge)](https://www.skillsdirectory.com/skills/telagod-processing-docx)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: processing-docx
description: Processes Word document files (.docx). Creates, edits, annotates, tracks revisions, analyzes OOXML structure, and preserves formatting for contracts, policies, academic papers, and business documents. Use when working with .docx files or Word documents. Do NOT use for PDFs, spreadsheets, presentations, or plain text files.
user-invocable: false
allowed-tools: Bash, Read, Write, Edit, Glob
argument-hint: <file.docx | task>
---

# DOCX Processing

`.docx` is a ZIP archive of XML and resources. Different tasks have different tools and workflows.

## Workflow Decision

| Intent | Workflow | Reference |
|--------|----------|-----------|
| **Read/analyze text only** | pandoc → markdown | [raw-xml-access.md](references/raw-xml-access.md) |
| **Read structure, comments, media, formatting** | unpack → raw XML | [raw-xml-access.md](references/raw-xml-access.md) |
| **Create new document** | docx-js (JS/TS) | [docx-js.md](docx-js.md) |
| **Edit own document, simple changes** | Document library (Python) | [ooxml.md](ooxml.md) |
| **Edit someone else's document** | Redlining (tracked changes) | [redlining.md](references/redlining.md) |
| **Legal / academic / business / gov docs** | Redlining — REQUIRED | [redlining.md](references/redlining.md) |
| **Visual analysis** | soffice → PDF → pdftoppm | [raw-xml-access.md](references/raw-xml-access.md) |

## Text Extraction (Quick)

```bash
pandoc --track-changes=all path-to-file.docx -o output.md
# --track-changes=accept/reject/all
```

## Create New Document

1. **MANDATORY — READ ENTIRE FILE**: `docx-js.md` (~500 lines). NEVER set range limits.
2. Create JS/TS file using Document, Paragraph, TextRun components.
3. Export with `Packer.toBuffer()`.

## Edit Existing Document (Own, Simple)

1. **MANDATORY — READ ENTIRE FILE**: `ooxml.md` (~600 lines). NEVER set range limits.
2. `python ooxml/scripts/unpack.py <office_file> <output_dir>`
3. Run Python script using Document library.
4. `python ooxml/scripts/pack.py <input_dir> <office_file>`

## Edit Someone Else's Document → Redlining

See [redlining.md](references/redlining.md) for full 6-step workflow with batching strategy and RSID preservation.

## Code Style

- Write concise code, no verbose variable names, no unnecessary print statements.

## Dependencies

| Package | Install | Purpose |
|---------|---------|---------|
| pandoc | `apt install pandoc` | Text extraction |
| docx | `npm i -g docx` | Create new docs |
| LibreOffice | `apt install libreoffice` | PDF conversion |
| Poppler | `apt install poppler-utils` | `pdftoppm` for images |
| defusedxml | `pip install defusedxml` | Secure XML parsing |

Files in this skill

  • SKILL.md2.6 KB
  • docx-js.md16.1 KB
  • ooxml.md22.8 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd73.2 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd6.8 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd50.1 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd624 B
  • ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd1.2 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd8.7 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd14.4 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd81.7 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd1.2 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd7.2 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd6.2 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd1.2 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd880 B
  • ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd2.5 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd3.4 KB
  • ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd7.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…