OfficeCLI DOCX

Creates, reads and edits Word documents with real headings, tables, page numbers and tables of contents, then checks every page before handing over.

Office & Documentsworddocxdocumentsreportsby iOfficeAI33kGitHub

What it is

This skill teaches an AI agent to handle Word (.docx) files properly, whether you need a new report, letter, memo or proposal, want the text pulled out of a document, or need changes made to one you already have. It works through OfficeCLI, a free open-source command-line tool that reads and writes Office files directly, so Microsoft Word does not need to be installed for the agent to build the file.

Rather than producing a wall of plain paragraphs, the skill sets a quality bar: a real heading hierarchy, explicit heading and body sizes, one body font and one accent colour, spacing set through paragraph settings instead of blank lines, curly quotes, and live page-number fields in footers. It includes tested recipes for rich cover pages, Page X of Y footers, styled table header rows, financial tables with right-aligned numbers, and templates whose internal notes are removed before sending. It also covers tracked changes, comments, footnotes, equations, watermarks, native charts and mail-merge fields.

Before declaring the job done, the agent runs a review cycle: an issues scan, an outline check, a read-through for leftover placeholders, a file validation and, when it can view images, a contact sheet showing every page. One honest limit: OfficeCLI cannot calculate page numbers itself, so the table of contents and page fields are set to refresh when you open the file in Word.

What it can do

  • Creates reports, letters, memos and proposals with a proper title and heading hierarchy, consistent fonts and controlled spacing.
  • Reads existing .docx files as an outline, plain text or annotated view, and extracts their content.
  • Edits existing documents while matching their current look, including headers, footers, tables and styles.
  • Adds tables of contents, live page numbers, footnotes, LaTeX equations, native charts, images with alt text and watermarks.
  • Handles tracked changes and comments: adds them, threads replies, marks them resolved, or accepts and rejects changes in bulk.
  • Builds mail-merge templates with real merge fields and strips internal template notes before delivery.
  • Runs a quality check for placeholders, empty paragraphs, missing alt text, heading jumps and page-by-page layout.

When to use it

  • You need a 12-page client report with a cover page, table of contents and page numbers by tomorrow morning.
  • A colleague sent a contract full of tracked changes and you want all of one reviewer's edits accepted and the open comments listed.
  • You have quarterly figures in rough notes and want a clean Word memo with a styled data table.
  • HR needs an offer-letter template with merge fields for name and salary, without internal instructions leaking into the sent version.
  • You want the headings and text pulled out of a long .docx so you can review its structure.

How it works

  1. 1Checks that OfficeCLI is installed and installs it with a one-line command if needed.
  2. 2For an existing file, reads its outline first to see headings, sections, tables, tracked changes and watermarks before changing anything.
  3. 3Builds the document in order: styles and numbering, page setup, headings and body text, then tables, images, fields and the table of contents, then headers and footers.
  4. 4Applies the formatting rules for heading sizes, spacing, fonts and footers, reading back each structural change before adding more.
  5. 5Runs the quality cycle (issue scan, outline, text review, validation and a page screenshot where possible), fixes what it finds and repeats until clean.

Try asking

“Write a 5-page project proposal as a Word document with a cover page, table of contents and page numbers.”
“Open contract.docx, accept all tracked changes from Alice, and list the comments that are still open.”
“Turn these meeting notes into a formatted memo in .docx.”
“Extract all the headings and text from report.docx so I can review the structure.”

How to install

Install with the skills CLI (recommended)

Works with Claude Code, Codex, Cursor, OpenCode and other agents, and asks which ones to install to. Needs Node.js 22.20+. Add -g to make it available in every project.

npm
npx skills add https://github.com/iOfficeAI/OfficeCLI/tree/main/skills/officecli-docx
pnpm
pnpm dlx skills add https://github.com/iOfficeAI/OfficeCLI/tree/main/skills/officecli-docx

Install manually

Copies the skill folder into Claude Code's personal skills directory. For claude.ai, zip the officecli-docx folder and upload it in the Skills section of Settings.

Terminal
git clone --depth 1 https://github.com/iOfficeAI/OfficeCLI.git
mkdir -p ~/.claude/skills
cp -r OfficeCLI/skills/officecli-docx ~/.claude/skills/officecli-docx

Then just ask in plain language, for example: “Write a 5-page project proposal as a Word document with a cover page, table of contents and page numbers.”