# Processing Docx

> 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.

- **Type:** Skill
- **Install:** `agentstack add skill-telagod-code-abyss-processing-docx`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [telagod](https://agentstack.voostack.com/s/telagod)
- **Installs:** 0
- **Category:** [Cloud & Infrastructure](https://agentstack.voostack.com/c/cloud-infrastructure)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [telagod](https://github.com/telagod)
- **Source:** https://github.com/telagod/code-abyss/tree/main/skills/processing-docx
- **Website:** https://www.npmjs.com/package/code-abyss

## Install

```sh
agentstack add skill-telagod-code-abyss-processing-docx
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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  `
3. Run Python script using Document library.
4. `python ooxml/scripts/pack.py  `

## 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 |

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [telagod](https://github.com/telagod)
- **Source:** [telagod/code-abyss](https://github.com/telagod/code-abyss)
- **License:** MIT
- **Homepage:** https://www.npmjs.com/package/code-abyss

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-telagod-code-abyss-processing-docx
- Seller: https://agentstack.voostack.com/s/telagod
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
