Superdoc redlines

From LegalQuants/lq-skills · View interactive version

Superdoc redlines is an AI agent skill from the GitHub repository LegalQuants/lq-skills. Use when you need to apply tracked changes and comments to DOCX files programmatically, merge multi-agent edits with conflict resolution, or produce native Word revisions from AI agent output.

How to use this skill

Skill file

superdoc-redlines — Multi-Agent DOCX Redlining

When to Use

How It Works

Core Innovation

Uses stable block IDs instead of fragile text matching. Unlike approaches that try to find text by content (and fail when formatting changes), Superdoc assigns stable IDs to document blocks and applies changes by reference.

Architecture

AI Agent output → Conflict resolution → Block ID mapping → Native Word revisions

Process

  1. Parse — Extract document blocks with stable IDs
  2. Receive edits — AI agent produces change instructions
  3. Conflict resolution — If multiple agents edit same block, resolve conflicts
  4. Apply — Insert Word tracked changes using block IDs (not text matching)
  5. Output — Native DOCX with Word revision marks

Usage

import { applyRedlines } from 'superdoc-redlines';

const result = await applyRedlines({
  input: './contract.docx',
  edits: agentEdits,
  agentName: 'Claude'
});

Key Features

Audience and Work Shape

Audience: lawyers and developers running multi-agent DOCX workflows where several AI agents propose edits to the same document. The lawyer is the merger of last resort.

Work shape: Bounded Transactional with conflict-resolution overlay. The skill merges defined edits by stable block ID. Conflicts are surfaced, not silently resolved.

Scope and Legal Use

This skill provides legal support, not legal advice. The merged DOCX is an AI-assembled draft with native Word tracked changes — not a reviewed, accepted, or approved version.

Privilege and confidentiality. Runs headlessly with no required network calls. The agentName field is persisted in Word's revision XML — the AI origin of each edit is visible in the document's audit trail. Do not mask agentName as a human reviewer; that misrepresentation can affect privilege and disclosure analysis later.

Accountability. A qualified lawyer must review every tracked change in the merged output before accepting, sending, filing, or relying on it. The lawyer decides what each agent's edit is worth; the conflict-resolution engine only ensures merges are deterministic, not correct.

Input Requirements

Confidence Bands

Out of Scope

Escalation

Stop and route to the responsible lawyer when:

Limitations

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.