# DOCX

> Use when the user wants to create, edit, or format Word documents (.docx files).

- Skill: `anujkumar8076/docx` (Agent Skill)
- Install (CLI): `npx skillmds@latest add anujkumar8076/docx`
- Raw SKILL.md: https://api.skillmd.com/api/skills/anujkumar8076/docx/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: anujkumar8076 (https://skillmd.com/u/anujkumar8076)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/anujkumar8076/docx

---

# Word Document Skill

Create and edit .docx files programmatically.

## Setup

Install the python-docx library before starting:

```bash
pip install python-docx
```

## Creating a document

Use python-docx to build the document. Add headings, paragraphs, and tables
through the Document API, then save to disk.

```python
from docx import Document
doc = Document()
doc.add_heading("Title", level=1)
doc.add_paragraph("Body text goes here.")
doc.save("output.docx")
```

## Editing an existing document

Open the file with `Document(path)`, iterate `doc.paragraphs`, modify runs in
place, and save under a new name so the original is preserved.

## Output format

Always save the result as a .docx file and tell the user the absolute path.

