office-word-diff

office-word-diff is a skill for Claude Code, Codex from LegalQuants/lq-skills. It costs 37 tokens per session (1,039 once invoked), scanned A, original, Apache-2.0.

A tool for comparing Microsoft Word documents word by word and applying the differences as Word's native tracked changes. It keeps document structure such as lists, tables, headers, and formatting runs intact.

In plain words
What is it for?
Use it to turn generated edits into redlined DOCX files, compare document versions, or build software that transforms Word documents while preserving formatting.
Why use it?
普通 text diff tools often compare lines or paragraphs and can damage Word formatting. This makes document edits reviewable in Word without losing the original layout.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; mentions Codex; mentions Gemini CLI.

Good fit Use it to turn generated edits into redlined DOCX files, compare document versions, or build software that transforms Word documents while preserving formatting.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/legalquants/lq-skills/office-word-diff
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 LegalQuants/lq-skills --skill office-word-diff
Clone the repo
git clone --depth 1 https://github.com/LegalQuants/lq-skills

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 office-word-diff

README.md
[![agentmods](https://agentmods.dev/badge/skills/legalquants/lq-skills/office-word-diff/github.svg)](https://agentmods.dev/skills/legalquants/lq-skills/office-word-diff)
Your own site
<a href="https://agentmods.dev/skills/legalquants/lq-skills/office-word-diff"><img src="https://agentmods.dev/badge/skills/legalquants/lq-skills/office-word-diff/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 office-word-diff

Your own site · 80×15
<a href="https://agentmods.dev/skills/legalquants/lq-skills/office-word-diff"><img src="https://agentmods.dev/badge/skills/legalquants/lq-skills/office-word-diff.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,039 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 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.00037 $0.01039
Opus 5 $0.00018 $0.00519
Sonnet 5 $0.00007 $0.00208
Haiku 4.5 $0.00004 $0.00104

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

Security

Grade A, and why

office-word-diff 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 13d ago.

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.

skills/office-word-diff/SKILL.md · 95 lines

How it starts

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

office-word-diff

When to Use

  • You need to apply AI-generated edits as tracked changes in Word documents
  • You're building a legal tool that produces DOCX output with redlines
  • You need deterministic, word-level text comparison (not just line-level diff)
  • You want to preserve formatting through document transformations
  • You're integrating with Claude Code, Cursor, or other agents that produce document changes

How It Works

Core Problem

Most diff tools operate at the line or paragraph level. Word documents have structural complexity — nested lists, tables, headers, formatting runs — that line-based diffs destroy. office-word-diff solves the kernel-level problem: applying word-level tracked changes to DOCX while preserving formatting.

Architecture

  1. Parse — Read DOCX via Office.js API, extract text runs with formatting metadata
  2. Diff — Compute word-level differences between old and new text
  3. Transform — Insert Word-compatible tracked changes (insertions/deletions) preserving formatting
  4. Output — Return valid DOCX with native Word tracked changes

Usage

import { diffWords } from 'office-word-diff';

const result = await diffWords(oldDoc, newDoc, {
  trackChanges: true,
  author: 'LQClaw'
});

Key Features

  • Granular tracked changes — Word-level, not paragraph-level
  • Format preservation — Bold, italic, underlines survive transformation
  • Nested structures — Handles tables, lists, headers correctly
  • Agent-compatible — Works with Claude Code, Gemini CLI, Codex as backend
  • Deterministic — Same input produces same output (unlike fragile text-matching approaches)

Audience and Work Shape

Audience: lawyers and developers building Word add-ins or document-transformation tools that emit native tracked changes. Output is consumed by Microsoft Word and ultimately signed off by a lawyer.

Work shape: Bounded Transactional. The skill applies a defined set of word-level edits to a DOCX and emits revised DOCX. It does not decide which edits to apply.

Read the full file on GitHub · 95 lines

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. 13d ago First seen · 95 lines · 37 tokens per session scan A f3221afd07a4

Subscribe to this mod's changes

office-word-diff is a skill published in the GitHub repository LegalQuants/lq-skills (54 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 37 tokens to every session and 1,039 once invoked, about $0.0002 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.