edit-doc
Edit an existing DOCX by appending, replacing, styling, or previewing changes while preserving original formatting, headers, footers, and images.
Instructions
Edit an existing DOCX. Actions: 'append' (XML-patches new content, PRESERVES original formatting/headers/footers/images), 'replace' (overwrites body but keeps section properties), 'style' (apply a stylePreset to existing paragraphs without changing text), 'preview' (show what would change). Always read-doc with mode 'indepth' first so you understand the existing structure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Tags for registry search and discovery. | |
| style | No | Advanced fine-grained style overrides. | |
| title | No | Optional new title (used by 'replace'). | |
| action | Yes | Edit action. | |
| tables | No | Tables as 2D arrays. | |
| docType | No | Tone and depth of the documentation. | |
| category | No | Document category for the registry update. | |
| filePath | Yes | Absolute or project-relative path to the existing DOCX file. | |
| useLegacy | No | DANGER: when true, recreates the document via mammoth which DESTROYS all original formatting (fonts, colors, images, headers, footers). Only set this if XML patching fails. Default: false. | |
| paragraphs | No | Paragraphs to append or replace with. | |
| stylePreset | No | Style preset. 'claude-like' (modern blue-accented professional) is the default for general-purpose docs. 'professional' is the executive serif look. Auto-selected from category if omitted. | |
| addSeparator | No | If true (default for 'append'), insert a blank paragraph before the new content as a visual separator. |