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.
AI Agent output → Conflict resolution → Block ID mapping → Native Word revisions
import { applyRedlines } from 'superdoc-redlines';
const result = await applyRedlines({
input: './contract.docx',
edits: agentEdits,
agentName: 'Claude'
});
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.
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.
edits input must conform to the documented schema (per-agent, per-block).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).