# DOCX

Use this skill whenever the user wants to create, read, edit, or manipulate Word...

- Repository: https://github.com/melandlabs/openloomi (1038 stars)
- Category: Documents
- License: Apache-2.0
- Last updated: 2026-09-24
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add melandlabs/openloomi --skill docx -g -a claude-code -y`
Codex: `npx skills add melandlabs/openloomi --skill docx -g -a codex -y`
Cursor: `npx skills add melandlabs/openloomi --skill docx -g -a cursor -y`
Gemini CLI: `npx skills add melandlabs/openloomi --skill docx -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add melandlabs/openloomi`

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

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# DOCX creation, editing, and analysis

## 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 are **auto-converted** on read and write, no manual step needed:

```bash
# Reading .doc (auto-converted to .docx internally)
python scripts/office/unpack.py legacy.doc unpacked/

# Writing .doc (auto-converted from .docx)
python scripts/office/pack.py unpacked/ output.doc
```

LibreOffice is used for the conversion, with automatic sandbox-friendly socket handling.

### Reading Content

```bash
# Text extraction with tracked changes
pandoc --track-changes=all document.docx -o output.md

# Raw XML access
python scripts/office/unpack.py document.docx unpacked/
```

### Converting to Images

```bash
python scripts/office/soffice.py --headless --convert-to pdf document.docx
pdftoppm -jpeg -r 150 document.pdf page
```

### Accepting Tracked Changes

To produce a clean document with all tracked changes accepted (requires LibreOffice):

```bash
python scripts/accept_changes.py input.docx output.docx
```

---

## Creating New Documents

Generate .docx files with JavaScript, then validate. Install: `npm install -g docx`

### Setup

The rest: https://github.com/melandlabs/openloomi/blob/HEAD/skills/docx/SKILL.md
