agentleFS
LegalQuantsLegalQuants/lq-skills/skills/superdoc-redlines/SKILL.md

superdoc-redlines

Skill63 starsChanged 6 months agoApache-2.0View on GitHub

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.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Not for executed contracts or engrossed final versions.

    line 89
  2. Distinctive:

    Not for documents under litigation hold.

    line 90
  3. Distinctive:

    Not for structurally invalid DOCX or rights-managed documents.

    line 91
  4. Distinctive:

    Not a sign-off mechanism — Word's revision marks indicate AI authorship, not human review status.

    line 92
  5. Distinctive:

    Stop and route to the responsible lawyer when:

    line 96

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

superdoc-redlines — Multi-Agent DOCX Redlining

When to Use

  • Multi-agent legal workflows where different agents produce edits to the same document
  • Applying AI-generated tracked changes to DOCX files
  • Merging edits from multiple reviewers with conflict resolution
  • Headless document transformation (no Word installation required)
  • Deterministic document edits with stable block IDs

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

  • Multi-agent merging — Multiple agents can edit; conflicts are flagged
  • Conflict resolution — Human review for overlapping edits
  • Deterministic — Same edits → same output (unlike text-matching approaches)
  • Native Word revisions — Output is valid DOCX, not a proprietary format
  • Works headlessly — No Word installation needed

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

  • DOCX must have stable block structure (no rights-management, no DRM).
  • edits input must conform to the documented schema (per-agent, per-block).
  • Halt on malformed agent output; do not silently best-effort merge.

Confidence Bands

  • High — non-overlapping edits from a single agent, each scoped to one block.
  • Medium — non-overlapping edits from multiple agents.
  • Low / Conflict — overlapping edits on the same block from different agents, or contradictory edits from a single agent. Surface to lawyer; do not auto-resolve.

Out of Scope

  • Not for executed contracts or engrossed final versions.
  • Not for documents under litigation hold.
  • Not for structurally invalid DOCX or rights-managed documents.
  • Not a sign-off mechanism — Word's revision marks indicate AI authorship, not human review status.

Escalation

Stop and route to the responsible lawyer when:

  • two or more agents edit the same block in incompatible ways;
  • an agent emits malformed edit instructions (schema violation);
  • the merge would silently overwrite an existing tracked change from a named human reviewer;
  • the document state is ambiguous (e.g., partial tracked changes already present from a prior round).

Limitations

  • Complex nested tables may need manual review
  • Requires well-structured input from AI agents
  • Conflict resolution UI is basic

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.