Skip to main content

docx

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for creating new documents, modifying content, working with tracked changes, or adding comments.

跳到安装

来源信息

仓库
plurigrid/asi
最近来源活动
2026年6月10日 11:55
检测到的 SKILL.md 语言
英语
星标
64
分支
12

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
docx
description
Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for creating new documents, modifying content, working with tracked changes, or adding comments.
license
Apache-2.0
metadata
{"trit":0,"source":"anthropics/skills"}
# DOCX Processing ## Workflow Decision Tree - **Reading/Analyzing**: Use text extraction or raw XML access - **Creating New Document**: Use docx-js (JavaScript) - **Editing Existing**: Use OOXML editing or redlining workflow ## Reading Content ### Text Extraction with Pandoc ```bash # Convert to markdown with tracked changes pandoc --track-changes=all file.docx -o output.md ``` ### Raw XML Access ```bash # Unpack document unzip document.docx -d unpacked/ # Key files: # word/document.xml - Main content # word/comments.xml - Comments # word/media/ - Images ``` ## Creating New Documents (docx-js) ```javascript import { Document, Paragraph, TextRun, Packer } from 'docx'; import fs from 'fs'; const doc = new Document({ sections: [{ children: [ new Paragraph({ children: [ new TextRun({ text: "Hello ", bold: true }), new TextRun({ text: "World", italics: true }) ] }) ] }] }); const buffer = await Packer.toBuffer(doc); fs.writeFileSync('document.docx', buffer); ``` ## Editing Existing Documents ### Simple Edits 1. Unpack: `unzip doc.docx -d unpacked/` 2. Edit `word/document.xml` 3. Repack: `cd unpacked && zip -r ../edited.docx .` ### Tracked Changes (Redlining) For professional documents, use tracked changes: ```xml <!-- Deletion --> <w:del w:author="Author" w:date="2025-01-01T00:00:00Z"> <w:r><w:delText>old text</w:delText></w:r> </w:del> <!-- Insertion --> <w:ins w:author="Author" w:date="2025-01-01T00:00:00Z"> <w:r><w:t>new text</w:t></w:r> </w:ins> ``` ## Converting to Images ```bash # DOCX to PDF soffice --headless --convert-to pdf document.docx # PDF to images pdftoppm -jpeg -r 150 document.pdf page ``` ## Best Practices - Use Pandoc for text extraction - Use docx-js for creating new documents - For legal/business docs, always use tracked changes - Preserve original RSIDs when editing
在 GitHub 查看