Agent skill

Word Document Read, Write and Convert

by OpenLoaf in OpenLoaf/OpenLoaf

Reads, edits, converts and reviews Word documents through three dedicated tools, covering tracked changes, comments, tables, images and format conversion.

AGPL-3.0Auto-check passedDocuments & Office

Install Word Document Read, Write and Convert

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/en .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.9k tokens
SKILL.md length
365 words
Files
1
Skills in repo
34
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Reads, edits, converts and reviews Word documents through three dedicated tools, covering tracked changes, comments, tables, images and format conversion.

  • Works in 4 steps: Read: Start with WordInspect(summary) → Write: JsSandbox + docx → Format Conversion with DocConvert → …
  • Summarizing or reading the structure of a Word document, including tracked changes and comments
  • SKILL.md covers Tool List, 1. Read: Start with…, 2. Write: JsSandbox + docx and 3. Format Conversion with…, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Reading goes through WordInspect, which returns a summary of page count, word count, heading count and flags for tracked changes, comments or protection, then drills into outline, text, tables, images, comments, tracked changes or raw XML. Every write, including creating a document, replacing text, inserting images, adding comments or resolving tracked changes, goes through JsSandbox, which runs Node scripts built on the docx npm package plus adm-zip. A separate DocConvert tool handles docx conversion to and from PDF, HTML, Markdown and plain text, and CloudImageUnderstand provides OCR for scanned documents.

The skill is explicit that reading a .docx with a generic file-preview tool only returns Markdown-level text and loses run and paragraph formatting, table merges, tracked changes and comments, so any analyze, summarize, edit, create or review task must go through WordInspect and JsSandbox instead. For protected documents, writes are not supported until DocConvert produces an unprotected copy. Demos shown include generating a meeting-notes document with headings and a table, and replacing `{{placeholder}}` tokens, with a note that Word can split a placeholder across multiple runs, checked via the XML view.

When your agent uses it

  • Summarizing or reading the structure of a Word document, including tracked changes and comments
  • Replacing text or inserting images into an existing .docx file
  • Converting a Word document to PDF, HTML, Markdown or plain text
  • Generating a new Word document such as a report or meeting notes from bullet points

Example prompts

  • “Summarize this Word doc and tell me if it has tracked changes.”
  • “Replace every instance of 'Company A' with 'Company B' in contract.docx.”
  • “Convert this docx to PDF and list its tables.”
  • “Generate a sales report document from these bullet points, with a table of contents.”

Requirements

  • Node.js with the docx and adm-zip packages for write operations

Workflow steps

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

  1. Read: Start with WordInspect(summary)
  2. Write: JsSandbox + docx
  3. Format Conversion with DocConvert
  4. Common Pitfalls

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

Word Document Read, Write and Convert loads about 1.9k tokens when it runs. Until then it costs about 192 tokens; SKILL.md has 365 words of instructions outside code blocks.

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

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). 365 words, ~1,902 tokens.

Download SKILL.mdSave it as .claude/skills/docx-skill/SKILL.md (or your agent's skills folder).
name
docx-skill
description
All-in-one Word document (.docx) read / write / convert / review. Trigger scenarios: summarize a docx, read paragraphs / outline / tables / images / comments / tracked changes, replace body text, insert images, change page settings, rebuild table of contents, add comments or replies, add tracked changes (insert/delete/replace), accept/reject revisions, convert docx ↔ pdf/html/md/txt. Typical phrasings: "summarize this Word doc", "change the second paragraph to XXX", "replace all 'Company A' with 'Company B'", "add a tracked change comment", "accept all revisions", "convert docx to pdf", "generate a sales report from these bullet points". Load this skill whenever the user mentions a .docx / .doc file or targets a Word document as the deliverable.

DOCX Skill

Read with WordInspect; all write / modify / create operations use JsSandbox to run Node scripts (preferred library: docx); format conversion uses DocConvert.

Tool List

ToolResponsibilityRead-only
WordInspectRead: summary / outline / text / tables / images / comments / tracked-changes / xml / renderYes
JsSandboxAll writes: create / replace-text / add-image / comment / resolve-changes… implemented with docx + adm-zipNo
DocConvertdocx ↔ pdf / html / md / txtNo
CloudImageUnderstandOCR entry point for scanned docx filesNo

Loading (two steps):

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

Read / DocPreview on a .docx returns only Markdown-level body text (losing rPr / pPr / table merges / tracked changes / comments); any "analyze / summarize / edit / create / review Word" task must go through WordInspect + JsSandbox.


1. Read: Start with WordInspect(summary)

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

Returns pageCount / wordCount / headingCount / hasTrackedChanges / hasComments / isProtected / availableStyles. Branch accordingly:

SignalNext step
isProtected: trueWrites not supported; use DocConvert to produce an unprotected copy first
hasTrackedChangesWordInspect(tracked-changes) → resolve with the script in §2.4
hasCommentsWordInspect(comments) to get the parent/reply tree
wordCount === 0 && pageCount >= 1Likely scanned; WordInspect(render) + CloudImageUnderstand

2. Write: JsSandbox + docx

Use the docx npm package (flumens/docx) to programmatically build docx OOXML. Broadest coverage for styles / tracked changes / comments.

2.1 Demo: Generate a meeting notes document
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 Product Planning — Meeting Notes', bold: true, size: 36 })],
})

const meta = new Paragraph({
  children: [new TextRun({ text: 'Date: 2026-04-20   Attendees: Alice / Bob / Carol', size: 22 })],
})

const decisions = [
  ['Alice', 'Q2 feature schedule', '2026-05-10'],
  ['Bob', 'API documentation', '2026-04-30'],
]
const tbl = new Table({
  width: { size: 100, type: WidthType.PERCENTAGE },
  rows: [
    new TableRow({
      tableHeader: true,
      children: ['Owner', 'Item', 'Due Date'].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: 'Calibri' } },
    },
  },
  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 font: set styles.default.document.run.font to 'Microsoft YaHei' / 'SimSun' / 'Noto Sans CJK SC' to avoid rendering squares in Word.

Show full SKILL.md (155 more words)Show less
2.2 Demo: Text replacement (simple find-replace)

In docx, {{placeholder}} tokens may be split across multiple w:r runs by Word. Use WordInspect(xml) to check the structure. When the placeholder lives in a single 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, 'John Smith')
zip.updateFile('word/document.xml', Buffer.from(xml, 'utf-8'))
await fs.writeFile('out.docx', zip.toBuffer())
console.log('replaced')

When runs are split, rewriting the whole new Document({...}) is more reliable.

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: 'Report body...' }),
      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: Accept all tracked changes

No direct API; use adm-zip to edit 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) Accept all w:ins (keep content, remove tags)
xml = xml.replace(/<w:ins [^>]*>([\s\S]*?)<\/w:ins>/g, '$1')
// 2) Accept all w:del (remove the deleted content)
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. Format Conversion with DocConvert

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

Backed by LibreOffice headless; layout fidelity is superior to hand-coded conversion.


4. Common Pitfalls

SymptomCauseFix
Chinese shows as squaresCJK font not setstyles.default.document.run.font = 'Microsoft YaHei'
Find-replace failsPlaceholder split across multiple runsUse WordInspect(xml) to inspect structure, or rewrite with docx
ImageRun image distortedtransformation.width/height not providedAlways pass pixel dimensions
Word reports "document repaired" on openInvalid XML / hand-edited OOXMLUse docx package to generate; don't manually edit OOXML

To patch a script: JsSandbox(action="edit-and-run", scriptPath=<previous path>, edits=[{find,replace}]) — only pass the diff.

© 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/en of OpenLoaf/OpenLoaf.

Open the folder on GitHubat commit f7eccf6

Compare with similar skills

Word Document Read, Write and Convert 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.

Word Document Read, Write and Convert compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Word Document Read, Write and Convert this skillOpenLoaf/OpenLoaf107—~1.9kAutomated safety check: PassAGPL-3.0
MarkitdownImCa0/just-laws78114 repos~3.2kAutomated safety check: NotesMIT
DOCX ToolkitXiaomiMiMo/MiMo-Code14k—~2.4kAutomated safety check: PassApache-2.0
Markitdownjimmc414/Kosmos5942 repos~1.7kAutomated safety check: PassNone
Liteparsebastani-inc/atomic846—~1.4kAutomated safety check: PassMIT
Industry Bid Document WriterGet00/BiaoShu-SKILL167—~4.6kAutomated 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 Toolkit

    XiaomiMiMo/MiMo-Code

    Produces, edits and reads Microsoft Word files through python-docx and lxml, with a decision table for picking the lightest workflow for a given task.

    14k GitHub stars~2.4k tokensUpdated 4 days ago
    Documents & OfficeAuto-check passed
  • Markitdown

    jimmc414/Kosmos

    Convert various file formats (PDF, Office documents, images, audio, web content, structured data) to Markdown optimized for LLM processing.

    594 GitHub starsUsed in 2 repos~1.7k tokens
    Documents & OfficeAuto-check passed
  • Liteparse

    bastani-inc/atomic

    A skill your agent uses whenever a task involves a document file (PDF, DOCX, PPTX, XLSX, or image) and you need to read it or pull text, tables, or specific values out of it — to answer a question…

    846 GitHub stars~1.4k tokensUpdated today
    Documents & OfficeAuto-check passed
  • Industry Bid Document Writer

    Get00/BiaoShu-SKILL

    Converts a tender document into Markdown, extracts scoring criteria and requirements, then drafts an industry-formatted technical bid as a Word file.

    167 GitHub stars~4.6k tokensUpdated 13 days ago
    Documents & OfficeAuto-check passed
  • Mineru

    Nebutra/MinerU-Skill

    An AI-Native skill for parsing PDF / Office / image files into Markdown with MinerU — a fast, zero-config document parser for AI agents.

    122 GitHub stars~504 tokensUpdated 13 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
  • 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
  • PDF Skill

    OpenLoaf/OpenLoaf

    All-in-one PDF read / write / convert / OCR. An agent skill from OpenLoaf/OpenLoaf.

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

Works with

Questions about Word Document Read, Write and Convert

What does Word Document Read, Write and Convert do?

Reads, edits, converts and reviews Word documents through three dedicated tools, covering tracked changes, comments, tables, images and format conversion. Reading goes through WordInspect, which returns a summary of page count, word count, heading count and flags for tracked changes, comments or protection, then drills into outline, text, tables, images, comments, tracked changes or raw XML. Every write, including creating a document, replacing text, inserting images, adding comments or resolving tracked changes, goes through JsSandbox, which runs Node scripts built on the docx npm package plus adm-zip.

When should I use Word Document Read, Write and Convert?

Word Document Read, Write and Convert fits situations like: summarizing or reading the structure of a Word document, including tracked changes and comments; replacing text or inserting images into an existing .docx file; converting a Word document to PDF, HTML, Markdown or plain text; generating a new Word document such as a report or meeting notes from bullet points.

How do I install Word Document Read, Write and Convert 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/en 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 Word Document Read, Write and Convert 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/en in OpenLoaf/OpenLoaf) into .agents/skills/docx-skill in your project. Codex loads it when a task matches its description.

Can I use Word Document Read, Write and Convert 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 Word Document Read, Write and Convert need to run?

SKILL.md names no scripts, command-line tools or credentials: Word Document Read, Write and Convert is instructions for the agent only. Our summary lists: Node.js with the docx and adm-zip packages for write operations.

Does Word Document Read, Write and Convert 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 Word Document Read, Write and Convert 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 Word Document Read, Write and Convert use?

Word Document Read, Write and Convert 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 Word Document Read, Write and Convert use?

About 1.9k tokens (SKILL.md is roughly 7.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 Word Document Read, Write and Convert?

Skills that share tags, products or a category with Word Document Read, Write and Convert: Markitdown (ImCa0/just-laws, 781 stars), DOCX Toolkit (XiaomiMiMo/MiMo-Code, 14k stars), Markitdown (jimmc414/Kosmos, 594 stars) and Liteparse (bastani-inc/atomic, 846 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Word Document Read, Write and Convert?

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.