docx

docx is a skill for Claude Code, Codex from agentscope-ai/QwenPaw. It costs 161 tokens per session (5,587 once invoked), scanned A, original, Apache-2.0.

A guide for working with Microsoft Word documents in the .docx format. It covers reading, creating, editing, converting, exporting, and handling tracked changes.

In plain words
What is it for?
Extracting document text, creating formatted Word files, editing existing documents, converting older .doc files, exporting pages to PDF or images, and accepting revisions.
Why use it?
It explains how to process Word files when their contents are stored in a structured document format rather than as plain text. It also identifies the external tools needed for some operations.

Skill for Claude CodeCodex

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

Good fit Extracting document text, creating formatted Word files, editing existing documents, converting older .doc files, exporting pages to PDF or images, and accepting revisions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/agentscope-ai/qwenpaw/docx-zh
About the project

QwenPaw is a personal AI assistant that runs on a local machine or in the cloud and connects to multiple chat applications. It provides memory, file workspaces, multiple agents, skills, plugins, and integrations with language-model providers and external tools. The catalogue entries are skills that extend its capabilities.

agentscope-ai/QwenPaw · 34,741 stars · on GitHub · qwenpaw.agentscope.io

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 agentscope-ai/QwenPaw --skill docx-zh
Clone the repo
git clone --depth 1 https://github.com/agentscope-ai/QwenPaw

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/agentscope-ai/qwenpaw/docx-zh/github.svg)](https://agentmods.dev/skills/agentscope-ai/qwenpaw/docx-zh)
Your own site
<a href="https://agentmods.dev/skills/agentscope-ai/qwenpaw/docx-zh"><img src="https://agentmods.dev/badge/skills/agentscope-ai/qwenpaw/docx-zh/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/agentscope-ai/qwenpaw/docx-zh"><img src="https://agentmods.dev/badge/skills/agentscope-ai/qwenpaw/docx-zh.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 161 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,587 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. ✓ AI security review Fable 5.1 · 6 Sept 2026 📄 Read the review Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Prompt Injection · line 324
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
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.00161 $0.05587
Opus 5 $0.00081 $0.02794
Sonnet 5 $0.00032 $0.01117
Haiku 4.5 $0.00016 $0.00559

Measured 11d ago against content hash c43419c2af05, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

docx scanned grade A with 0 findings 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 11d ago.

The scan reads SKILL.md. This mod also ships 15 executable files (scripts/__init__.py, scripts/accept_changes.py, scripts/comment.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • docx — 100% identical, 8 lines differ
src/qwenpaw/agents/skills/docx-zh/SKILL.md · 488 lines

How it starts

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

重要: 所有 scripts/ 路径均相对于本技能目录。 运行方式: cd {this_skill_dir} && python scripts/... 或使用 execute_shell_commandcwd 参数。

DOCX 创建、编辑与分析

前置依赖

  • docx (npm install -g docx): 新文档创建
  • LibreOffice (soffice): .doc -> .docx 转换、修订接受和 PDF 导出
  • pandoc: 文本提取
  • pdftoppm (poppler-utils): 文档转图片工作流
  • 如果 pdftoppm 不可用,Python 备用路径可能使用 pdf2image
  • 在 Windows 上,依赖项必须已安装并在 PATH 中可用;如缺失,请报告依赖问题并停止(不要反复重试)。

概述

.docx 文件是包含 XML 文件的 ZIP 压缩包。

快速参考

任务 方法
读取/分析内容 pandoc 或解压获取原始 XML
创建新文档 使用 docx-js - 参见下方"创建新文档"
编辑现有文档 解压 → 编辑 XML → 重新打包 - 参见下方"编辑现有文档"

将 .doc 转换为 .docx

旧版 .doc 文件必须先转换才能编辑:

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

读取内容

# 提取包含修订的文本
pandoc --track-changes=all document.docx -o output.md

# 访问原始 XML
python scripts/office/unpack.py document.docx unpacked/

转换为图片

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

接受修订

生成接受所有修订后的干净文档(需要 LibreOffice):

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

创建新文档

使用 JavaScript 生成 .docx 文件,然后进行验证。安装: npm install -g docx

初始设置

const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, ImageRun,
        Header, Footer, AlignmentType, PageOrientation, LevelFormat, ExternalHyperlink,
        TableOfContents, HeadingLevel, BorderStyle, WidthType, ShadingType,
        VerticalAlign, PageNumber, PageBreak } = require('docx');

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

验证

创建文件后进行验证。如果验证失败,解压、修复 XML 并重新打包。

python scripts/office/validate.py doc.docx

页面尺寸

// 关键: docx-js 默认为 A4,而非 US Letter
// 始终显式设置页面尺寸以获得一致的结果
sections: [{
  properties: {
    page: {
      size: {
        width: 12240,   // 8.5 英寸(DXA 单位)
        height: 15840   // 11 英寸(DXA 单位)
      },
      margin: { top: 1440, right: 1440, bottom: 1440, left: 1440 } // 1 英寸边距
    }
  },
  children: [/* content */]
}]

Read the full file on GitHub · 488 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 11d ago First seen · 488 lines · 161 tokens per session scan A c43419c2af05

Subscribe to this mod's changes

docx is a skill published in the GitHub repository agentscope-ai/QwenPaw (34,741 stars, last pushed yesterday), licensed Apache-2.0. It adds 161 tokens to every session and 5,587 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. 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

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

officecli-docx

Use this skill any time a .docx file is involved -- as input, output, or both. This includes: creating Word documents, reports, letters, memos, or proposals; reading, parsing, or extracting text from any .docx file; editing, modifying, or updating existing documents; working with templates, tracked changes, comments…

iOfficeAI/OfficeCLI · 114 tokens

officecli-financial-model

Use this skill when the user wants to build a financial model — 3-statement model, DCF valuation, LBO, SaaS unit economics, sensitivity / scenario analysis, debt schedule, or fundraising projections — in Excel. Trigger on: 'financial model', '3-statement model', 'P&L + BS + CF', 'DCF', 'WACC', 'NPV', 'terminal value'…

iOfficeAI/OfficeCLI · 222 tokens

officecli-pptx

Use this skill any time a .pptx file is involved -- as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx file; editing, modifying, or updating existing presentations; combining or splitting slide files; working with…

iOfficeAI/OfficeCLI · 106 tokens

officecli-word-form

Use this skill to create fillable Word forms (.docx) with real Content Controls (SDT) + legacy FormField checkboxes + MERGEFIELD mail-merge placeholders + document protection. Trigger on: 'fillable form', 'form fields', 'content controls', 'SDT', 'word form', 'fill in', 'only editable fields', 'protect document'…

iOfficeAI/OfficeCLI · 224 tokens