docx

docx is a skill for Claude Code, Codex from TencentCloud/Octop. It costs 161 tokens per session (5,656 once invoked), scanned A, a copy of docx, MIT.

A document-handling skill for creating, reading, editing, and converting Microsoft Word files in .docx format. It can work with text, images, headings, page numbers, tables of contents, tracked changes, and comments.

In plain words
What is it for?
Use it to create reports, letters, templates, and other formatted Word documents, or to extract, reorganize, search, replace, edit, and review content in existing files.
Why use it?
It removes the need to handle Word files manually or understand their internal XML structure. It also provides ways to convert older .doc files and export documents as PDFs or images.

Skill for Claude CodeCodex

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

Good fit Use it to create reports, letters, templates, and other formatted Word documents, or to extract, reorganize, search, replace, edit, and review content in existing files.

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

Octop is a self-hosted, multi-user AI assistant that runs multiple specialized agents and connects them to chat interfaces, tools, and external services. It is for individuals, families, and teams who want a locally operated assistant with shared experts and persistent capabilities. Catalogue add-ons extend its agent and assistant workflows.

TencentCloud/Octop · 11,137 stars · on GitHub · octop.cloud

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 TencentCloud/Octop --skill docx
Clone the repo
git clone --depth 1 https://github.com/TencentCloud/Octop

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/tencentcloud/octop/docx/github.svg)](https://agentmods.dev/skills/tencentcloud/octop/docx)
Your own site
<a href="https://agentmods.dev/skills/tencentcloud/octop/docx"><img src="https://agentmods.dev/badge/skills/tencentcloud/octop/docx/github.svg" alt="Measured on agentmods" height="20"></a>

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

agentmods 80×15 button for docx

Your own site · 80×15
<a href="https://agentmods.dev/skills/tencentcloud/octop/docx"><img src="https://agentmods.dev/badge/skills/tencentcloud/octop/docx.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,656 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.
Origin 100% copy Near-identical to another mod 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.05656
Opus 5.5 $0.00064 $0.02262
Sonnet 5.5 $0.00032 $0.01131
Haiku 4.5 $0.00016 $0.00566

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

Security

Grade A, and why

docx scanned grade A with 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 1mo 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

This is a copy

100% identical to docx — 8 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

src/octop/infra/agents/experts/library/office-automation/skills/docx/SKILL.md · 496 lines

How it starts

The opening of the file, as written. The whole thing — 496 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_command 的 cwd 参数。

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 · 496 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. 1mo ago Changed · +8 lines db4fe7f65add
  2. 1mo 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 TencentCloud/Octop (11,137 stars, last pushed yesterday), licensed MIT. It adds 161 tokens to every session and 5,656 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to docx, differing in 8 lines, and is treated as a copy.

Related

Other skills, from other repositories

papyrus-latex-suggestions

Propose inline replacement text (old -> new) as accept/reject suggestions, LaTeX 'suggesting mode' / track changes, rendered in the PDF. Use when the author wants concrete edit proposals to accept or reject. For remarks ABOUT the text rather than replacements, use papyrus-latex-comments.

kirodotdev/KiroCrew · 69 tokens

pptagent

Create and revise editable PowerPoint presentations from a brief using HTML slide sources, rendering, and visual review. Use when the requested deliverable is a PPTX deck. The host authors the slides; text-only hosts can use an external visual reviewer.

icip-cas/PPTAgent · 52 tokens

papyrus-latex-comments

Set up and use a non-destructive COMMENT layer in a LaTeX document — margin/inline notes tagged by type next to the author's text, without rewriting it. Use when asked to comment on, review or annotate a .tex file. For accept/reject replacement text, use papyrus-latex-suggestions.

kirodotdev/KiroCrew · 70 tokens

docx

Create, read, edit, review, redline, comment on, merge, audit, render, and verify .docx Word documents, including layout-sensitive and OOXML-level work.

MemTensor/memmy-agent · 40 tokens

co-mail-and-drive

Read and send mail from the user's own Gmail or Outlook account, safely stage Gmail draft attachments, send from the agent's own address, manage Outlook contacts and the Outlook calendar, and work with Google Drive files — with co gmail, co outlook, co email, and co gdrive. Use when the user asks about their inbox, an…

openonion/connectonion · 103 tokens

pptx-maker

Generate or restyle a PowerPoint deck. Use when the user wants to create or edit a .pptx presentation, build slides from text or a URL, or design a reusable slide style.

kirodotdev/KiroCrew · 43 tokens