Creator · HKUDS
Last updated · Sep 2, 2026
Read, create, or edit Microsoft Word .docx files — extract/summarize
Sandbox only
Creator · HKUDS
Last updated · Sep 2, 2026
Read, create, or edit Microsoft Word .docx files — extract/summarize
Sandbox only
Creator · HKUDS
Last updated · Sep 2, 2026
Read, create, or edit Microsoft Word .docx files — extract/summarize
Sandbox only
Creator · HKUDS
Last updated · Sep 2, 2026
Read, create, or edit Microsoft Word .docx files — extract/summarize
Sandbox only
Install targets
Codex install prompt
Install the "docx" agent skill from https://github.com/HKUDS/DeepTutor/tree/main/deeptutor/skills/builtin/docx. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Read, create, or edit Microsoft Word .docx files — extract/summarize After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"hkuds-docx","task":"Install docx","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Deep research, source comparison, literature review, RAG, knowledge search, and reports.
Scenario
Document processing
I need my agent to read PDFs, extract tables, and turn documents into structured data.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add HKUDS/DeepTutor --skill docx
Maintenance
fresh
4d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
38K
92/100 Quality · 80/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
ExcellentHigh-confidence pick with strong adoption and healthy maintenance signals.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
38K GitHub stars
Repo activity
38K stars, 4.8K forks
Maintenance
4d since push
License
Apache-2.0
Install
npx skills add HKUDS/DeepTutor --skill docx
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add HKUDS/DeepTutor --skill docxDo not use when
Alternative
1.9K Stars
npx skills add yanliudesign/mono-color-skill --skill mono-color
Alternative
61.0K Stars
npx skills add mvanhorn/last30days-skill -g
Alternative
38.4K Stars
npx skills add Imbad0202/academic-research-skills
Alternative
28.0K Stars
npx skills add assafelovic/gpt-researcher
Agent safety v2
Usable candidate, but the agent should surface permission and audit notes before installation.
Require human approval before installing into a real workspace.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20docx%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20docx%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/hkuds-docx/install
Agent should check
Copy prompt
Task: Use docx in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20docx%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/hkuds-docx/install
Install command: npx skills add HKUDS/DeepTutor --skill docx
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/hkuds-docx/install
LLM text format
/api/skills/hkuds-docx/install?format=text
Find alternatives
/api/skills/search?q=docx&limit=3
Agent prompt
Use docx for this task. Review https://www.openagentskill.com/api/skills/hkuds-docx/install, then install with: npx skills add HKUDS/DeepTutor --skill docxRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/hkuds-docx
LLM text
/api/registry/manifest/hkuds-docx?format=text
Install alias
/api/registry/install/hkuds-docx
Recommend
/api/registry/recommend?task=Use%20docx%20in%20an%20agent%20workflow&limit=3
Agent fit
Document processing
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Document processing
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS38K GitHub stars
Stars/forks activity
PASS38K stars, 4.8K forks; issue activity unavailable in current metadata
Recent maintenance
PASS4d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
High-confidence pick with strong adoption and healthy maintenance signals.
Workflow fit
Parse messy files
I need my agent to read PDFs, extract tables, and turn documents into structured data.
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Search private knowledge
I need my agent to build a RAG workflow over documents and retrieve reliable context.
Workflow fit
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Ingest, retrieve, and cite
A workflow for document-heavy agents that ingest files, create searchable knowledge, retrieve relevant context, and answer with grounded sources.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Alternative shortlist
Similar skills that may fit this task.
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
Academic Research Skills for Claude Code: research → write → review → revise → finalize
Run autonomous deep research over web and local sources
--- name: docx description: Read, create, or edit Microsoft Word .docx files — extract/summarize text and tables, generate reports/letters/memos with headings, tables, images, TOC and page numbers, do find-and-replace, or apply tracked changes (redlines) and comments. Use whenever the user has a .docx or wants a Word deliverable. Not for PDF, .xlsx, .pptx, or Google Docs. tags: - tool - office requires: sandbox: shell ---
# 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](#raw-ooxml-advanced).
Work in the current directory (uploaded files land here). Write output to a new filename; don't overwrite the source. Run Python through `code_execution`, save output in the current directory, and refer to the document exactly as the Generated artifacts list names it. Use `exec` only for a genuinely shell-only command; never put this source in `python -c` or a heredoc.
## Read / extract
```python 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>`:
```python 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
```python 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") ```
Rules: - **Never type bullet/number characters** (`•`, `1.`) into text — use `style="List Bullet"`/`"List Number"`. Only list styles defined in the doc's template are available. - **No `\n` inside a run** — each visual line is its own `add_paragraph`. - **Built-in style names must match the template** (e.g. `"Heading 1"`, `"List Bullet"`); a wrong name raises `KeyError`. - Units: `Pt`, `Inches`, `Cm` from `docx.shared`. Colors: `RGBColor(0x1F,0x4E,0x79)`.
### Page setup, headers/footers, page numbers
```python from docx.shared import Inches
sec = doc.sections[0] sec.page_width, sec.page_height = Inches(8.5), Inches(11) # Letter sec.top_margin = sec.bottom_margin = Inches(1) sec.header.paragraphs[0].text = "Confidential" ```
Page-number fields aren't in the python-docx API; inject the field XML into a footer run:
```python from docx.oxml.ns import qn from docx.oxml import OxmlElement
def add_page_number(paragraph): for t in ("begin", "instr", "end"): r = OxmlElement("w:r") if t == "instr": fld = OxmlElement("w:instrText") fld.set(qn("xml:space"), "preserve") fld.text = "PAGE" else: fld = OxmlElement("w:fldChar") fld.set(qn("w:fldCharType"), t) r.append(fld) paragraph._p.append(r)
add_page_number(doc.sections[0].footer.paragraphs[0]) ```
A clickable **Table of Contents** is also a field; Word shows "right-click → Update Field" until refreshed. Same pattern with `instrText` = `TOC \o "1-3" \h \z \u`.
## Edit existing (simple)
`python-docx` preserves the rest of the document; mutate then save under a new name.
```python doc = Document("in.docx") # Find-and-replace, keeping each run's formatting: for p in doc.paragraphs: if "{{CLIENT}}" in p.text: for r in p.runs: r.text = r.text.replace("{{CLIENT}}", "Acme Co") doc.save("out.docx") ```
Gotcha: Word splits text across runs, so a phrase may not live in one `run.text` even though `p.text` shows it whole. If the placeholder spans runs, set `p.runs[0].text = p.text.replace(...)` and clear the rest (`for r in p.runs[1:]: r.text = ""`) — this collapses formatting to the first run, acceptable for plain placeholders. For exact-fidelity edits, use the raw-OOXML tier.
## .doc → .docx and PDF export (LibreOffice, optional)
Legacy binary `.doc` can't be read by python-docx, and there is no built-in PDF export. Both need LibreOffice, which is often **absent** — probe first and degrade with a clear note if missing:
```bash command -v soffice >/dev/null && soffice --headless --convert-to docx legacy.doc || echo "soffice unavailable — cannot convert .doc; ask user for a .docx" command -v soffice >/dev/null && soffice --headless --convert-to pdf out.docx || echo "soffice unavailable — cannot export PDF" ```
Network egress is off — never `pip install` or download. If a needed tool is absent, say so and stop, don't improvise.
## Raw OOXML (advanced)
Only when python-docx can't express it: **tracked changes, comments, exact-fidelity edits.** Workflow: read the XML part → edit it as text → re-zip every original member, rewriting only the changed part.
```python import zipfile
src, dst = "in.docx", "out.docx" with zipfile.ZipFile(src) as z: xml = z.read("word/document.xml").decode("utf-8") xml = xml.replace("OLD", "NEW") # or splice tracked-change elements (below) with zipfile.ZipFile(src) as zin, zipfile.ZipFile(dst, "w", zipfile.ZIP_DEFLATED) as zout: for item in zin.infolist(): data = ( xml.encode("utf-8") if item.filename == "word/document.xml" else zin.read(item.filename) ) zout.writestr(item, data) ```
Critical traps (these silently corrupt the file or lose text): - **`xml:space="preserve"`** on any `<w:t>`/`<w:delText>` with leading/trailing whitespace, or Word strips the space. - **Don't pretty-print** into text nodes — added newlines/indent inside `<w:t>` become visible spaces. Edit the XML as a string; never reserialize the whole tree with indentation. - **Keep parts consistent**: new image/part → add its `<Relationship>` in `word/_rels/document.xml.rels` *and* a content type in `[Content_Types].xml`, or the doc opens "corrupt." - **Unique IDs**: every `w:id` on `<w:ins>`/`<w:del>`/comments must be unique in the file. `w14:paraId`/`w16cid:durableId` must be `< 0x7FFFFFFF` (8-digit hex). - **Element order in `<w:pPr>`**: `pStyle`, `numPr`, `spacing`, `ind`, `jc`, then `rPr` last.
### Tracked changes (redlines)
Use a consistent author (default `"Claude"` unless the user names one) and ISO date. Replace the **whole `<w:r>`** with siblings — never nest change tags inside a run — and copy the original `<w:rPr>` into the new runs to keep formatting.
```xml <!-- change "30 days" → "60 days" --> <w:r><w:t xml:space="preserve">The term is </w:t></w:r> <w:del w:id="1" w:author="Claude" w:date="2026-01-01T00:00:00Z"> <w:r><w:delText>30</w:delText></w:r></w:del> <w:ins w:id="2" w:author="Claude" w:date="2026-01-01T00:00:00Z"> <w:r><w:t>60</w:t></w:r></w:ins> <w:r><w:t xml:space="preserve"> days.</w:t></w:r> ```
- Inside `<w:del>` use `<w:delText>` (not `<w:t>`); inside `<w:ins>` never use `<w:delText>`. - **Deleting a whole paragraph**: also mark its paragraph mark — add `<w:del .../>` inside `<w:pPr><w:rPr>` — or accepting changes leaves an empty paragraph. - **Reject another author's insertion**: nest your `<w:del>` *inside* their `<w:ins>`. **Restore their deletion**: add a new `<w:ins>` *after* their `<w:del>` — never edit their tags.
### Comments
Comments live in a separate `word/comments.xml` part (create it + its relationship in `word/_rels/document.xml.rels` + a content-type override if absent). In `document.xml`, the anchor markers `<w:commentRangeStart w:id="N"/>` and `<w:commentRangeEnd w:id="N"/>` are **siblings of `<w:r>`, never inside one**; follow the end marker with `<w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:commentReference w:id="N"/></w:r>`. This is fiddly — verify the output opens in Word.
## Verify before returning
Always confirm the file reopens cleanly — a silent corruption is the most common failure:
```python from docx import Document
d = Document("out.docx") print(len(d.paragraphs), "paragraphs OK") ```
For raw-OOXML edits also run `python -c "import zipfile; zipfile.ZipFile('out.docx').testzip()"` and well-formedness-check each edited XML part with `lxml.etree.parse`.
Source provenance
Decision snapshot
38,299 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for docx, ready for a manual X post.
For source-backed research, this is a skill worth shortlisting before another blank prompt. docx: Read, create, or edit Microsoft Word .docx files — extract/summarize 38.3K stars https://www.openagentskill.com/skills/hkuds-docx?ref=x
Listing + install path for docx: https://www.openagentskill.com/skills/hkuds-docx?ref=x Install: npx skills add HKUDS/DeepTutor --skill docx
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to HKUDS but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/hkuds-docx?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/hkuds-docx?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/hkuds-docx/audit)
[](https://www.openagentskill.com/skills/hkuds-docx?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)HKUDS
@hkuds
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
mono-color
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
1.9K StarsLast30days Skill
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
61.0K StarsAcademic Research Skills
Academic Research Skills for Claude Code: research → write → review → revise → finalize
38.4K StarsGPT Researcher
Run autonomous deep research over web and local sources
28.0K StarsInstall targets
Codex install prompt
Install the "docx" agent skill from https://github.com/HKUDS/DeepTutor/tree/main/deeptutor/skills/builtin/docx. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Read, create, or edit Microsoft Word .docx files — extract/summarize After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"hkuds-docx","task":"Install docx","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Deep research, source comparison, literature review, RAG, knowledge search, and reports.
Scenario
Document processing
I need my agent to read PDFs, extract tables, and turn documents into structured data.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add HKUDS/DeepTutor --skill docx
Maintenance
fresh
4d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
38K
92/100 Quality · 80/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
ExcellentHigh-confidence pick with strong adoption and healthy maintenance signals.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
38K GitHub stars
Repo activity
38K stars, 4.8K forks
Maintenance
4d since push
License
Apache-2.0
Install
npx skills add HKUDS/DeepTutor --skill docx
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add HKUDS/DeepTutor --skill docxDo not use when
Alternative
1.9K Stars
npx skills add yanliudesign/mono-color-skill --skill mono-color
Alternative
61.0K Stars
npx skills add mvanhorn/last30days-skill -g
Alternative
38.4K Stars
npx skills add Imbad0202/academic-research-skills
Alternative
28.0K Stars
npx skills add assafelovic/gpt-researcher
Agent safety v2
Usable candidate, but the agent should surface permission and audit notes before installation.
Require human approval before installing into a real workspace.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20docx%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20docx%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/hkuds-docx/install
Agent should check
Copy prompt
Task: Use docx in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20docx%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/hkuds-docx/install
Install command: npx skills add HKUDS/DeepTutor --skill docx
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/hkuds-docx/install
LLM text format
/api/skills/hkuds-docx/install?format=text
Find alternatives
/api/skills/search?q=docx&limit=3
Agent prompt
Use docx for this task. Review https://www.openagentskill.com/api/skills/hkuds-docx/install, then install with: npx skills add HKUDS/DeepTutor --skill docxRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/hkuds-docx
LLM text
/api/registry/manifest/hkuds-docx?format=text
Install alias
/api/registry/install/hkuds-docx
Recommend
/api/registry/recommend?task=Use%20docx%20in%20an%20agent%20workflow&limit=3
Agent fit
Document processing
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Document processing
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS38K GitHub stars
Stars/forks activity
PASS38K stars, 4.8K forks; issue activity unavailable in current metadata
Recent maintenance
PASS4d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
High-confidence pick with strong adoption and healthy maintenance signals.
Workflow fit
Parse messy files
I need my agent to read PDFs, extract tables, and turn documents into structured data.
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Search private knowledge
I need my agent to build a RAG workflow over documents and retrieve reliable context.
Workflow fit
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Ingest, retrieve, and cite
A workflow for document-heavy agents that ingest files, create searchable knowledge, retrieve relevant context, and answer with grounded sources.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Alternative shortlist
Similar skills that may fit this task.
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
Academic Research Skills for Claude Code: research → write → review → revise → finalize
Run autonomous deep research over web and local sources
--- name: docx description: Read, create, or edit Microsoft Word .docx files — extract/summarize text and tables, generate reports/letters/memos with headings, tables, images, TOC and page numbers, do find-and-replace, or apply tracked changes (redlines) and comments. Use whenever the user has a .docx or wants a Word deliverable. Not for PDF, .xlsx, .pptx, or Google Docs. tags: - tool - office requires: sandbox: shell ---
# 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](#raw-ooxml-advanced).
Work in the current directory (uploaded files land here). Write output to a new filename; don't overwrite the source. Run Python through `code_execution`, save output in the current directory, and refer to the document exactly as the Generated artifacts list names it. Use `exec` only for a genuinely shell-only command; never put this source in `python -c` or a heredoc.
## Read / extract
```python 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>`:
```python 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
```python 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") ```
Rules: - **Never type bullet/number characters** (`•`, `1.`) into text — use `style="List Bullet"`/`"List Number"`. Only list styles defined in the doc's template are available. - **No `\n` inside a run** — each visual line is its own `add_paragraph`. - **Built-in style names must match the template** (e.g. `"Heading 1"`, `"List Bullet"`); a wrong name raises `KeyError`. - Units: `Pt`, `Inches`, `Cm` from `docx.shared`. Colors: `RGBColor(0x1F,0x4E,0x79)`.
### Page setup, headers/footers, page numbers
```python from docx.shared import Inches
sec = doc.sections[0] sec.page_width, sec.page_height = Inches(8.5), Inches(11) # Letter sec.top_margin = sec.bottom_margin = Inches(1) sec.header.paragraphs[0].text = "Confidential" ```
Page-number fields aren't in the python-docx API; inject the field XML into a footer run:
```python from docx.oxml.ns import qn from docx.oxml import OxmlElement
def add_page_number(paragraph): for t in ("begin", "instr", "end"): r = OxmlElement("w:r") if t == "instr": fld = OxmlElement("w:instrText") fld.set(qn("xml:space"), "preserve") fld.text = "PAGE" else: fld = OxmlElement("w:fldChar") fld.set(qn("w:fldCharType"), t) r.append(fld) paragraph._p.append(r)
add_page_number(doc.sections[0].footer.paragraphs[0]) ```
A clickable **Table of Contents** is also a field; Word shows "right-click → Update Field" until refreshed. Same pattern with `instrText` = `TOC \o "1-3" \h \z \u`.
## Edit existing (simple)
`python-docx` preserves the rest of the document; mutate then save under a new name.
```python doc = Document("in.docx") # Find-and-replace, keeping each run's formatting: for p in doc.paragraphs: if "{{CLIENT}}" in p.text: for r in p.runs: r.text = r.text.replace("{{CLIENT}}", "Acme Co") doc.save("out.docx") ```
Gotcha: Word splits text across runs, so a phrase may not live in one `run.text` even though `p.text` shows it whole. If the placeholder spans runs, set `p.runs[0].text = p.text.replace(...)` and clear the rest (`for r in p.runs[1:]: r.text = ""`) — this collapses formatting to the first run, acceptable for plain placeholders. For exact-fidelity edits, use the raw-OOXML tier.
## .doc → .docx and PDF export (LibreOffice, optional)
Legacy binary `.doc` can't be read by python-docx, and there is no built-in PDF export. Both need LibreOffice, which is often **absent** — probe first and degrade with a clear note if missing:
```bash command -v soffice >/dev/null && soffice --headless --convert-to docx legacy.doc || echo "soffice unavailable — cannot convert .doc; ask user for a .docx" command -v soffice >/dev/null && soffice --headless --convert-to pdf out.docx || echo "soffice unavailable — cannot export PDF" ```
Network egress is off — never `pip install` or download. If a needed tool is absent, say so and stop, don't improvise.
## Raw OOXML (advanced)
Only when python-docx can't express it: **tracked changes, comments, exact-fidelity edits.** Workflow: read the XML part → edit it as text → re-zip every original member, rewriting only the changed part.
```python import zipfile
src, dst = "in.docx", "out.docx" with zipfile.ZipFile(src) as z: xml = z.read("word/document.xml").decode("utf-8") xml = xml.replace("OLD", "NEW") # or splice tracked-change elements (below) with zipfile.ZipFile(src) as zin, zipfile.ZipFile(dst, "w", zipfile.ZIP_DEFLATED) as zout: for item in zin.infolist(): data = ( xml.encode("utf-8") if item.filename == "word/document.xml" else zin.read(item.filename) ) zout.writestr(item, data) ```
Critical traps (these silently corrupt the file or lose text): - **`xml:space="preserve"`** on any `<w:t>`/`<w:delText>` with leading/trailing whitespace, or Word strips the space. - **Don't pretty-print** into text nodes — added newlines/indent inside `<w:t>` become visible spaces. Edit the XML as a string; never reserialize the whole tree with indentation. - **Keep parts consistent**: new image/part → add its `<Relationship>` in `word/_rels/document.xml.rels` *and* a content type in `[Content_Types].xml`, or the doc opens "corrupt." - **Unique IDs**: every `w:id` on `<w:ins>`/`<w:del>`/comments must be unique in the file. `w14:paraId`/`w16cid:durableId` must be `< 0x7FFFFFFF` (8-digit hex). - **Element order in `<w:pPr>`**: `pStyle`, `numPr`, `spacing`, `ind`, `jc`, then `rPr` last.
### Tracked changes (redlines)
Use a consistent author (default `"Claude"` unless the user names one) and ISO date. Replace the **whole `<w:r>`** with siblings — never nest change tags inside a run — and copy the original `<w:rPr>` into the new runs to keep formatting.
```xml <!-- change "30 days" → "60 days" --> <w:r><w:t xml:space="preserve">The term is </w:t></w:r> <w:del w:id="1" w:author="Claude" w:date="2026-01-01T00:00:00Z"> <w:r><w:delText>30</w:delText></w:r></w:del> <w:ins w:id="2" w:author="Claude" w:date="2026-01-01T00:00:00Z"> <w:r><w:t>60</w:t></w:r></w:ins> <w:r><w:t xml:space="preserve"> days.</w:t></w:r> ```
- Inside `<w:del>` use `<w:delText>` (not `<w:t>`); inside `<w:ins>` never use `<w:delText>`. - **Deleting a whole paragraph**: also mark its paragraph mark — add `<w:del .../>` inside `<w:pPr><w:rPr>` — or accepting changes leaves an empty paragraph. - **Reject another author's insertion**: nest your `<w:del>` *inside* their `<w:ins>`. **Restore their deletion**: add a new `<w:ins>` *after* their `<w:del>` — never edit their tags.
### Comments
Comments live in a separate `word/comments.xml` part (create it + its relationship in `word/_rels/document.xml.rels` + a content-type override if absent). In `document.xml`, the anchor markers `<w:commentRangeStart w:id="N"/>` and `<w:commentRangeEnd w:id="N"/>` are **siblings of `<w:r>`, never inside one**; follow the end marker with `<w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:commentReference w:id="N"/></w:r>`. This is fiddly — verify the output opens in Word.
## Verify before returning
Always confirm the file reopens cleanly — a silent corruption is the most common failure:
```python from docx import Document
d = Document("out.docx") print(len(d.paragraphs), "paragraphs OK") ```
For raw-OOXML edits also run `python -c "import zipfile; zipfile.ZipFile('out.docx').testzip()"` and well-formedness-check each edited XML part with `lxml.etree.parse`.
Source provenance
Decision snapshot
38,299 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for docx, ready for a manual X post.
For source-backed research, this is a skill worth shortlisting before another blank prompt. docx: Read, create, or edit Microsoft Word .docx files — extract/summarize 38.3K stars https://www.openagentskill.com/skills/hkuds-docx?ref=x
Listing + install path for docx: https://www.openagentskill.com/skills/hkuds-docx?ref=x Install: npx skills add HKUDS/DeepTutor --skill docx
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to HKUDS but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/hkuds-docx?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/hkuds-docx?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/hkuds-docx/audit)
[](https://www.openagentskill.com/skills/hkuds-docx?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)HKUDS
@hkuds
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
mono-color
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
1.9K StarsLast30days Skill
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
61.0K StarsAcademic Research Skills
Academic Research Skills for Claude Code: research → write → review → revise → finalize
38.4K StarsGPT Researcher
Run autonomous deep research over web and local sources
28.0K StarsInstall targets
Codex install prompt
Install the "docx" agent skill from https://github.com/HKUDS/DeepTutor/tree/main/deeptutor/skills/builtin/docx. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Read, create, or edit Microsoft Word .docx files — extract/summarize After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"hkuds-docx","task":"Install docx","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Deep research, source comparison, literature review, RAG, knowledge search, and reports.
Scenario
Document processing
I need my agent to read PDFs, extract tables, and turn documents into structured data.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add HKUDS/DeepTutor --skill docx
Maintenance
fresh
4d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
38K
92/100 Quality · 80/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
ExcellentHigh-confidence pick with strong adoption and healthy maintenance signals.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
38K GitHub stars
Repo activity
38K stars, 4.8K forks
Maintenance
4d since push
License
Apache-2.0
Install
npx skills add HKUDS/DeepTutor --skill docx
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add HKUDS/DeepTutor --skill docxDo not use when
Alternative
1.9K Stars
npx skills add yanliudesign/mono-color-skill --skill mono-color
Alternative
61.0K Stars
npx skills add mvanhorn/last30days-skill -g
Alternative
38.4K Stars
npx skills add Imbad0202/academic-research-skills
Alternative
28.0K Stars
npx skills add assafelovic/gpt-researcher
Agent safety v2
Usable candidate, but the agent should surface permission and audit notes before installation.
Require human approval before installing into a real workspace.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20docx%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20docx%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/hkuds-docx/install
Agent should check
Copy prompt
Task: Use docx in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20docx%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/hkuds-docx/install
Install command: npx skills add HKUDS/DeepTutor --skill docx
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/hkuds-docx/install
LLM text format
/api/skills/hkuds-docx/install?format=text
Find alternatives
/api/skills/search?q=docx&limit=3
Agent prompt
Use docx for this task. Review https://www.openagentskill.com/api/skills/hkuds-docx/install, then install with: npx skills add HKUDS/DeepTutor --skill docxRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/hkuds-docx
LLM text
/api/registry/manifest/hkuds-docx?format=text
Install alias
/api/registry/install/hkuds-docx
Recommend
/api/registry/recommend?task=Use%20docx%20in%20an%20agent%20workflow&limit=3
Agent fit
Document processing
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Document processing
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS38K GitHub stars
Stars/forks activity
PASS38K stars, 4.8K forks; issue activity unavailable in current metadata
Recent maintenance
PASS4d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
High-confidence pick with strong adoption and healthy maintenance signals.
Workflow fit
Parse messy files
I need my agent to read PDFs, extract tables, and turn documents into structured data.
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Search private knowledge
I need my agent to build a RAG workflow over documents and retrieve reliable context.
Workflow fit
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Ingest, retrieve, and cite
A workflow for document-heavy agents that ingest files, create searchable knowledge, retrieve relevant context, and answer with grounded sources.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Alternative shortlist
Similar skills that may fit this task.
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
Academic Research Skills for Claude Code: research → write → review → revise → finalize
Run autonomous deep research over web and local sources
--- name: docx description: Read, create, or edit Microsoft Word .docx files — extract/summarize text and tables, generate reports/letters/memos with headings, tables, images, TOC and page numbers, do find-and-replace, or apply tracked changes (redlines) and comments. Use whenever the user has a .docx or wants a Word deliverable. Not for PDF, .xlsx, .pptx, or Google Docs. tags: - tool - office requires: sandbox: shell ---
# 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](#raw-ooxml-advanced).
Work in the current directory (uploaded files land here). Write output to a new filename; don't overwrite the source. Run Python through `code_execution`, save output in the current directory, and refer to the document exactly as the Generated artifacts list names it. Use `exec` only for a genuinely shell-only command; never put this source in `python -c` or a heredoc.
## Read / extract
```python 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>`:
```python 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
```python 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") ```
Rules: - **Never type bullet/number characters** (`•`, `1.`) into text — use `style="List Bullet"`/`"List Number"`. Only list styles defined in the doc's template are available. - **No `\n` inside a run** — each visual line is its own `add_paragraph`. - **Built-in style names must match the template** (e.g. `"Heading 1"`, `"List Bullet"`); a wrong name raises `KeyError`. - Units: `Pt`, `Inches`, `Cm` from `docx.shared`. Colors: `RGBColor(0x1F,0x4E,0x79)`.
### Page setup, headers/footers, page numbers
```python from docx.shared import Inches
sec = doc.sections[0] sec.page_width, sec.page_height = Inches(8.5), Inches(11) # Letter sec.top_margin = sec.bottom_margin = Inches(1) sec.header.paragraphs[0].text = "Confidential" ```
Page-number fields aren't in the python-docx API; inject the field XML into a footer run:
```python from docx.oxml.ns import qn from docx.oxml import OxmlElement
def add_page_number(paragraph): for t in ("begin", "instr", "end"): r = OxmlElement("w:r") if t == "instr": fld = OxmlElement("w:instrText") fld.set(qn("xml:space"), "preserve") fld.text = "PAGE" else: fld = OxmlElement("w:fldChar") fld.set(qn("w:fldCharType"), t) r.append(fld) paragraph._p.append(r)
add_page_number(doc.sections[0].footer.paragraphs[0]) ```
A clickable **Table of Contents** is also a field; Word shows "right-click → Update Field" until refreshed. Same pattern with `instrText` = `TOC \o "1-3" \h \z \u`.
## Edit existing (simple)
`python-docx` preserves the rest of the document; mutate then save under a new name.
```python doc = Document("in.docx") # Find-and-replace, keeping each run's formatting: for p in doc.paragraphs: if "{{CLIENT}}" in p.text: for r in p.runs: r.text = r.text.replace("{{CLIENT}}", "Acme Co") doc.save("out.docx") ```
Gotcha: Word splits text across runs, so a phrase may not live in one `run.text` even though `p.text` shows it whole. If the placeholder spans runs, set `p.runs[0].text = p.text.replace(...)` and clear the rest (`for r in p.runs[1:]: r.text = ""`) — this collapses formatting to the first run, acceptable for plain placeholders. For exact-fidelity edits, use the raw-OOXML tier.
## .doc → .docx and PDF export (LibreOffice, optional)
Legacy binary `.doc` can't be read by python-docx, and there is no built-in PDF export. Both need LibreOffice, which is often **absent** — probe first and degrade with a clear note if missing:
```bash command -v soffice >/dev/null && soffice --headless --convert-to docx legacy.doc || echo "soffice unavailable — cannot convert .doc; ask user for a .docx" command -v soffice >/dev/null && soffice --headless --convert-to pdf out.docx || echo "soffice unavailable — cannot export PDF" ```
Network egress is off — never `pip install` or download. If a needed tool is absent, say so and stop, don't improvise.
## Raw OOXML (advanced)
Only when python-docx can't express it: **tracked changes, comments, exact-fidelity edits.** Workflow: read the XML part → edit it as text → re-zip every original member, rewriting only the changed part.
```python import zipfile
src, dst = "in.docx", "out.docx" with zipfile.ZipFile(src) as z: xml = z.read("word/document.xml").decode("utf-8") xml = xml.replace("OLD", "NEW") # or splice tracked-change elements (below) with zipfile.ZipFile(src) as zin, zipfile.ZipFile(dst, "w", zipfile.ZIP_DEFLATED) as zout: for item in zin.infolist(): data = ( xml.encode("utf-8") if item.filename == "word/document.xml" else zin.read(item.filename) ) zout.writestr(item, data) ```
Critical traps (these silently corrupt the file or lose text): - **`xml:space="preserve"`** on any `<w:t>`/`<w:delText>` with leading/trailing whitespace, or Word strips the space. - **Don't pretty-print** into text nodes — added newlines/indent inside `<w:t>` become visible spaces. Edit the XML as a string; never reserialize the whole tree with indentation. - **Keep parts consistent**: new image/part → add its `<Relationship>` in `word/_rels/document.xml.rels` *and* a content type in `[Content_Types].xml`, or the doc opens "corrupt." - **Unique IDs**: every `w:id` on `<w:ins>`/`<w:del>`/comments must be unique in the file. `w14:paraId`/`w16cid:durableId` must be `< 0x7FFFFFFF` (8-digit hex). - **Element order in `<w:pPr>`**: `pStyle`, `numPr`, `spacing`, `ind`, `jc`, then `rPr` last.
### Tracked changes (redlines)
Use a consistent author (default `"Claude"` unless the user names one) and ISO date. Replace the **whole `<w:r>`** with siblings — never nest change tags inside a run — and copy the original `<w:rPr>` into the new runs to keep formatting.
```xml <!-- change "30 days" → "60 days" --> <w:r><w:t xml:space="preserve">The term is </w:t></w:r> <w:del w:id="1" w:author="Claude" w:date="2026-01-01T00:00:00Z"> <w:r><w:delText>30</w:delText></w:r></w:del> <w:ins w:id="2" w:author="Claude" w:date="2026-01-01T00:00:00Z"> <w:r><w:t>60</w:t></w:r></w:ins> <w:r><w:t xml:space="preserve"> days.</w:t></w:r> ```
- Inside `<w:del>` use `<w:delText>` (not `<w:t>`); inside `<w:ins>` never use `<w:delText>`. - **Deleting a whole paragraph**: also mark its paragraph mark — add `<w:del .../>` inside `<w:pPr><w:rPr>` — or accepting changes leaves an empty paragraph. - **Reject another author's insertion**: nest your `<w:del>` *inside* their `<w:ins>`. **Restore their deletion**: add a new `<w:ins>` *after* their `<w:del>` — never edit their tags.
### Comments
Comments live in a separate `word/comments.xml` part (create it + its relationship in `word/_rels/document.xml.rels` + a content-type override if absent). In `document.xml`, the anchor markers `<w:commentRangeStart w:id="N"/>` and `<w:commentRangeEnd w:id="N"/>` are **siblings of `<w:r>`, never inside one**; follow the end marker with `<w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:commentReference w:id="N"/></w:r>`. This is fiddly — verify the output opens in Word.
## Verify before returning
Always confirm the file reopens cleanly — a silent corruption is the most common failure:
```python from docx import Document
d = Document("out.docx") print(len(d.paragraphs), "paragraphs OK") ```
For raw-OOXML edits also run `python -c "import zipfile; zipfile.ZipFile('out.docx').testzip()"` and well-formedness-check each edited XML part with `lxml.etree.parse`.
Source provenance
Decision snapshot
38,299 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for docx, ready for a manual X post.
For source-backed research, this is a skill worth shortlisting before another blank prompt. docx: Read, create, or edit Microsoft Word .docx files — extract/summarize 38.3K stars https://www.openagentskill.com/skills/hkuds-docx?ref=x
Listing + install path for docx: https://www.openagentskill.com/skills/hkuds-docx?ref=x Install: npx skills add HKUDS/DeepTutor --skill docx
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to HKUDS but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/hkuds-docx?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/hkuds-docx?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/hkuds-docx/audit)
[](https://www.openagentskill.com/skills/hkuds-docx?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)HKUDS
@hkuds
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
mono-color
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
1.9K StarsLast30days Skill
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
61.0K StarsAcademic Research Skills
Academic Research Skills for Claude Code: research → write → review → revise → finalize
38.4K StarsGPT Researcher
Run autonomous deep research over web and local sources
28.0K StarsInstall targets
Codex install prompt
Install the "docx" agent skill from https://github.com/HKUDS/DeepTutor/tree/main/deeptutor/skills/builtin/docx. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Read, create, or edit Microsoft Word .docx files — extract/summarize After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"hkuds-docx","task":"Install docx","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Deep research, source comparison, literature review, RAG, knowledge search, and reports.
Scenario
Document processing
I need my agent to read PDFs, extract tables, and turn documents into structured data.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add HKUDS/DeepTutor --skill docx
Maintenance
fresh
4d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
38K
92/100 Quality · 80/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
ExcellentHigh-confidence pick with strong adoption and healthy maintenance signals.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
38K GitHub stars
Repo activity
38K stars, 4.8K forks
Maintenance
4d since push
License
Apache-2.0
Install
npx skills add HKUDS/DeepTutor --skill docx
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add HKUDS/DeepTutor --skill docxDo not use when
Alternative
1.9K Stars
npx skills add yanliudesign/mono-color-skill --skill mono-color
Alternative
61.0K Stars
npx skills add mvanhorn/last30days-skill -g
Alternative
38.4K Stars
npx skills add Imbad0202/academic-research-skills
Alternative
28.0K Stars
npx skills add assafelovic/gpt-researcher
Agent safety v2
Usable candidate, but the agent should surface permission and audit notes before installation.
Require human approval before installing into a real workspace.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20docx%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20docx%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/hkuds-docx/install
Agent should check
Copy prompt
Task: Use docx in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20docx%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/hkuds-docx/install
Install command: npx skills add HKUDS/DeepTutor --skill docx
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/hkuds-docx/install
LLM text format
/api/skills/hkuds-docx/install?format=text
Find alternatives
/api/skills/search?q=docx&limit=3
Agent prompt
Use docx for this task. Review https://www.openagentskill.com/api/skills/hkuds-docx/install, then install with: npx skills add HKUDS/DeepTutor --skill docxRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/hkuds-docx
LLM text
/api/registry/manifest/hkuds-docx?format=text
Install alias
/api/registry/install/hkuds-docx
Recommend
/api/registry/recommend?task=Use%20docx%20in%20an%20agent%20workflow&limit=3
Agent fit
Document processing
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Document processing
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS38K GitHub stars
Stars/forks activity
PASS38K stars, 4.8K forks; issue activity unavailable in current metadata
Recent maintenance
PASS4d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
High-confidence pick with strong adoption and healthy maintenance signals.
Workflow fit
Parse messy files
I need my agent to read PDFs, extract tables, and turn documents into structured data.
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Search private knowledge
I need my agent to build a RAG workflow over documents and retrieve reliable context.
Workflow fit
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Ingest, retrieve, and cite
A workflow for document-heavy agents that ingest files, create searchable knowledge, retrieve relevant context, and answer with grounded sources.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Alternative shortlist
Similar skills that may fit this task.
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
Academic Research Skills for Claude Code: research → write → review → revise → finalize
Run autonomous deep research over web and local sources
--- name: docx description: Read, create, or edit Microsoft Word .docx files — extract/summarize text and tables, generate reports/letters/memos with headings, tables, images, TOC and page numbers, do find-and-replace, or apply tracked changes (redlines) and comments. Use whenever the user has a .docx or wants a Word deliverable. Not for PDF, .xlsx, .pptx, or Google Docs. tags: - tool - office requires: sandbox: shell ---
# 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](#raw-ooxml-advanced).
Work in the current directory (uploaded files land here). Write output to a new filename; don't overwrite the source. Run Python through `code_execution`, save output in the current directory, and refer to the document exactly as the Generated artifacts list names it. Use `exec` only for a genuinely shell-only command; never put this source in `python -c` or a heredoc.
## Read / extract
```python 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>`:
```python 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
```python 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") ```
Rules: - **Never type bullet/number characters** (`•`, `1.`) into text — use `style="List Bullet"`/`"List Number"`. Only list styles defined in the doc's template are available. - **No `\n` inside a run** — each visual line is its own `add_paragraph`. - **Built-in style names must match the template** (e.g. `"Heading 1"`, `"List Bullet"`); a wrong name raises `KeyError`. - Units: `Pt`, `Inches`, `Cm` from `docx.shared`. Colors: `RGBColor(0x1F,0x4E,0x79)`.
### Page setup, headers/footers, page numbers
```python from docx.shared import Inches
sec = doc.sections[0] sec.page_width, sec.page_height = Inches(8.5), Inches(11) # Letter sec.top_margin = sec.bottom_margin = Inches(1) sec.header.paragraphs[0].text = "Confidential" ```
Page-number fields aren't in the python-docx API; inject the field XML into a footer run:
```python from docx.oxml.ns import qn from docx.oxml import OxmlElement
def add_page_number(paragraph): for t in ("begin", "instr", "end"): r = OxmlElement("w:r") if t == "instr": fld = OxmlElement("w:instrText") fld.set(qn("xml:space"), "preserve") fld.text = "PAGE" else: fld = OxmlElement("w:fldChar") fld.set(qn("w:fldCharType"), t) r.append(fld) paragraph._p.append(r)
add_page_number(doc.sections[0].footer.paragraphs[0]) ```
A clickable **Table of Contents** is also a field; Word shows "right-click → Update Field" until refreshed. Same pattern with `instrText` = `TOC \o "1-3" \h \z \u`.
## Edit existing (simple)
`python-docx` preserves the rest of the document; mutate then save under a new name.
```python doc = Document("in.docx") # Find-and-replace, keeping each run's formatting: for p in doc.paragraphs: if "{{CLIENT}}" in p.text: for r in p.runs: r.text = r.text.replace("{{CLIENT}}", "Acme Co") doc.save("out.docx") ```
Gotcha: Word splits text across runs, so a phrase may not live in one `run.text` even though `p.text` shows it whole. If the placeholder spans runs, set `p.runs[0].text = p.text.replace(...)` and clear the rest (`for r in p.runs[1:]: r.text = ""`) — this collapses formatting to the first run, acceptable for plain placeholders. For exact-fidelity edits, use the raw-OOXML tier.
## .doc → .docx and PDF export (LibreOffice, optional)
Legacy binary `.doc` can't be read by python-docx, and there is no built-in PDF export. Both need LibreOffice, which is often **absent** — probe first and degrade with a clear note if missing:
```bash command -v soffice >/dev/null && soffice --headless --convert-to docx legacy.doc || echo "soffice unavailable — cannot convert .doc; ask user for a .docx" command -v soffice >/dev/null && soffice --headless --convert-to pdf out.docx || echo "soffice unavailable — cannot export PDF" ```
Network egress is off — never `pip install` or download. If a needed tool is absent, say so and stop, don't improvise.
## Raw OOXML (advanced)
Only when python-docx can't express it: **tracked changes, comments, exact-fidelity edits.** Workflow: read the XML part → edit it as text → re-zip every original member, rewriting only the changed part.
```python import zipfile
src, dst = "in.docx", "out.docx" with zipfile.ZipFile(src) as z: xml = z.read("word/document.xml").decode("utf-8") xml = xml.replace("OLD", "NEW") # or splice tracked-change elements (below) with zipfile.ZipFile(src) as zin, zipfile.ZipFile(dst, "w", zipfile.ZIP_DEFLATED) as zout: for item in zin.infolist(): data = ( xml.encode("utf-8") if item.filename == "word/document.xml" else zin.read(item.filename) ) zout.writestr(item, data) ```
Critical traps (these silently corrupt the file or lose text): - **`xml:space="preserve"`** on any `<w:t>`/`<w:delText>` with leading/trailing whitespace, or Word strips the space. - **Don't pretty-print** into text nodes — added newlines/indent inside `<w:t>` become visible spaces. Edit the XML as a string; never reserialize the whole tree with indentation. - **Keep parts consistent**: new image/part → add its `<Relationship>` in `word/_rels/document.xml.rels` *and* a content type in `[Content_Types].xml`, or the doc opens "corrupt." - **Unique IDs**: every `w:id` on `<w:ins>`/`<w:del>`/comments must be unique in the file. `w14:paraId`/`w16cid:durableId` must be `< 0x7FFFFFFF` (8-digit hex). - **Element order in `<w:pPr>`**: `pStyle`, `numPr`, `spacing`, `ind`, `jc`, then `rPr` last.
### Tracked changes (redlines)
Use a consistent author (default `"Claude"` unless the user names one) and ISO date. Replace the **whole `<w:r>`** with siblings — never nest change tags inside a run — and copy the original `<w:rPr>` into the new runs to keep formatting.
```xml <!-- change "30 days" → "60 days" --> <w:r><w:t xml:space="preserve">The term is </w:t></w:r> <w:del w:id="1" w:author="Claude" w:date="2026-01-01T00:00:00Z"> <w:r><w:delText>30</w:delText></w:r></w:del> <w:ins w:id="2" w:author="Claude" w:date="2026-01-01T00:00:00Z"> <w:r><w:t>60</w:t></w:r></w:ins> <w:r><w:t xml:space="preserve"> days.</w:t></w:r> ```
- Inside `<w:del>` use `<w:delText>` (not `<w:t>`); inside `<w:ins>` never use `<w:delText>`. - **Deleting a whole paragraph**: also mark its paragraph mark — add `<w:del .../>` inside `<w:pPr><w:rPr>` — or accepting changes leaves an empty paragraph. - **Reject another author's insertion**: nest your `<w:del>` *inside* their `<w:ins>`. **Restore their deletion**: add a new `<w:ins>` *after* their `<w:del>` — never edit their tags.
### Comments
Comments live in a separate `word/comments.xml` part (create it + its relationship in `word/_rels/document.xml.rels` + a content-type override if absent). In `document.xml`, the anchor markers `<w:commentRangeStart w:id="N"/>` and `<w:commentRangeEnd w:id="N"/>` are **siblings of `<w:r>`, never inside one**; follow the end marker with `<w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:commentReference w:id="N"/></w:r>`. This is fiddly — verify the output opens in Word.
## Verify before returning
Always confirm the file reopens cleanly — a silent corruption is the most common failure:
```python from docx import Document
d = Document("out.docx") print(len(d.paragraphs), "paragraphs OK") ```
For raw-OOXML edits also run `python -c "import zipfile; zipfile.ZipFile('out.docx').testzip()"` and well-formedness-check each edited XML part with `lxml.etree.parse`.
Source provenance
Decision snapshot
38,299 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for docx, ready for a manual X post.
For source-backed research, this is a skill worth shortlisting before another blank prompt. docx: Read, create, or edit Microsoft Word .docx files — extract/summarize 38.3K stars https://www.openagentskill.com/skills/hkuds-docx?ref=x
Listing + install path for docx: https://www.openagentskill.com/skills/hkuds-docx?ref=x Install: npx skills add HKUDS/DeepTutor --skill docx
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to HKUDS but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/hkuds-docx?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/hkuds-docx?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/hkuds-docx/audit)
[](https://www.openagentskill.com/skills/hkuds-docx?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)HKUDS
@hkuds
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
mono-color
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
1.9K StarsLast30days Skill
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
61.0K StarsAcademic Research Skills
Academic Research Skills for Claude Code: research → write → review → revise → finalize
38.4K StarsGPT Researcher
Run autonomous deep research over web and local sources
28.0K StarsPermission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness