Skip to content
Agentmart
Submit a tool

docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files).

Skill by SeifBenayed

IndexedMIT★ 116
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/seifbenayed-docx

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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.

Use cases: documents, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/docx

Tools it pre-approves 1

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Document,Read,Write,Edit,Glob,Grep

What's inside

Skill name
docx
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.
License
MIT
Allowed tools
Document,Read,Write,Edit,Glob,Grep
Instructions
635 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • body: 635 lines (spec recommends under 500)
  • files: referenced but missing: scripts/office/soffice.py

Files (1)

  • SKILL.md

SKILL.md (first lines)

# DOCX creation, editing, and analysis

## Tool-First Workflow

Use the `Document` tool for ALL operations. Do NOT use Python scripts unless you need features the tool doesn't have.

### Available Document tool actions

| Task | Tool call |
|------|-----------|
| Inspect metadata | `Document { action: "inspect", file_path: "doc.docx" }` |
| Read text content | `Document { action: "read_text", file_path: "doc.docx" }` |
| Extract headings | `Document { action: "extract_headings", file_path: "doc.docx" }` |
| Extract HTML | `Document { action: "extract_html", file_path: "doc.docx" }` |
| Export as plain text | `Document { action: "export_text", file_path: "doc.docx", output_path: "out.txt" }` |
| **Create new document** | `Document { action: "create", output_path: "doc.docx", content: {...} }` |
| **Unpack for XML editing** | `Document { action: "unpack", file_path: "doc.docx", output_path: "unpacked/" }` |
| **Repack after editing** | `Document { action: "pack", file_path: "unpacked/", output_path: "output.docx" }` |

### Creating a new document

```
Document { action: "create", output_path: "report.docx", content: {
  "title": "Quarterly Report",
  "sections": [
    {
      "heading": "Executive Summary",
      "paragraphs": ["Revenue grew 15% YoY.", {"text": "Key highlight", "bold": true}]
    },
    {
      "heading": "Financial Data",
      "table": [["Metric", "Q1", "Q2"], ["Revenue", "100k", "115k"], ["Costs", "80k", "85k"]]
    }
  ]
}}
```

### Editing an existing document

```
Document { action: "unpack", file_path: "template.docx", output_path: "/tmp/unpacked/" }
# → Edit XML files in /tmp/unpacked/word/document.xml with the Edit tool
Document { action: "pack", file_path: "/tmp/unpacked/", output_path: "output.docx" }
```

### When to fall back to Python/Bash
- Converting legacy .doc → .docx (requires LibreOffice)
- Accepting tracked changes (requires LibreOffice macro)
- XML validation against OOXML schemas
- Adding comments with commentsExtended/commentsIds (complex XML)

## Overview

A .docx file is a ZIP archive containing XML files.

## Quick Reference (LEGACY — prefer Document tool above)

| Task | Approach |
|------|----------|
| Read/analyze content | `Document { action: "read_text" }` |
| Create new document | `Document { action: "create" }` |
| Edit existing document | `Document { action: "unpack" }` → Edit XML → `Document { action: "pack" }` |

### Converting .doc to .docx

Legacy `.doc` files must be converted before editing (requires LibreOffice):

```bash
python scripts/office/soffice.py --headless --convert-to docx document.doc
```

### 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
```javascript
const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, ImageRun,
        Header, Footer, AlignmentType, PageOrientation, LevelFormat, ExternalHyperlink,
        InternalHyperlink, Bookmark, FootnoteReferenceRun, PositionalTab,
        PositionalTabAlignment, PositionalTabRelativeTo, PositionalTabLeader,
        TabStopType, TabStopPosition, Column, SectionType,
        TableOfContents, HeadingLevel, BorderStyle, WidthType, ShadingType,
        VerticalAlign, PageNumber, PageBreak } = require('docx');

const doc = new Document({ sections: [{ children: [/* content */] }] });
Packer.toBuffer(doc).then(buffer => fs.writeFileSync("doc.docx", buffer));
```

### Validation
After creating the file, validate it. If validation fails, unpack, fix the XML, and repack.
```bash

From SeifBenayed/cloclo, MIT.

More from SeifBenayed/cloclo

Signals

Stars
116
Forks
32
Open issues
1
Last commit (this folder)
Mar 29, 2026 (7 months ago)
Last release
Apr 4, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from SeifBenayed

Cite this page

docx skill. Agent Mart. https://agentmart.dev/skills/seifbenayed-docx (last updated 2026-10-24)