{
  "schemaVersion": "1.0",
  "item": {
    "slug": "docx-editing",
    "name": "DOCX Editing",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/stevenobiajulu/docx-editing",
    "canonicalUrl": "https://clawhub.ai/stevenobiajulu/docx-editing",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/docx-editing",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=docx-editing",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "CONNECTORS.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/docx-editing"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/docx-editing",
    "agentPageUrl": "https://openagent3.xyz/skills/docx-editing/agent",
    "manifestUrl": "https://openagent3.xyz/skills/docx-editing/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/docx-editing/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Editing .docx Files with Safe-DOCX",
        "body": "Safe-DOCX is a local MCP server for surgically editing existing .docx files. It preserves formatting, generates tracked-changes redlines, and runs entirely on the local filesystem — no hosted endpoint, no data leaves the machine."
      },
      {
        "title": "Safety Model",
        "body": "Local-only stdio runtime — the MCP server runs as a child process, never binds a port.\nPath policy — only files under ~/ (home directory) and system temp directories are accessible. Symlinks must resolve to allowed roots.\nArchive guardrails — zip bomb detection and hostile payload rejection protect against malformed .docx inputs."
      },
      {
        "title": "When to Use This Skill",
        "body": "Use Safe-DOCX when you need to:\n\nChange clauses or paragraphs in an existing .docx\nInsert or delete content with formatting preservation\nAdd comments or footnotes for reviewers\nProduce a tracked-changes redline from edits\nCompare two .docx files into a redline\nExtract revisions to structured JSON\nApply layout formatting (spacing, row heights, cell padding)"
      },
      {
        "title": "Not for From-Scratch Generation",
        "body": "Safe-DOCX edits already-existing .docx files — it does not create documents from blank. For new document generation, use a template-filling workflow (e.g. OpenAgreements). Safe-DOCX can refine generated docs downstream."
      },
      {
        "title": "Quick Start",
        "body": "1. read_file(file_path=\"~/doc.docx\")        → see paragraphs + _bk_* IDs\n2. grep(file_path=\"~/doc.docx\", patterns=[\"target phrase\"])  → find paragraph IDs\n3. replace_text(session_id, target_paragraph_id, old_string, new_string, instruction)\n4. save(session_id, save_to_local_path=\"~/doc-edited.docx\")"
      },
      {
        "title": "Core Workflow: Read, Locate, Edit, Save",
        "body": "Step 1 — Read. Call read_file with format: \"toon\" (token-efficient table) to see paragraphs and their stable _bk_* IDs.\n\nStep 2 — Locate. Use grep with regex patterns to find target paragraphs. It returns paragraph IDs with surrounding context.\n\nStep 3 — Edit. Use replace_text to swap text within a paragraph, or insert_paragraph to add new paragraphs before/after an anchor.\n\nStep 4 — Save. Call save to write output. Default is save_format: \"both\" which produces a clean copy and a tracked-changes redline."
      },
      {
        "title": "Unique match required",
        "body": "replace_text needs old_string to match exactly one location in the target paragraph. If the text appears multiple times, you get MULTIPLE_MATCHES. Fix: include more surrounding context in old_string.\n\nBAD:  old_string: \"the Company\"          → 5 matches, fails\nGOOD: old_string: \"the Company shall indemnify\"  → 1 match, succeeds"
      },
      {
        "title": "Footnote markers are display-only",
        "body": "read_file shows footnotes as [^1], [^2], etc., but these markers are not part of the editable text. You cannot search for or replace [^1] via replace_text. To modify footnotes, use the dedicated add_footnote, update_footnote, and delete_footnote tools."
      },
      {
        "title": "Hyperlinks are read-only",
        "body": "read_file shows links as <a href=\"...\">text</a>, but you cannot create new hyperlinks via replace_text or insert_paragraph. The <a> tag is stripped from new text. Existing hyperlinks are preserved when surrounding text is edited."
      },
      {
        "title": "Paragraph IDs are session-scoped",
        "body": "The _bk_* bookmark IDs are generated when a document is opened and are tied to that session. Do not store or reuse IDs across sessions. Always re-read the document to get fresh IDs."
      },
      {
        "title": "Smart text matching",
        "body": "replace_text is tolerant of:\n\nQuote variants: straight \", curly \\u201c\\u201d, angle \\u00ab\\u00bb all match each other\nWhitespace differences: multiple spaces, tabs, and line breaks are normalized\n\nThis means you can copy text from read_file output and use it in old_string even if the underlying XML uses different quote characters."
      },
      {
        "title": "Formatting Tags",
        "body": "When writing new_string in replace_text or insert_paragraph, use inline tags to apply formatting:\n\nTagEffect<b>text</b>Bold<i>text</i>Italic<u>text</u>Underline<highlighting>text</highlighting>Yellow highlight\n\nTags can be nested: <b><i>bold italic</i></b>. Formatting from the original matched text is preserved for untagged replacement text."
      },
      {
        "title": "Batch Edits with apply_plan",
        "body": "For 3+ edits on one document, prefer apply_plan over sequential replace_text calls. It validates all steps before applying any, so you get all-or-nothing transactional semantics.\n\n1. read_file / grep  → gather paragraph IDs and text\n2. apply_plan(file_path, steps=[\n     { step_id: \"1\", operation: \"replace_text\", target_paragraph_id, old_string, new_string, instruction },\n     { step_id: \"2\", operation: \"insert_paragraph\", positional_anchor_node_id, new_string, instruction },\n     ...\n   ])\n3. save(session_id, save_to_local_path)"
      },
      {
        "title": "Insert Paragraphs",
        "body": "insert_paragraph adds new content before or after an anchor paragraph.\n\nposition: \"BEFORE\" or \"AFTER\" (default \"AFTER\")\nstyle_source_id: optional _bk_* ID of a paragraph whose formatting you want to clone\nMulti-paragraph: separate with \\n\\n in new_string (each becomes its own paragraph)"
      },
      {
        "title": "Comments and Footnotes",
        "body": "Comments: add_comment anchors to a paragraph (optionally to a text span via anchor_text). Use get_comments to list, delete_comment to remove. Supports threaded replies via parent_comment_id.\n\nFootnotes: add_footnote inserts a footnote marker in a paragraph (optionally after specific text via after_text). Use get_footnotes, update_footnote, delete_footnote to manage."
      },
      {
        "title": "Comparing Documents",
        "body": "Two modes:\n\nTwo files: compare_documents(original_file_path, revised_file_path, save_to_local_path) — produces a redline\nSession edits: compare_documents(session_id) — compares current session state against the original\n\nUse extract_revisions on any document with tracked changes to get structured JSON diffs."
      },
      {
        "title": "Accepting Tracked Changes",
        "body": "Call accept_changes(session_id) to flatten all tracked changes into a clean document. This removes all revision markup."
      },
      {
        "title": "Session Behavior",
        "body": "Sessions auto-create when you first use file_path with any tool\nSessions expire after 1 hour of inactivity (each tool call resets the timer)\nCall clear_session to clean up when done\nDocuments are normalized on open: format-identical runs are merged and proof-error markers removed, which improves text matching reliability"
      },
      {
        "title": "Layout Formatting",
        "body": "format_layout applies paragraph spacing, table row height, and cell padding without touching text content. Units are in twips (1/20 of a point) or DXA (1/635 of an inch)."
      },
      {
        "title": "Path Restrictions",
        "body": "By default, only files under ~/ (home directory) and system temp directories are accessible. Symlinks must resolve to allowed roots."
      }
    ],
    "body": "Editing .docx Files with Safe-DOCX\n\nSafe-DOCX is a local MCP server for surgically editing existing .docx files. It preserves formatting, generates tracked-changes redlines, and runs entirely on the local filesystem — no hosted endpoint, no data leaves the machine.\n\nSafety Model\nLocal-only stdio runtime — the MCP server runs as a child process, never binds a port.\nPath policy — only files under ~/ (home directory) and system temp directories are accessible. Symlinks must resolve to allowed roots.\nArchive guardrails — zip bomb detection and hostile payload rejection protect against malformed .docx inputs.\nWhen to Use This Skill\n\nUse Safe-DOCX when you need to:\n\nChange clauses or paragraphs in an existing .docx\nInsert or delete content with formatting preservation\nAdd comments or footnotes for reviewers\nProduce a tracked-changes redline from edits\nCompare two .docx files into a redline\nExtract revisions to structured JSON\nApply layout formatting (spacing, row heights, cell padding)\nNot for From-Scratch Generation\n\nSafe-DOCX edits already-existing .docx files — it does not create documents from blank. For new document generation, use a template-filling workflow (e.g. OpenAgreements). Safe-DOCX can refine generated docs downstream.\n\nQuick Start\n1. read_file(file_path=\"~/doc.docx\")        → see paragraphs + _bk_* IDs\n2. grep(file_path=\"~/doc.docx\", patterns=[\"target phrase\"])  → find paragraph IDs\n3. replace_text(session_id, target_paragraph_id, old_string, new_string, instruction)\n4. save(session_id, save_to_local_path=\"~/doc-edited.docx\")\n\nCore Workflow: Read, Locate, Edit, Save\n\nStep 1 — Read. Call read_file with format: \"toon\" (token-efficient table) to see paragraphs and their stable _bk_* IDs.\n\nStep 2 — Locate. Use grep with regex patterns to find target paragraphs. It returns paragraph IDs with surrounding context.\n\nStep 3 — Edit. Use replace_text to swap text within a paragraph, or insert_paragraph to add new paragraphs before/after an anchor.\n\nStep 4 — Save. Call save to write output. Default is save_format: \"both\" which produces a clean copy and a tracked-changes redline.\n\nGotchas That Will Bite You\nUnique match required\n\nreplace_text needs old_string to match exactly one location in the target paragraph. If the text appears multiple times, you get MULTIPLE_MATCHES. Fix: include more surrounding context in old_string.\n\nBAD:  old_string: \"the Company\"          → 5 matches, fails\nGOOD: old_string: \"the Company shall indemnify\"  → 1 match, succeeds\n\nFootnote markers are display-only\n\nread_file shows footnotes as [^1], [^2], etc., but these markers are not part of the editable text. You cannot search for or replace [^1] via replace_text. To modify footnotes, use the dedicated add_footnote, update_footnote, and delete_footnote tools.\n\nHyperlinks are read-only\n\nread_file shows links as <a href=\"...\">text</a>, but you cannot create new hyperlinks via replace_text or insert_paragraph. The <a> tag is stripped from new text. Existing hyperlinks are preserved when surrounding text is edited.\n\nParagraph IDs are session-scoped\n\nThe _bk_* bookmark IDs are generated when a document is opened and are tied to that session. Do not store or reuse IDs across sessions. Always re-read the document to get fresh IDs.\n\nSmart text matching\n\nreplace_text is tolerant of:\n\nQuote variants: straight \", curly \\u201c\\u201d, angle \\u00ab\\u00bb all match each other\nWhitespace differences: multiple spaces, tabs, and line breaks are normalized\n\nThis means you can copy text from read_file output and use it in old_string even if the underlying XML uses different quote characters.\n\nFormatting Tags\n\nWhen writing new_string in replace_text or insert_paragraph, use inline tags to apply formatting:\n\nTag\tEffect\n<b>text</b>\tBold\n<i>text</i>\tItalic\n<u>text</u>\tUnderline\n<highlighting>text</highlighting>\tYellow highlight\n\nTags can be nested: <b><i>bold italic</i></b>. Formatting from the original matched text is preserved for untagged replacement text.\n\nBatch Edits with apply_plan\n\nFor 3+ edits on one document, prefer apply_plan over sequential replace_text calls. It validates all steps before applying any, so you get all-or-nothing transactional semantics.\n\n1. read_file / grep  → gather paragraph IDs and text\n2. apply_plan(file_path, steps=[\n     { step_id: \"1\", operation: \"replace_text\", target_paragraph_id, old_string, new_string, instruction },\n     { step_id: \"2\", operation: \"insert_paragraph\", positional_anchor_node_id, new_string, instruction },\n     ...\n   ])\n3. save(session_id, save_to_local_path)\n\nInsert Paragraphs\n\ninsert_paragraph adds new content before or after an anchor paragraph.\n\nposition: \"BEFORE\" or \"AFTER\" (default \"AFTER\")\nstyle_source_id: optional _bk_* ID of a paragraph whose formatting you want to clone\nMulti-paragraph: separate with \\n\\n in new_string (each becomes its own paragraph)\nComments and Footnotes\n\nComments: add_comment anchors to a paragraph (optionally to a text span via anchor_text). Use get_comments to list, delete_comment to remove. Supports threaded replies via parent_comment_id.\n\nFootnotes: add_footnote inserts a footnote marker in a paragraph (optionally after specific text via after_text). Use get_footnotes, update_footnote, delete_footnote to manage.\n\nComparing Documents\n\nTwo modes:\n\nTwo files: compare_documents(original_file_path, revised_file_path, save_to_local_path) — produces a redline\nSession edits: compare_documents(session_id) — compares current session state against the original\n\nUse extract_revisions on any document with tracked changes to get structured JSON diffs.\n\nAccepting Tracked Changes\n\nCall accept_changes(session_id) to flatten all tracked changes into a clean document. This removes all revision markup.\n\nSession Behavior\nSessions auto-create when you first use file_path with any tool\nSessions expire after 1 hour of inactivity (each tool call resets the timer)\nCall clear_session to clean up when done\nDocuments are normalized on open: format-identical runs are merged and proof-error markers removed, which improves text matching reliability\nLayout Formatting\n\nformat_layout applies paragraph spacing, table row height, and cell padding without touching text content. Units are in twips (1/20 of a point) or DXA (1/635 of an inch).\n\nPath Restrictions\n\nBy default, only files under ~/ (home directory) and system temp directories are accessible. Symlinks must resolve to allowed roots."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/stevenobiajulu/docx-editing",
    "publisherUrl": "https://clawhub.ai/stevenobiajulu/docx-editing",
    "owner": "stevenobiajulu",
    "version": "0.1.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/docx-editing",
    "downloadUrl": "https://openagent3.xyz/downloads/docx-editing",
    "agentUrl": "https://openagent3.xyz/skills/docx-editing/agent",
    "manifestUrl": "https://openagent3.xyz/skills/docx-editing/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/docx-editing/agent.md"
  }
}