reference-preserving-edit

star 59

Use this workflow when editing an existing HWPX while minimizing layout drift by copying first, inspecting the relevant package parts, making bounded edits with the current MCP tools, and validating the result before handoff.

airmang By airmang schedule Updated 3/8/2026

name: reference-preserving-edit description: Use this workflow when editing an existing HWPX while minimizing layout drift by copying first, inspecting the relevant package parts, making bounded edits with the current MCP tools, and validating the result before handoff.

Reference-Preserving Edit

Use this workflow when the document already exists and layout stability matters more than editing speed.

Tool Order

  1. Create a working copy with copy_document.
  2. Read the current structure with get_document_outline, get_paragraphs_text, get_table_text, or hwpx_extract_json.
  3. In advanced mode, inspect sensitive package parts with package_parts, package_get_xml, package_get_text, object_find_by_tag, or object_find_by_attr.
  4. Validate the baseline with validate_structure if the source document is externally produced or suspicious.
  5. Apply the smallest possible edit:
    • search_and_replace or batch_replace for anchored text updates
    • format_text for localized styling
    • set_table_cell_text for fixed cells
    • paragraph insertion/deletion only when structure must change
  6. Re-read the touched areas and rerun validate_structure.

Minimize Layout Drift

  • Prefer replacement over insertion.
  • Avoid changing table geometry unless required.
  • Limit edits to the smallest paragraph or table region possible.
  • Use package inspection when memo anchors, section XML, or dense table layouts make visual assumptions risky.

When To Inspect Package Parts

  • The source was generated by another system.
  • The visible text is not enough to identify the true anchor.
  • You need to confirm which section or package part contains the target content.

Honest Limitations

  • plan_edit, preview_edit, and apply_edit are review/verification pipeline tools, not a full semantic patch engine.
  • There is no public layout-drift report or structure-diff tool on the active MCP surface.
  • Saving is implicit: mutating tools persist immediately, so always start from copy_document when the original must stay untouched.
Install via CLI
npx skills add https://github.com/airmang/hwpx-mcp-server --skill reference-preserving-edit
Repository Details
star Stars 59
call_split Forks 18
navigation Branch main
article Path SKILL.md
More from Creator