Agent skill

DOCX Skill

by OpenLoaf in OpenLoaf/OpenLoaf

Word 文档(.docx)读/写/转/评审一体化。触发场景:总结 docx、读段落/大纲/表格/图片/评论/修订、替换正文、插入图片、改页面设置、重建目录、加评论或回复、加修订(insert/delete/replace)、接受/驳回修订、docx ↔ pdf/html/md/txt 互转。典型说法:"帮我总结这份 Word"、"第二段改成 XXX"、"把全部'A 公司'换成'B…

AGPL-3.0Auto-check passedDocuments & Office

Install DOCX Skill

skills CLI
$ npx skills add OpenLoaf/OpenLoaf --skill docx-skill -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install OpenLoaf/OpenLoaf docx-skill --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/OpenLoaf/OpenLoaf.git skills-src && mkdir -p .claude/skills && cp -r skills-src/apps/server/src/ai/builtin-skills/docx .claude/skills/docx-skill && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
docx-skill
GitHub stars
107
Token cost
~1.5k tokens
SKILL.md length
214 words
Files
1
Skills in repo
34
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Word 文档(.docx)读/写/转/评审一体化。触发场景:总结 docx、读段落/大纲/表格/图片/评论/修订、替换正文、插入图片、改页面设置、重建目录、加评论或回复、加修订(insert/delete/replace)、接受/驳回修订、docx ↔ pdf/html/md/txt 互转。典型说法:"帮我总结这份 Word"、"第二段改成 XXX"、"把全部'A 公司'换成'B…

  • Works in 4 steps: 读:WordInspect(summary) 先行 → 写:JsSandbox + docx → 格式互转用 DocConvert → …
  • Tasks that involve Word documents
  • SKILL.md covers 工具清单, 1. 读:WordInspect(summary) 先行, 2. 写:JsSandbox + docx and 3. 格式互转用 DocConvert, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

DOCX Skill is an agent skill from OpenLoaf/OpenLoaf. Word 文档(.docx)读/写/转/评审一体化。触发场景:总结 docx、读段落/大纲/表格/图片/评论/修订、替换正文、插入图片、改页面设置、重建目录、加评论或回复、加修订(insert/delete/replace)、接受/驳回修订、docx ↔ pdf/html/md/txt 互转。典型说法:"帮我总结这份 Word"、"第二段改成 XXX"、"把全部'A 公司'换成'B 公司'"、"加一条修订批注"、"接受所有修订"、"docx 转 pdf"、"从这些要点生成销售报告"。用户提到 .docx / .doc 文件或以 Word 文档为产出目标都加载本技能。

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Documents & Office, covering Word documents. It works with Microsoft Word. The repository describes itself as: 🍞Open-source, local-first AI workspace with Agents, multi-model chat (GPT/Claude/Gemini/DeepSeek), Notion-like docs, AI image & video generation, email, calendar & terminal…. The licence is AGPL-3.0.

When your agent uses it

  • Tasks that involve Word documents

Example prompts

  • “帮我总结这份 Word”
  • “第二段改成 XXX”
  • “加一条修订批注”
  • “/docx-skill”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. 读:WordInspect(summary) 先行
  2. 写:JsSandbox + docx
  3. 格式互转用 DocConvert
  4. 常见陷阱

What it can do on your machine

Read from SKILL.md and the folder at commit f7eccf6. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docx.js.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

DOCX Skill loads about 1.5k tokens when it runs. Until then it costs about 74 tokens; SKILL.md has 214 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~74
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from OpenLoaf/OpenLoaf at commit f7eccf6, republished under its AGPL-3.0 licence (© OpenLoaf). 214 words, ~1,491 tokens.

Download SKILL.mdSave it as .claude/skills/docx-skill/SKILL.md (or your agent's skills folder).
name
docx-skill
description
Word 文档(.docx)读/写/转/评审一体化。触发场景:总结 docx、读段落/大纲/表格/图片/评论/修订、替换正文、插入图片、改页面设置、重建目录、加评论或回复、加修订(insert/delete/replace)、接受/驳回修订、docx ↔ pdf/html/md/txt 互转。典型说法:"帮我总结这份 Word"、"第二段改成 XXX"、"把全部'A 公司'换成'B 公司'"、"加一条修订批注"、"接受所有修订"、"docx 转 pdf"、"从这些要点生成销售报告"。用户提到 .docx / .doc 文件或以 Word 文档为产出目标都加载本技能。

DOCX 技能

读用 WordInspect;写 / 改 / 创建用 JsSandbox 跑 Node 脚本(库首选 docx);格式互转用 DocConvert。

工具清单

工具做什么只读
WordInspect读:summary / outline / text / tables / images / comments / tracked-changes / xml / render是
JsSandbox所有写:create / replace-text / add-image / comment / resolve-changes …… 用 docx 库 + adm-zip 代码实现否
DocConvertdocx ↔ pdf / html / md / txt否
CloudImageUnderstand扫描件 docx 的 OCR 入口否

加载(两步):

  1. LoadSkill docx-skill
  2. ToolSearch(query: "select:WordInspect,JsSandbox,DocConvert")

Read / DocPreview 对 .docx 只返回 Markdown 级正文(丢 rPr / pPr / 表格合并 / 修订 / 评论);任何"分析/总结/改/建/评审 Word"都走 WordInspect + JsSandbox。


1. 读:WordInspect(summary) 先行

WordInspect { action: "summary", filePath: "…" }

返回 pageCount / wordCount / headingCount / hasTrackedChanges / hasComments / isProtected / availableStyles,按分派:

特征下一步
isProtected: true写操作不支持,先 DocConvert 生成未保护副本
hasTrackedChangesWordInspect(tracked-changes) → 用下面 2.4 的脚本 resolve
hasCommentsWordInspect(comments) 拿 parent/reply 树
wordCount === 0 && pageCount >= 1可能扫描件,WordInspect(render) + CloudImageUnderstand

2. 写:JsSandbox + docx

用 docx npm 包(flumens/docx),编程式构建 docx OOXML。对样式 / 修订 / 评论覆盖最全。

2.1 Demo:生成中文会议纪要
js
import {
  Document, Packer, Paragraph, TextRun, HeadingLevel, Table, TableRow, TableCell,
  WidthType, AlignmentType, PageOrientation,
} from 'docx'
import fs from 'node:fs/promises'

const title = new Paragraph({
  heading: HeadingLevel.HEADING_1,
  alignment: AlignmentType.CENTER,
  children: [new TextRun({ text: 'Q2 产品规划讨论 — 会议纪要', bold: true, size: 36 })],
})

const meta = new Paragraph({
  children: [new TextRun({ text: '日期:2026-04-20   参会:张三 / 李四 / 王五', size: 22 })],
})

const decisions = [
  ['张三', 'Q2 功能排期', '2026-05-10'],
  ['李四', 'API 文档', '2026-04-30'],
]
const tbl = new Table({
  width: { size: 100, type: WidthType.PERCENTAGE },
  rows: [
    new TableRow({
      tableHeader: true,
      children: ['负责人', '事项', '截止日'].map(
        t => new TableCell({
          children: [new Paragraph({ children: [new TextRun({ text: t, bold: true })] })],
        }),
      ),
    }),
    ...decisions.map(row => new TableRow({
      children: row.map(v => new TableCell({ children: [new Paragraph(v)] })),
    })),
  ],
})

const doc = new Document({
  creator: 'OpenLoaf',
  styles: {
    default: {
      document: { run: { font: 'Microsoft YaHei' } }, // CJK 必设
    },
  },
  sections: [{
    properties: { page: { orientation: PageOrientation.PORTRAIT } },
    children: [title, meta, new Paragraph({ text: '' }), tbl],
  }],
})

await fs.writeFile('meeting_notes.docx', await Packer.toBuffer(doc))
console.log('meeting_notes.docx written')

CJK 字体:必设 styles.default.document.run.font = 'Microsoft YaHei' / 'SimSun' / 'Noto Sans CJK SC',否则 Word 里可能显示 □。

2.2 Demo:替换文字(simple find-replace)

docx 里 {{placeholder}} 可能被 Word 切到多个 w:r run;先用 WordInspect(xml) 看结构。若占位符在单个 run 里:

js
import AdmZip from 'adm-zip'
import fs from 'node:fs/promises'

const zip = new AdmZip(await fs.readFile('in.docx'))
let xml = zip.readAsText('word/document.xml')
xml = xml
  .replace(/\{\{date\}\}/g, '2026-04-20')
  .replace(/\{\{name\}\}/g, '张三')
zip.updateFile('word/document.xml', Buffer.from(xml, 'utf-8'))
await fs.writeFile('out.docx', zip.toBuffer())
console.log('replaced')

多 run 切分时,一次性 new Document({...}) 重写更可靠。

js
import {
  Document, Packer, Paragraph, ImageRun, Header, AlignmentType,
} from 'docx'
import fs from 'node:fs/promises'

const logo = await fs.readFile('logo.png')

const doc = new Document({
  sections: [{
    headers: {
      default: new Header({
        children: [new Paragraph({
          alignment: AlignmentType.RIGHT,
          children: [new ImageRun({
            data: logo,
            transformation: { width: 80, height: 24 },
          })],
        })],
      }),
    },
    children: [
      new Paragraph({ text: '报告正文...' }),
      new Paragraph({
        children: [new ImageRun({
          data: await fs.readFile('chart.png'),
          transformation: { width: 500, height: 300 },
        })],
      }),
    ],
  }],
})
await fs.writeFile('report.docx', await Packer.toBuffer(doc))
2.4 Demo:接受所有 tracked changes

没有直接 API,用 adm-zip 改 document.xml:

js
import AdmZip from 'adm-zip'
import fs from 'node:fs/promises'

const zip = new AdmZip(await fs.readFile('in.docx'))
let xml = zip.readAsText('word/document.xml')
// 1) 接受所有 w:ins(保留内容,去掉标签)
xml = xml.replace(/<w:ins [^>]*>([\s\S]*?)<\/w:ins>/g, '$1')
// 2) 接受所有 w:del(删掉被删除的内容)
xml = xml.replace(/<w:del [^>]*>[\s\S]*?<\/w:del>/g, '')
zip.updateFile('word/document.xml', Buffer.from(xml, 'utf-8'))
await fs.writeFile('out.docx', zip.toBuffer())
console.log('tracked changes accepted')

3. 格式互转用 DocConvert

DocConvert(from="docx", to="pdf",  sourcePath="…")
DocConvert(from="docx", to="md",   sourcePath="…")
DocConvert(from="docx", to="html", sourcePath="…")

底层 LibreOffice headless,排版保真度优于手搓。


4. 常见陷阱

症状原因处理
中文变方块未设 CJK 字体styles.default.document.run.font = 'Microsoft YaHei'
find-replace 失效占位符切到多个 runWordInspect(xml) 看结构,或 docx 重写
ImageRun 图片变形未给 transformation.width/height必传像素尺寸
docx 打开提示"修复文档"XML 不合法 / 手搓 XML用 docx 包生成别手改 OOXML

修脚本:JsSandbox(action="edit-and-run", scriptPath=<上次返回的>, edits=[{find,replace}]) 只传改动点。

© OpenLoaf, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in apps/server/src/ai/builtin-skills/docx of OpenLoaf/OpenLoaf.

Open the folder on GitHubat commit f7eccf6

Compare with similar skills

DOCX Skill next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

DOCX Skill compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
DOCX Skill this skillOpenLoaf/OpenLoaf107—~1.5kAutomated safety check: PassAGPL-3.0
MarkitdownImCa0/just-laws78114 repos~3.2kAutomated safety check: NotesMIT
DOCXrvdbreemen/OTGW-firmware20733 repos~4.3kAutomated safety check: PassProprietary
Gzh Designisjiamu/gzh-design-skill3.9k1 repos~2.2kAutomated safety check: PassAGPL-3.0
Word Document Reader and WriterHKUDS/DeepTutor41k—~2.5kAutomated safety check: PassApache-2.0
GenOffice Document CLIgenspark-ai/genoffice8.8k—~19kAutomated safety check: PassApache-2.0

Similar skills

  • Markitdown

    ImCa0/just-laws

    Convert files and office documents to Markdown. An agent skill from ImCa0/just-laws.

    781 GitHub starsUsed in 14 repos~3.2k tokens
    Documents & OfficeAuto-check: notes
  • DOCX

    rvdbreemen/OTGW-firmware

    A skill your agent uses whenever the user wants to create, read, edit, or manipulate Word documents (.docx files).

    207 GitHub starsUsed in 33 repos~4.3k tokens
    Documents & OfficeAuto-check passed
  • Gzh Design

    isjiamu/gzh-design-skill

    微信公众号文章排版引擎,将 Markdown 转换为可直接粘贴到公众号编辑器的 HTML。主题风格从 references/theme-index.md 注册的自定义主题库中选取,自动章节编号、关键词下划线标记、引言卡片、目录导航、代码块、图片/GIF、作者签名。支持 Markdown / Word(.docx) / PDF / 纯文本输入(非 Markdown…

    3.9k GitHub starsUsed in 1 repo~2.2k tokens
    Documents & OfficeAuto-check passed
  • Reads, creates and edits Word .docx files with python-docx, and drops to raw OOXML for tracked changes, comments and byte-exact edits.

    41k GitHub stars~2.5k tokensUpdated 3 days ago
    Documents & OfficeAuto-check passed
  • GenOffice Document CLI

    genspark-ai/genoffice

    Creates, converts, reads and edits real pptx, xlsx, docx and PDF files locally through the genoffice command line.

    8.8k GitHub stars~19k tokensUpdated today
    Documents & OfficeAuto-check passed
  • BiSheng DOCX Builder

    dataelement/bisheng

    Builds or edits Word .docx documents inside BiSheng's code executor with python-docx, handling Chinese fonts, tables of contents, page numbers and official-document layout.

    12k GitHub stars~2.6k tokensUpdated 6 days ago
    Documents & OfficeAuto-check passed

More from OpenLoaf/OpenLoaf

All 34 skills in this repo
  • Agent Orchestration Skill

    OpenLoaf/OpenLoaf

    Triggers when the master Agent faces a multi-step complex task and is deciding whether / how to outsource sub-tasks to built-in subagents (browser / doc-editor / data-analyst / extractor /…

    107 GitHub stars~1.9k tokensUpdated 4 mo ago
    Auto-check passed
  • Browser Ops Skill

    OpenLoaf/OpenLoaf

    Triggered when the user asks for page-level interaction with a specific webpage: login, form filling, button clicks, pagination scraping, screenshots, downloading page images, handling CAPTCHAs or…

    107 GitHub stars~1.5k tokensUpdated 4 mo ago
    Auto-check passed
  • Canvas Ops Skill

    OpenLoaf/OpenLoaf

    Triggered when the user wants lifecycle management of OpenLoaf canvases / whiteboards: create, open, filter, duplicate, delete, rename, or change ownership.

    107 GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Reads, edits, converts and reviews Word documents through three dedicated tools, covering tracked changes, comments, tables, images and format conversion.

    107 GitHub stars~1.9k tokensUpdated 4 mo ago
    Auto-check passed
  • Email Operations

    OpenLoaf/OpenLoaf

    Handles a real email account through query and mutate tools: check the inbox, read, search, reply, forward, compose and organize, with sending always confirmed first.

    107 GitHub stars~1.8k tokensUpdated 4 mo ago
    Auto-check passed
  • macOS Desktop Control

    OpenLoaf/OpenLoaf

    Guides an agent to operate native macOS apps by surveying an app first, acting through intents, menus or keystrokes, and verifying each step, in OpenLoaf Desktop only.

    107 GitHub stars~2.4k tokensUpdated 4 mo ago
    Auto-check passed

Works with

Questions about DOCX Skill

What does DOCX Skill do?

Word 文档(.docx)读/写/转/评审一体化。触发场景:总结 docx、读段落/大纲/表格/图片/评论/修订、替换正文、插入图片、改页面设置、重建目录、加评论或回复、加修订(insert/delete/replace)、接受/驳回修订、docx ↔ pdf/html/md/txt 互转。典型说法:"帮我总结这份 Word"、"第二段改成 XXX"、"把全部'A 公司'换成'B…. DOCX Skill is an agent skill from OpenLoaf/OpenLoaf.

When should I use DOCX Skill?

DOCX Skill fits situations like: tasks that involve Word documents.

How do I install DOCX Skill in Claude Code?

Run `npx skills add OpenLoaf/OpenLoaf --skill docx-skill -a claude-code`. Or copy the skill folder (apps/server/src/ai/builtin-skills/docx in OpenLoaf/OpenLoaf) into .claude/skills/docx-skill in your project. Claude Code loads it when a task matches its description.

How do I install DOCX Skill in Codex?

Run `npx skills add OpenLoaf/OpenLoaf --skill docx-skill -a codex`. Or copy the skill folder (apps/server/src/ai/builtin-skills/docx in OpenLoaf/OpenLoaf) into .agents/skills/docx-skill in your project. Codex loads it when a task matches its description.

Can I use DOCX Skill in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add OpenLoaf/OpenLoaf --skill docx-skill -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/docx-skill, .gemini/skills/docx-skill, .github/skills/docx-skill and .opencode/skills/docx-skill in your project.

What does DOCX Skill need to run?

SKILL.md names no scripts, command-line tools or credentials: DOCX Skill is instructions for the agent only.

Does DOCX Skill access the network?

SKILL.md names 1 domain. As links in the text: docx.js.org. This is read from the text; nothing was executed.

Is DOCX Skill safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does DOCX Skill use?

DOCX Skill is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does DOCX Skill use?

About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to DOCX Skill?

Skills that share tags, products or a category with DOCX Skill: Markitdown (ImCa0/just-laws, 781 stars), DOCX (rvdbreemen/OTGW-firmware, 207 stars), Gzh Design (isjiamu/gzh-design-skill, 3.9k stars) and Word Document Reader and Writer (HKUDS/DeepTutor, 41k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains DOCX Skill?

OpenLoaf (a GitHub organization) maintains it in OpenLoaf/OpenLoaf, which has 107 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on May 14, 2026.

Source: OpenLoaf/OpenLoaf on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.