docx

docx is a skill for Claude Code, Codex from HKUDS/DeepTutor. It costs 91 tokens per session (2,856 once invoked), scanned A, original, Apache-2.0.

A tool for reading, creating, and editing Microsoft Word .docx files, including their text, tables, images, headings, page numbers, and tracked changes.

In plain words
What is it for?
Use it to extract or summarise documents, create reports and letters, edit content, find and replace text, and add tracked changes or comments.
Why use it?
It handles common Word-document work without requiring manual XML editing, while supporting lower-level editing when exact document changes are needed.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to extract or summarise documents, create reports and letters, edit content, find and replace text, and add tracked changes or comments.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hkuds/deeptutor/docx
About the project

DeepTutor is a personalized tutoring system that uses AI agents and learning resources to support ongoing, interactive study. Learners use it for activities such as reading, research, guided courses, and building mastery paths. The catalogue entries provide skills and instructions for working with DeepTutor.

HKUDS/DeepTutor · 41,639 stars · on GitHub · arxiv.org

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add HKUDS/DeepTutor --skill docx
Clone the repo
git clone --depth 1 https://github.com/HKUDS/DeepTutor

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docx

README.md
[![agentmods](https://agentmods.dev/badge/skills/hkuds/deeptutor/docx/github.svg)](https://agentmods.dev/skills/hkuds/deeptutor/docx)
Your own site
<a href="https://agentmods.dev/skills/hkuds/deeptutor/docx"><img src="https://agentmods.dev/badge/skills/hkuds/deeptutor/docx/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for docx

Your own site · 80×15
<a href="https://agentmods.dev/skills/hkuds/deeptutor/docx"><img src="https://agentmods.dev/badge/skills/hkuds/deeptutor/docx.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,856 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Snyk pass 7 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00091 $0.02856
Opus 5.5 $0.00036 $0.01142
Sonnet 5.5 $0.00018 $0.00571
Haiku 4.5 $0.00009 $0.00286

Measured 1mo ago against content hash 66afa8c19a53, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

docx scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

# If present, invoke it with subprocess.run([...], check=True) here, using only
deeptutor/skills/builtin/docx/SKILL.md · 235 lines

How it starts

The opening of the file, as written. The whole thing — 235 lines — stays where its author put it; the contents beside it link to each section on GitHub.

DOCX (Microsoft Word)

A .docx is a ZIP of XML parts. Body text lives in word/document.xml. Two tiers:

  • Default — python-docx (preinstalled): create, read, and simple edits. Use for almost everything.
  • Advanced — raw OOXML via zipfile: only for what python-docx cannot express — tracked changes (redlines), comments, and exact-fidelity edits that must preserve every untouched byte. See Raw OOXML.

Runtime

Use exec with complete Python source (language: python). python-docx is preinstalled. Prefer creating, saving, reopening, and validating the deliverable in one call; later calls can revise the same relative filename. Follow the turn's User workspace instructions for locating inputs, output boundaries, and presenting the finished file. When editing, write a new output unless the user explicitly requested an authorized replacement.

Read / extract

from docx import Document

doc = Document("in.docx")
text = "\n".join(p.text for p in doc.paragraphs)  # body paragraphs
for tbl in doc.tables:  # tables
    for row in tbl.rows:
        print([c.text for c in row.cells])

doc.paragraphs skips text inside tables, headers/footers, and text boxes — iterate doc.tables and doc.sections[i].header/.footer for those. Each paragraph's style: p.style.name (e.g. "Heading 1").

To read tracked changes, parse the XML directly — python-docx ignores <w:ins>/<w:del>:

import zipfile, re

xml = zipfile.ZipFile("in.docx").read("word/document.xml").decode("utf-8")
# inserted text = <w:ins>…<w:t>…  deleted = <w:del>…<w:delText>…
print(re.findall(r"<w:t[^>]*>(.*?)</w:t>", xml))

Create

from docx import Document
from docx.shared import Pt, Inches, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH

doc = Document()  # default template page size
doc.add_heading("Quarterly Report", level=0)  # 0 = title; 1..9 = H1..H9
p = doc.add_paragraph("Intro paragraph. ")
run = p.add_run("Bold tail.")
run.bold = True
doc.add_paragraph("First item", style="List Bullet")  # real list style, never a "• " literal
doc.add_paragraph("Step one", style="List Number")

# Table — header row + data
tbl = doc.add_table(rows=1, cols=2)
tbl.style = "Light Grid Accent 1"
tbl.rows[0].cells[0].text, tbl.rows[0].cells[1].text = "Metric", "Value"
for k, v in [("Revenue", "1.2M"), ("Growth", "15%")]:
    c = tbl.add_row().cells
    c[0].text, c[1].text = k, v

doc.add_picture("chart.png", width=Inches(5))  # image, scaled to width
doc.add_page_break()
doc.save("out.docx")

# Validate immediately; later exec calls can also reopen this relative path.
check = Document("out.docx")
assert check.paragraphs, "generated DOCX has no paragraphs"
import zipfile

with zipfile.ZipFile("out.docx") as package:
    assert package.testzip() is None, "generated DOCX has a corrupt ZIP member"

Read the full file on GitHub · 235 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +1 lines 66afa8c19a53
  2. 1mo ago Changed · +27 lines bc2e2b313625
  3. 1mo ago First seen · 207 lines · 91 tokens per session scan A 0e71d9f8658f

Subscribe to this mod's changes

docx is a skill published in the GitHub repository HKUDS/DeepTutor (41,639 stars, last pushed today), licensed Apache-2.0. It adds 91 tokens to every session and 2,856 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

markitdown

Converts heterogeneous documents and selected URIs to Markdown with Microsoft MarkItDown for text analysis, search, and LLM/RAG ingestion. Covers safe local conversion, streams, Office/PDF/data formats, batch workflows, plugins, vision OCR, Azure extraction, and the official MCP server.

K-Dense-AI/scientific-agent-skills · 62 tokens

ppt-master

AI-driven presentation workflow for generating editable PPTX decks and slides, reconstructing page visuals, creating reusable Brand/Style/Layout/Deck workspaces, filling native PPTX templates, and enhancing finished PPTX files. Use when the user asks to create, generate, reconstruct, regenerate, beautify, redesign…

hugohe3/ppt-master · 108 tokens

morph-ppt

Use this skill when the user wants a .pptx with smooth cross-slide animation — PowerPoint Morph transitions, Keynote-style continuous motion, shapes that grow / move / rotate as the slide advances. Trigger on: 'morph', 'morph transition', 'smooth transition', 'continuous animation across slides', 'Keynote-style…

iOfficeAI/OfficeCLI · 169 tokens

officecli-academic-paper

Use this skill to build academic-style .docx output: journal / conference / thesis chapters carrying formal citation style (APA, Chicago, IEEE, MLA), numbered equations, figure & table cross-references, footnotes/endnotes, bibliography, or multi-column journal layout. Trigger on: 'research paper', 'journal paper'…

iOfficeAI/OfficeCLI · 141 tokens

doc-reader

Read any common document/data file — PDF, Word (.docx), Excel (.xlsx/.xls), PowerPoint (.pptx), images (OCR), CSV/TSV, plain text, JSON/YAML/TOML, HTML/XML, and most source-code files. Use the readdocument tool.

HKUDS/Vibe-Trading · 65 tokens

officecli

Create, analyze, proofread, and modify Office documents (.docx, .xlsx, .pptx) using the officecli CLI tool. Use when the user wants to create, inspect, check formatting, find issues, add charts, or modify Office documents.

iOfficeAI/OfficeCLI · 56 tokens