redlines

redlines is a skill for Claude Code, Codex from LegalQuants/lq-skills. It costs 39 tokens per session (1,480 once invoked), scanned A, original, Apache-2.0.

A library that applies text differences to a Microsoft Word document as native tracked changes. The output is a DOCX file that Word can display with insertions and deletions.

In plain words
What is it for?
Use it to create redlined contracts and other DOCX files from modified text or diff output, including automated legal-document workflows.
Why use it?
It avoids manually editing documents or relying on plain-text diffs that do not produce reviewable Word revisions. It is deterministic and retains document formatting such as headers, lists, and tables.

Skill for Claude CodeCodex

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

Good fit Use it to create redlined contracts and other DOCX files from modified text or diff output, including automated legal-document workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/legalquants/lq-skills/redlines
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 redlines
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 redlines

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/legalquants/lq-skills/redlines"><img src="https://agentmods.dev/badge/skills/legalquants/lq-skills/redlines.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,480 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.00039 $0.01480
Opus 5 $0.00019 $0.00740
Sonnet 5 $0.00008 $0.00296
Haiku 4.5 $0.00004 $0.00148

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

Security

Grade A, and why

redlines 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 12d 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/redlines/SKILL.md · 106 lines

How it starts

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

redlines — Word Document Redlining Library

When to Use

  • Converting AI-generated edits into Word tracked changes
  • Applying diff output to DOCX files with native revision markup
  • Building legal tools that produce redlined documents
  • Automated document comparison with Word-compatible output
  • "Draft by exception" workflows where you track exceptions to standard clauses

How It Works

Takes diff output (from any source) and applies it to a DOCX as native Word tracked changes. Built by a practising Singapore counsel who needed deterministic document transformation.

Input

  • Original DOCX
  • Modified text or diff output

Output

DOCX with Word native tracked changes (insertions in blue, deletions in strikethrough)

Usage

import { applyRedlines } from '@houfu/redlines';

const result = applyRedlines({
  originalDoc: './contract.docx',
  modifiedText: 'modified contract text here',
  author: 'LQClaw'
});

result.toDocx('./contract-redlined.docx');

Key Design Decisions

  • Deterministic — Same input produces identical output
  • Format preservation — Headers, lists, tables survive transformation
  • Standard-compliant — Output is valid DOCX that Word renders correctly
  • No round-trip through Word — Works headlessly, no Office install required

Audience and Work Shape

Audience: legal engineers and counsel comfortable invoking a JavaScript library from a workflow. Not a self-service tool for a reviewing partner and not intended for non-technical users. The judgment as to which edits to apply sits upstream of this skill; this skill only carries them into the DOCX.

Work shape: Bounded Transactional primitive. Text-in (or diff-in) → DOCX-out. The transform is mechanical. It is not a redline reviewer, not a redline generator, and not a substantive review step.

This skill provides legal support, not legal advice. Producing a tracked-changes DOCX is mechanical document processing; the redlined output is a draft, not a vetted lawyer redline and not signed-off work product. A successful run means "the supplied edits were carried into the file as Word revisions" — not "these edits are correct" and not "this draft is fit to send."

Read the full file on GitHub · 106 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. 12d ago First seen · 106 lines · 39 tokens per session scan A e2ce283dd730

Subscribe to this mod's changes

redlines is a skill published in the GitHub repository LegalQuants/lq-skills (54 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 39 tokens to every session and 1,480 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.