[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-83ef84e6-2560-4d8c-bcc7-6aa168824de8":3,"$f8WSm0T9aQ47cH6qdsLkWA2iTOw8iOZav18JHkFKnpQg":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"83ef84e6-2560-4d8c-bcc7-6aa168824de8","docx","使用此技能 whenever 用户想要创建、阅读、编辑或操作 Word 文档（.docx 文件）。触发条件包括：提及“Word doc”、“word document”、“.docx”或请求制作带有目录、标题、页码或信头的专业文档。同时用于从 .docx 文件中提取或重新组织内容、在文档中插入或替换图片、在 Word 文件中进行查找和替换、处理跟踪更改或注释...","cat_prod_document","mod_productivity","anthropics,productivity","---\nname: docx\ndescription: \"Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.\"\nlicense: Proprietary. LICENSE.txt has complete terms\n---\n\n# DOCX creation, editing, and analysis\n\n## Overview\n\nA .docx file is a ZIP archive containing XML files.\n\n## Quick Reference\n\n| Task | Approach |\n|------|----------|\n| Read\u002Fanalyze content | `pandoc` or unpack for raw XML |\n| Create new document | Use `docx-js` - see Creating New Documents below |\n| Edit existing document | Unpack → edit XML → repack - see Editing Existing Documents below |\n\n### Converting .doc to .docx\n\nLegacy `.doc` files must be converted before editing:\n\n```bash\npython scripts\u002Foffice\u002Fsoffice.py --headless --convert-to docx document.doc\n```\n\n### Reading Content\n\n```bash\n# Text extraction with tracked changes\npandoc --track-changes=all document.docx -o output.md\n\n# Raw XML access\npython scripts\u002Foffice\u002Funpack.py document.docx unpacked\u002F\n```\n\n### Converting to Images\n\n```bash\npython scripts\u002Foffice\u002Fsoffice.py --headless --convert-to pdf document.docx\npdftoppm -jpeg -r 150 document.pdf page\n```\n\n### Accepting Tracked Changes\n\nTo produce a clean document with all tracked changes accepted (requires LibreOffice):\n\n```bash\npython scripts\u002Faccept_changes.py input.docx output.docx\n```\n\n---\n\n## Creating New Documents\n\nGenerate .docx files with JavaScript, then validate. Install: `npm install -g docx`\n\n### Setup\n```javascript\nconst { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, ImageRun,\n        Header, Footer, AlignmentType, PageOrientation, LevelFormat, ExternalHyperlink,\n        InternalHyperlink, Bookmark, FootnoteReferenceRun, PositionalTab,\n        PositionalTabAlignment, PositionalTabRelativeTo, PositionalTabLeader,\n        TabStopType, TabStopPosition, Column, SectionType,\n        TableOfContents, HeadingLevel, BorderStyle, WidthType, ShadingType,\n        VerticalAlign, PageNumber, PageBreak } = require('docx');\n\nconst doc = new Document({ sections: [{ children: [\u002F* content *\u002F] }] });\nPacker.toBuffer(doc).then(buffer => fs.writeFileSync(\"doc.docx\", buffer));\n```\n\n### Validation\nAfter creating the file, validate it. If validation fails, unpack, fix the XML, and repack.\n```bash\npython scripts\u002Foffice\u002Fvalidate.py doc.docx\n```\n\n### Page Size\n\n```javascript\n\u002F\u002F CRITICAL: docx-js defaults to A4, not US Letter\n\u002F\u002F Always set page size explicitly for consistent results\nsections: [{\n  properties: {\n    page: {\n      size: {\n        width: 12240,   \u002F\u002F 8.5 inches in DXA\n        height: 15840   \u002F\u002F 11 inches in DXA\n      },\n      margin: { top: 1440, right: 1440, bottom: 1440, left: 1440 } \u002F\u002F 1 inch margins\n    }\n  },\n  children: [\u002F* content *\u002F]\n}]\n```\n\n**Common page sizes (DXA units, 1440 DXA = 1 inch):**\n\n| Paper | Width | Height | Content Width (1\" margins) |\n|-------|-------|--------|---------------------------|\n| US Letter | 12,240 | 15,840 | 9,360 |\n| A4 (default) | 11,906 | 16,838 | 9,026 |\n\n**Landscape orientation:** docx-js swaps width\u002Fheight internally, so pass portrait dimensions and let it handle the swap:\n```javascript\nsize: {\n  width: 12240,   \u002F\u002F Pass SHORT edge as width\n  height: 15840,  \u002F\u002F Pass LONG edge as height\n  orientation: PageOrientation.LANDSCAPE  \u002F\u002F docx-js swaps them in the XML\n},\n\u002F\u002F Content width = 15840 - left margin - right margin (uses the long edge)\n```\n\n### Styles (Override Built-in Headings)\n\nUse Arial as the default font (universally supported). Keep titles black for readability.\n\n```javascript\nconst doc = new Document({\n  styles: {\n    default: { document: { run: { font: \"Arial\", size: 24 } } }, \u002F\u002F 12pt default\n    paragraphStyles: [\n      \u002F\u002F IMPORTANT: Use exact IDs to override built-in styles\n      { id: \"Heading1\", name: \"Heading 1\", basedOn: \"Normal\", next: \"Normal\", quickFormat: true,\n        run: { size: 32, bold: true, font: \"Arial\" },\n        paragraph: { spacing: { before: 240, after: 240 }, outlineLevel: 0 } }, \u002F\u002F outlineLevel required for TOC\n      { id: \"Heading2\", name: \"Heading 2\", basedOn: \"Normal\", next: \"Normal\", quickFormat: true,\n        run: { size: 28, bold: true, font: \"Arial\" },\n        paragraph: { spacing: { before: 180, after: 180 }, outlineLevel: 1 } },\n    ]\n  },\n  sections: [{\n    children: [\n      new Paragraph({ heading: HeadingLevel.HEADING_1, children: [new TextRun(\"Title\")] }),\n    ]\n  }]\n});\n```\n\n### Lists (NEVER use unicode bullets)\n\n```javascript\n\u002F\u002F ❌ WRONG - never manually insert bullet characters\nnew Paragraph({ children: [new TextRun(\"• Item\")] })  \u002F\u002F BAD\nnew Paragraph({ children: [new TextRun(\"\\u2022 Item\")] })  \u002F\u002F BAD\n\n\u002F\u002F ✅ CORRECT - use numbering config with LevelFormat.BULLET\nconst doc = new Document({\n  numbering: {\n    config: [\n      { reference: \"bullets\",\n        levels: [{ level: 0, format: LevelFormat.BULLET, text: \"•\", alignment: AlignmentType.LEFT,\n          style: { paragraph: { indent: { left: 720, hanging: 360 } } } }] },\n      { reference: \"numbers\",\n        levels: [{ level: 0, format: LevelFormat.DECIMAL, text: \"%1.\", alignment: AlignmentType.LEFT,\n          style: { paragraph: { indent: { left: 720, hanging: 360 } } } }] },\n    ]\n  },\n  sections: [{\n    children: [\n      new Paragraph({ numbering: { reference: \"bullets\", level: 0 },\n        children: [new TextRun(\"Bullet item\")] }),\n      new Paragraph({ numbering: { reference: \"numbers\", level: 0 },\n        children: [new TextRun(\"Numbered item\")] }),\n    ]\n  }]\n});\n\n\u002F\u002F ⚠️ Each reference creates INDEPENDENT numbering\n\u002F\u002F Same reference = continues (1,2,3 then 4,5,6)\n\u002F\u002F Different reference = restarts (1,2,3 then 1,2,3)\n```\n\n### Tables\n\n**CRITICAL: Tables need dual widths** - set both `columnWidths` on the table AND `width` on each cell. Without both, tables render incorrectly on some platforms.\n\n```javascript\n\u002F\u002F CRITICAL: Always set table width for consistent rendering\n\u002F\u002F CRITICAL: Use ShadingType.CLEAR (not SOLID) to prevent black backgrounds\nconst border = { style: BorderStyle.SINGLE, size: 1, color: \"CCCCCC\" };\nconst borders = { top: border, bottom: border, left: border, right: border };\n\nnew Table({\n  width: { size: 9360, type: WidthType.DXA }, \u002F\u002F Always use DXA (percentages break in Google Docs)\n  columnWidths: [4680, 4680], \u002F\u002F Must sum to table width (DXA: 1440 = 1 inch)\n  rows: [\n    new TableRow({\n      children: [\n        new TableCell({\n          borders,\n          width: { size: 4680, type: WidthType.DXA }, \u002F\u002F Also set on each cell\n          shading: { fill: \"D5E8F0\", type: ShadingType.CLEAR }, \u002F\u002F CLEAR not SOLID\n          margins: { top: 80, bottom: 80, left: 120, right: 120 }, \u002F\u002F Cell padding (internal, not added to width)\n          children: [new Paragraph({ children: [new TextRun(\"Cell\")] })]\n        })\n      ]\n    })\n  ]\n})\n```\n\n**Table width calculation:**\n\nAlways use `WidthType.DXA` — `WidthType.PERCENTAGE` breaks in Google Docs.\n\n```javascript\n\u002F\u002F Table width = sum of columnWidths = content width\n\u002F\u002F US Letter with 1\" margins: 12240 - 2880 = 9360 DXA\nwidth: { size: 9360, type: WidthType.DXA },\ncolumnWidths: [7000, 2360]  \u002F\u002F Must sum to table width\n```\n\n**Width rules:**\n- **Always use `WidthType.DXA`** — never `WidthType.PERCENTAGE` (incompatible with Google Docs)\n- Table width must equal the sum of `columnWidths`\n- Cell `width` must match corresponding `columnWidth`\n- Cell `margins` are internal padding - they reduce content area, not add to cell width\n- For full-width tables: use content width (page width minus left and right margins)\n\n### Images\n\n```javascript\n\u002F\u002F CRITICAL: type parameter is REQUIRED\nnew Paragraph({\n  children: [new ImageRun({\n    type: \"png\", \u002F\u002F Required: png, jpg, jpeg, gif, bmp, svg\n    data: fs.readFileSync(\"image.png\"),\n    transformation: { width: 200, height: 150 },\n    altText: { title: \"Title\", description: \"Desc\", name: \"Name\" } \u002F\u002F All three required\n  })]\n})\n```\n\n### Page Breaks\n\n```javascript\n\u002F\u002F CRITICAL: PageBreak must be inside a Paragraph\nnew Paragraph({ children: [new PageBreak()] })\n\n\u002F\u002F Or use pageBreakBefore\nnew Paragraph({ pageBreakBefore: true, children: [new TextRun(\"New page\")] })\n```\n\n### Hyperlinks\n\n```javascript\n\u002F\u002F External link\nnew Paragraph({\n  children: [new ExternalHyperlink({\n    children: [new TextRun({ text: \"Click here\", style: \"Hyperlink\" })],\n    link: \"https:\u002F\u002Fexample.com\",\n  })]\n})\n\n\u002F\u002F Internal link (bookmark + reference)\n\u002F\u002F 1. Create bookmark at destination\nnew Paragraph({ heading: HeadingLevel.HEADING_1, children: [\n  new Bookmark({ id: \"chapter1\", children: [new TextRun(\"Chapter 1\")] }),\n]})\n\u002F\u002F 2. Link to it\nnew Paragraph({ children: [new InternalHyperlink({\n  children: [new TextRun({ text: \"See Chapter 1\", style: \"Hyperlink\" })],\n  anchor: \"chapter1\",\n})]})\n```\n\n### Footnotes\n\n```javascript\nconst doc = new Document({\n  footnotes: {\n    1: { children: [new Paragraph(\"Source: Annual Report 2024\")] },\n    2: { children: [new Paragraph(\"See appendix for methodology\")] },\n  },\n  sections: [{\n    children: [new Paragraph({\n      children: [\n        new TextRun(\"Revenue grew 15%\"),\n        new FootnoteReferenceRun(1),\n        new TextRun(\" using adjusted metrics\"),\n        new FootnoteReferenceRun(2),\n      ],\n    })]\n  }]\n});\n```\n\n### Tab Stops\n\n```javascript\n\u002F\u002F Right-align text on same line (e.g., date opposite a title)\nnew Paragraph({\n  children: [\n    new TextRun(\"Company Name\"),\n    new TextRun(\"\\tJanuary 2025\"),\n  ],\n  tabStops: [{ type: TabStopType.RIGHT, position: TabStopPosition.MAX }],\n})\n\n\u002F\u002F Dot leader (e.g., TOC-style)\nnew Paragraph({\n  children: [\n    new TextRun(\"Introduction\"),\n    new TextRun({ children: [\n      new PositionalTab({\n        alignment: PositionalTabAlignment.RIGHT,\n        relativeTo: PositionalTabRelativeTo.MARGIN,\n        leader: PositionalTabLeader.DOT,\n      }),\n      \"3\",\n    ]}),\n  ],\n})\n```\n\n### Multi-Column Layouts\n\n```javascript\n\u002F\u002F Equal-width columns\nsections: [{\n  properties: {\n    column: {\n      count: 2,          \u002F\u002F number of columns\n      space: 720,        \u002F\u002F gap between columns in DXA (720 = 0.5 inch)\n      equalWidth: true,\n      separate: true,    \u002F\u002F vertical line between columns\n    },\n  },\n  children: [\u002F* content flows naturally across columns *\u002F]\n}]\n\n\u002F\u002F Custom-width columns (equalWidth must be false)\nsections: [{\n  properties: {\n    column: {\n      equalWidth: false,\n      children: [\n        new Column({ width: 5400, space: 720 }),\n        new Column({ width: 3240 }),\n      ],\n    },\n  },\n  children: [\u002F* content *\u002F]\n}]\n```\n\nForce a column break with a new section using `type: SectionType.NEXT_COLUMN`.\n\n### Table of Contents\n\n```javascript\n\u002F\u002F CRITICAL: Headings must use HeadingLevel ONLY - no custom styles\nnew TableOfContents(\"Table of Contents\", { hyperlink: true, headingStyleRange: \"1-3\" })\n```\n\n### Headers\u002FFooters\n\n```javascript\nsections: [{\n  properties: {\n    page: { margin: { top: 1440, right: 1440, bottom: 1440, left: 1440 } } \u002F\u002F 1440 = 1 inch\n  },\n  headers: {\n    default: new Header({ children: [new Paragraph({ children: [new TextRun(\"Header\")] })] })\n  },\n  footers: {\n    default: new Footer({ children: [new Paragraph({\n      children: [new TextRun(\"Page \"), new TextRun({ children: [PageNumber.CURRENT] })]\n    })] })\n  },\n  children: [\u002F* content *\u002F]\n}]\n```\n\n### Critical Rules for docx-js\n\n- **Set page size explicitly** - docx-js defaults to A4; use US Letter (12240 x 15840 DXA) for US documents\n- **Landscape: pass portrait dimensions** - docx-js swaps width\u002Fheight internally; pass short edge as `width`, long edge as `height`, and set `orientation: PageOrientation.LANDSCAPE`\n- **Never use `\\n`** - use separate Paragraph elements\n- **Never use unicode bullets** - use `LevelFormat.BULLET` with numbering config\n- **PageBreak must be in Paragraph** - standalone creates invalid XML\n- **ImageRun requires `type`** - always specify png\u002Fjpg\u002Fetc\n- **Always set table `width` with DXA** - never use `WidthType.PERCENTAGE` (breaks in Google Docs)\n- **Tables need dual widths** - `columnWidths` array AND cell `width`, both must match\n- **Table width = sum of columnWidths** - for DXA, ensure they add up exactly\n- **Always add cell margins** - use `margins: { top: 80, bottom: 80, left: 120, right: 120 }` for readable padding\n- **Use `ShadingType.CLEAR`** - never SOLID for table shading\n- **Never use tables as dividers\u002Frules** - cells have minimum height and render as empty boxes (including in headers\u002Ffooters); use `border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: \"2E75B6\", space: 1 } }` on a Paragraph instead. For two-column footers, use tab stops (see Tab Stops section), not tables\n- **TOC requires HeadingLevel only** - no custom styles on heading paragraphs\n- **Override built-in styles** - use exact IDs: \"Heading1\", \"Heading2\", etc.\n- **Include `outlineLevel`** - required for TOC (0 for H1, 1 for H2, etc.)\n\n---\n\n## Editing Existing Documents\n\n**Follow all 3 steps in order.**\n\n### Step 1: Unpack\n```bash\npython scripts\u002Foffice\u002Funpack.py document.docx unpacked\u002F\n```\nExtracts XML, pretty-prints, merges adjacent runs, and converts smart quotes to XML entities (`&#x201C;` etc.) so they survive editing. Use `--merge-runs false` to skip run merging.\n\n### Step 2: Edit XML\n\nEdit files in `unpacked\u002Fword\u002F`. See XML Reference below for patterns.\n\n**Use \"Claude\" as the author** for tracked changes and comments, unless the user explicitly requests use of a different name.\n\n**Use the Edit tool directly for string replacement. Do not write Python scripts.** Scripts introduce unnecessary complexity. The Edit tool shows exactly what is being replaced.\n\n**CRITICAL: Use smart quotes for new content.** When adding text with apostrophes or quotes, use XML entities to produce smart quotes:\n```xml\n\u003C!-- Use these entities for professional typography -->\n\u003Cw:t>Here&#x2019;s a quote: &#x201C;Hello&#x201D;\u003C\u002Fw:t>\n```\n| Entity | Character |\n|--------|-----------|\n| `&#x2018;` | ‘ (left single) |\n| `&#x2019;` | ’ (right single \u002F apostrophe) |\n| `&#x201C;` | “ (left double) |\n| `&#x201D;` | ” (right double) |\n\n**Adding comments:** Use `comment.py` to handle boilerplate across multiple XML files (text must be pre-escaped XML):\n```bash\npython scripts\u002Fcomment.py unpacked\u002F 0 \"Comment text with &amp; and &#x2019;\"\npython scripts\u002Fcomment.py unpacked\u002F 1 \"Reply text\" --parent 0  # reply to comment 0\npython scripts\u002Fcomment.py unpacked\u002F 0 \"Text\" --author \"Custom Author\"  # custom author name\n```\nThen add markers to document.xml (see Comments in XML Reference).\n\n### Step 3: Pack\n```bash\npython scripts\u002Foffice\u002Fpack.py unpacked\u002F output.docx --original document.docx\n```\nValidates with auto-repair, condenses XML, and creates DOCX. Use `--validate false` to skip.\n\n**Auto-repair will fix:**\n- `durableId` >= 0x7FFFFFFF (regenerates valid ID)\n- Missing `xml:space=\"preserve\"` on `\u003Cw:t>` with whitespace\n\n**Auto-repair won't fix:**\n- Malformed XML, invalid element nesting, missing relationships, schema violations\n\n### Common Pitfalls\n\n- **Replace entire `\u003Cw:r>` elements**: When adding tracked changes, replace the whole `\u003Cw:r>...\u003C\u002Fw:r>` block with `\u003Cw:del>...\u003Cw:ins>...` as siblings. Don't inject tracked change tags inside a run.\n- **Preserve `\u003Cw:rPr>` formatting**: Copy the original run's `\u003Cw:rPr>` block into your tracked change runs to maintain bold, font size, etc.\n\n---\n\n## XML Reference\n\n### Schema Compliance\n\n- **Element order in `\u003Cw:pPr>`**: `\u003Cw:pStyle>`, `\u003Cw:numPr>`, `\u003Cw:spacing>`, `\u003Cw:ind>`, `\u003Cw:jc>`, `\u003Cw:rPr>` last\n- **Whitespace**: Add `xml:space=\"preserve\"` to `\u003Cw:t>` with leading\u002Ftrailing spaces\n- **RSIDs**: Must be 8-digit hex (e.g., `00AB1234`)\n\n### Tracked Changes\n\n**Insertion:**\n```xml\n\u003Cw:ins w:id=\"1\" w:author=\"Claude\" w:date=\"2025-01-01T00:00:00Z\">\n  \u003Cw:r>\u003Cw:t>inserted text\u003C\u002Fw:t>\u003C\u002Fw:r>\n\u003C\u002Fw:ins>\n```\n\n**Deletion:**\n```xml\n\u003Cw:del w:id=\"2\" w:author=\"Claude\" w:date=\"2025-01-01T00:00:00Z\">\n  \u003Cw:r>\u003Cw:delText>deleted text\u003C\u002Fw:delText>\u003C\u002Fw:r>\n\u003C\u002Fw:del>\n```\n\n**Inside `\u003Cw:del>`**: Use `\u003Cw:delText>` instead of `\u003Cw:t>`, and `\u003Cw:delInstrText>` instead of `\u003Cw:instrText>`.\n\n**Minimal edits** - only mark what changes:\n```xml\n\u003C!-- Change \"30 days\" to \"60 days\" -->\n\u003Cw:r>\u003Cw:t>The term is \u003C\u002Fw:t>\u003C\u002Fw:r>\n\u003Cw:del w:id=\"1\" w:author=\"Claude\" w:date=\"...\">\n  \u003Cw:r>\u003Cw:delText>30\u003C\u002Fw:delText>\u003C\u002Fw:r>\n\u003C\u002Fw:del>\n\u003Cw:ins w:id=\"2\" w:author=\"Claude\" w:date=\"...\">\n  \u003Cw:r>\u003Cw:t>60\u003C\u002Fw:t>\u003C\u002Fw:r>\n\u003C\u002Fw:ins>\n\u003Cw:r>\u003Cw:t> days.\u003C\u002Fw:t>\u003C\u002Fw:r>\n```\n\n**Deleting entire paragraphs\u002Flist items** - when removing ALL content from a paragraph, also mark the paragraph mark as deleted so it merges with the next paragraph. Add `\u003Cw:del\u002F>` inside `\u003Cw:pPr>\u003Cw:rPr>`:\n```xml\n\u003Cw:p>\n  \u003Cw:pPr>\n    \u003Cw:numPr>...\u003C\u002Fw:numPr>  \u003C!-- list numbering if present -->\n    \u003Cw:rPr>\n      \u003Cw:del w:id=\"1\" w:author=\"Claude\" w:date=\"2025-01-01T00:00:00Z\"\u002F>\n    \u003C\u002Fw:rPr>\n  \u003C\u002Fw:pPr>\n  \u003Cw:del w:id=\"2\" w:author=\"Claude\" w:date=\"2025-01-01T00:00:00Z\">\n    \u003Cw:r>\u003Cw:delText>Entire paragraph content being deleted...\u003C\u002Fw:delText>\u003C\u002Fw:r>\n  \u003C\u002Fw:del>\n\u003C\u002Fw:p>\n```\nWithout the `\u003Cw:del\u002F>` in `\u003Cw:pPr>\u003Cw:rPr>`, accepting changes leaves an empty paragraph\u002Flist item.\n\n**Rejecting another author's insertion** - nest deletion inside their insertion:\n```xml\n\u003Cw:ins w:author=\"Jane\" w:id=\"5\">\n  \u003Cw:del w:author=\"Claude\" w:id=\"10\">\n    \u003Cw:r>\u003Cw:delText>their inserted text\u003C\u002Fw:delText>\u003C\u002Fw:r>\n  \u003C\u002Fw:del>\n\u003C\u002Fw:ins>\n```\n\n**Restoring another author's deletion** - add insertion after (don't modify their deletion):\n```xml\n\u003Cw:del w:author=\"Jane\" w:id=\"5\">\n  \u003Cw:r>\u003Cw:delText>deleted text\u003C\u002Fw:delText>\u003C\u002Fw:r>\n\u003C\u002Fw:del>\n\u003Cw:ins w:author=\"Claude\" w:id=\"10\">\n  \u003Cw:r>\u003Cw:t>deleted text\u003C\u002Fw:t>\u003C\u002Fw:r>\n\u003C\u002Fw:ins>\n```\n\n### Comments\n\nAfter running `comment.py` (see Step 2), add markers to document.xml. For replies, use `--parent` flag and nest markers inside the parent's.\n\n**CRITICAL: `\u003Cw:commentRangeStart>` and `\u003Cw:commentRangeEnd>` are siblings of `\u003Cw:r>`, never inside `\u003Cw:r>`.**\n\n```xml\n\u003C!-- Comment markers are direct children of w:p, never inside w:r -->\n\u003Cw:commentRangeStart w:id=\"0\"\u002F>\n\u003Cw:del w:id=\"1\" w:author=\"Claude\" w:date=\"2025-01-01T00:00:00Z\">\n  \u003Cw:r>\u003Cw:delText>deleted\u003C\u002Fw:delText>\u003C\u002Fw:r>\n\u003C\u002Fw:del>\n\u003Cw:r>\u003Cw:t> more text\u003C\u002Fw:t>\u003C\u002Fw:r>\n\u003Cw:commentRangeEnd w:id=\"0\"\u002F>\n\u003Cw:r>\u003Cw:rPr>\u003Cw:rStyle w:val=\"CommentReference\"\u002F>\u003C\u002Fw:rPr>\u003Cw:commentReference w:id=\"0\"\u002F>\u003C\u002Fw:r>\n\n\u003C!-- Comment 0 with reply 1 nested inside -->\n\u003Cw:commentRangeStart w:id=\"0\"\u002F>\n  \u003Cw:commentRangeStart w:id=\"1\"\u002F>\n  \u003Cw:r>\u003Cw:t>text\u003C\u002Fw:t>\u003C\u002Fw:r>\n  \u003Cw:commentRangeEnd w:id=\"1\"\u002F>\n\u003Cw:commentRangeEnd w:id=\"0\"\u002F>\n\u003Cw:r>\u003Cw:rPr>\u003Cw:rStyle w:val=\"CommentReference\"\u002F>\u003C\u002Fw:rPr>\u003Cw:commentReference w:id=\"0\"\u002F>\u003C\u002Fw:r>\n\u003Cw:r>\u003Cw:rPr>\u003Cw:rStyle w:val=\"CommentReference\"\u002F>\u003C\u002Fw:rPr>\u003Cw:commentReference w:id=\"1\"\u002F>\u003C\u002Fw:r>\n```\n\n### Images\n\n1. Add image file to `word\u002Fmedia\u002F`\n2. Add relationship to `word\u002F_rels\u002Fdocument.xml.rels`:\n```xml\n\u003CRelationship Id=\"rId5\" Type=\"...\u002Fimage\" Target=\"media\u002Fimage1.png\"\u002F>\n```\n3. Add content type to `[Content_Types].xml`:\n```xml\n\u003CDefault Extension=\"png\" ContentType=\"image\u002Fpng\"\u002F>\n```\n4. Reference in document.xml:\n```xml\n\u003Cw:drawing>\n  \u003Cwp:inline>\n    \u003Cwp:extent cx=\"914400\" cy=\"914400\"\u002F>  \u003C!-- EMUs: 914400 = 1 inch -->\n    \u003Ca:graphic>\n      \u003Ca:graphicData uri=\"...\u002Fpicture\">\n        \u003Cpic:pic>\n          \u003Cpic:blipFill>\u003Ca:blip r:embed=\"rId5\"\u002F>\u003C\u002Fpic:blipFill>\n        \u003C\u002Fpic:pic>\n      \u003C\u002Fa:graphicData>\n    \u003C\u002Fa:graphic>\n  \u003C\u002Fwp:inline>\n\u003C\u002Fw:drawing>\n```\n\n---\n\n## Dependencies\n\n- **pandoc**: Text extraction\n- **docx**: `npm install -g docx` (new documents)\n- **LibreOffice**: PDF conversion (auto-configured for sandboxed environments via `scripts\u002Foffice\u002Fsoffice.py`)\n- **Poppler**: `pdftoppm` for images\n","","imported","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fskills","user_system_seed","SkillOPIC",true,161,531,"2026-05-16 12:56:32",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"效率工具","productivity","mdi-lightning-bolt-outline","文档处理、数据分析、自动化工作流",4,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"文档处理","document","mdi-file-document-outline","PDF\u002FWord\u002FExcel\u002FPPT 处理",1,23,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"7d22eb85-4adf-4569-86dc-398dc945c93a","1.0.0","docx.zip",157109,"uploads\u002Fskills\u002F83ef84e6-2560-4d8c-bcc7-6aa168824de8\u002Fdocx.zip","005bf85a50230e1ebdadd0ddc61d0d1bd3224cac5874a65df66e661a57ad5154","[{\"path\":\"LICENSE.txt\",\"isDirectory\":false,\"size\":1467},{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":20084},{\"path\":\"scripts\u002F__init__.py\",\"isDirectory\":false,\"size\":1},{\"path\":\"scripts\u002Faccept_changes.py\",\"isDirectory\":false,\"size\":4051},{\"path\":\"scripts\u002Fcomment.py\",\"isDirectory\":false,\"size\":10694},{\"path\":\"scripts\u002Foffice\u002Fhelpers\u002F__init__.py\",\"isDirectory\":false,\"size\":0},{\"path\":\"scripts\u002Foffice\u002Fhelpers\u002Fmerge_runs.py\",\"isDirectory\":false,\"size\":5567},{\"path\":\"scripts\u002Foffice\u002Fhelpers\u002Fsimplify_redlines.py\",\"isDirectory\":false,\"size\":5754},{\"path\":\"scripts\u002Foffice\u002Fpack.py\",\"isDirectory\":false,\"size\":4991},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fdml-chart.xsd\",\"isDirectory\":false,\"size\":74984},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fdml-chartDrawing.xsd\",\"isDirectory\":false,\"size\":6956},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fdml-diagram.xsd\",\"isDirectory\":false,\"size\":51302},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fdml-lockedCanvas.xsd\",\"isDirectory\":false,\"size\":624},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fdml-main.xsd\",\"isDirectory\":false,\"size\":152039},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fdml-picture.xsd\",\"isDirectory\":false,\"size\":1231},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fdml-spreadsheetDrawing.xsd\",\"isDirectory\":false,\"size\":8862},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fdml-wordprocessingDrawing.xsd\",\"isDirectory\":false,\"size\":14795},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fpml.xsd\",\"isDirectory\":false,\"size\":83612},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fshared-additionalCharacteristics.xsd\",\"isDirectory\":false,\"size\":1269},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fshared-bibliography.xsd\",\"isDirectory\":false,\"size\":7328},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fshared-commonSimpleTypes.xsd\",\"isDirectory\":false,\"size\":6382},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fshared-customXmlDataProperties.xsd\",\"isDirectory\":false,\"size\":1248},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fshared-customXmlSchemaProperties.xsd\",\"isDirectory\":false,\"size\":880},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fshared-documentPropertiesCustom.xsd\",\"isDirectory\":false,\"size\":2608},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fshared-documentPropertiesExtended.xsd\",\"isDirectory\":false,\"size\":3507},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fshared-documentPropertiesVariantTypes.xsd\",\"isDirectory\":false,\"size\":7507},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fshared-math.xsd\",\"isDirectory\":false,\"size\":23313},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fshared-relationshipReference.xsd\",\"isDirectory\":false,\"size\":1367},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fsml.xsd\",\"isDirectory\":false,\"size\":242277},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fvml-main.xsd\",\"isDirectory\":false,\"size\":26148},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fvml-officeDrawing.xsd\",\"isDirectory\":false,\"size\":25279},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fvml-presentationDrawing.xsd\",\"isDirectory\":false,\"size\":535},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fvml-spreadsheetDrawing.xsd\",\"isDirectory\":false,\"size\":5712},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fvml-wordprocessingDrawing.xsd\",\"isDirectory\":false,\"size\":4010},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fwml.xsd\",\"isDirectory\":false,\"size\":171367},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002FISO-IEC29500-4_2016\u002Fxml.xsd\",\"isDirectory\":false,\"size\":4646},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002Fecma\u002Ffouth-edition\u002Fopc-contentTypes.xsd\",\"isDirectory\":false,\"size\":1963},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002Fecma\u002Ffouth-edition\u002Fopc-coreProperties.xsd\",\"isDirectory\":false,\"size\":2515},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002Fecma\u002Ffouth-edition\u002Fopc-digSig.xsd\",\"isDirectory\":false,\"size\":2856},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002Fecma\u002Ffouth-edition\u002Fopc-relationships.xsd\",\"isDirectory\":false,\"size\":1344},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002Fmce\u002Fmc.xsd\",\"isDirectory\":false,\"size\":3127},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002Fmicrosoft\u002Fwml-2010.xsd\",\"isDirectory\":false,\"size\":26549},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002Fmicrosoft\u002Fwml-2012.xsd\",\"isDirectory\":false,\"size\":3745},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002Fmicrosoft\u002Fwml-2018.xsd\",\"isDirectory\":false,\"size\":901},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002Fmicrosoft\u002Fwml-cex-2018.xsd\",\"isDirectory\":false,\"size\":1778},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002Fmicrosoft\u002Fwml-cid-2016.xsd\",\"isDirectory\":false,\"size\":1002},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002Fmicrosoft\u002Fwml-sdtdatahash-2020.xsd\",\"isDirectory\":false,\"size\":600},{\"path\":\"scripts\u002Foffice\u002Fschemas\u002Fmicrosoft\u002Fwml-symex-2015.xsd\",\"isDirectory\":false,\"size\":745},{\"path\":\"scripts\u002Foffice\u002Fsoffice.py\",\"isDirectory\":false,\"size\":5301},{\"path\":\"scripts\u002Foffice\u002Funpack.py\",\"isDirectory\":false,\"size\":4052},{\"path\":\"scripts\u002Foffice\u002Fvalidate.py\",\"isDirectory\":false,\"size\":3668},{\"path\":\"scripts\u002Foffice\u002Fvalidators\u002F__init__.py\",\"isDirectory\":false,\"size\":336},{\"path\":\"scripts\u002Foffice\u002Fvalidators\u002Fbase.py\",\"isDirectory\":false,\"size\":32651},{\"path\":\"scripts\u002Foffice\u002Fvalidators\u002Fdocx.py\",\"isDirectory\":false,\"size\":16376},{\"path\":\"scripts\u002Foffice\u002Fvalidators\u002Fpptx.py\",\"isDirectory\":false,\"size\":9824},{\"path\":\"scripts\u002Foffice\u002Fvalidators\u002Fredlining.py\",\"isDirectory\":false,\"size\":8918},{\"path\":\"scripts\u002Ftemplates\u002Fcomments.xml\",\"isDirectory\":false,\"size\":2603},{\"path\":\"scripts\u002Ftemplates\u002FcommentsExtended.xml\",\"isDirectory\":false,\"size\":2611},{\"path\":\"scripts\u002Ftemplates\u002FcommentsExtensible.xml\",\"isDirectory\":false,\"size\":2707},{\"path\":\"scripts\u002Ftemplates\u002FcommentsIds.xml\",\"isDirectory\":false,\"size\":2619},{\"path\":\"scripts\u002Ftemplates\u002Fpeople.xml\",\"isDirectory\":false,\"size\":115}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]