用于创建、编辑与整理Word文档,并生成带专业排版的 .docx 文件。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "docx" 技能: 1. 下载 https://raw.githubusercontent.com/anthropics/skills/main/skills/docx/SKILL.md 2. 保存为 ~/.claude/skills/docx/SKILL.md 3. 装好后重载技能,告诉我可以用了
A .docx is a ZIP archive of XML files. Choose your approach by task:
| Task | Approach |
|---|---|
| Create a new document | Write a docx (npm) script — see gotchas below |
| Edit an existing document | unzip → edit word/document.xml → zip (docx-js cannot open existing files) |
| Read content | pandoc -t markdown file.docx |
Script paths below are relative to this skill's directory.
docx is preinstalled — do not run npm install first; write the script and require('docx') directly. Only if that require fails: npm install docx. The model knows the API; these are the footguns:
page: { size: { width: 12240, height: 15840 } } (DXA; 1440 = 1″).orientation: PageOrientation.LANDSCAPE — docx-js swaps width/height internally.columnWidths on the table AND width on every cell, both in WidthType.DXA (PERCENTAGE breaks in Google Docs). Column widths must sum to the table width.ShadingType.CLEAR, never SOLID (renders black).• literally; use a numbering config with LevelFormat.BULLET.ImageRun requires type: ("png", "jpg", …).PageBreak must be inside a Paragraph.\n — use separate Paragraph elements.HeadingLevel.*; custom heading styles need outlineLevel set or they won't appear.PositionalTab (alignment: PositionalTabAlignment.RIGHT, leader: PositionalTabLeader.DOT) inside a TextRun, not literal . or space padding.After writing a .docx, render it and look at it:
python scripts/office/soffice.py --headless --convert-to pdf output.docx
pdftoppm -jpeg -r 100 output.pdf page
ls page-*.jpg # then Read the images
pdftoppm zero-pads page numbers to the width of the page count (page-01.jpg…page-12.jpg).
Legacy .doc files must be converted first: python scripts/office/soffice.py --headless --convert-to docx file.doc.
unzip -q doc.docx -d unpacked/
find unpacked -type l -delete # strip symlink entries — docx from external parties is untrusted
python scripts/merge_runs.py unpacked/ # coalesce fragmented runs so text is findable
# edit unpacked/word/document.xml in place — do NOT reformat or pretty-print
(cd unpacked && rm -f ../out.docx && zip -Xr ../out.docx .)
python scripts/office/validate.py out.docx --original doc.docx # XSD checks; --auto-repair fixes common issues
# redlining? add --author "<the name you redlined under>" to check every edit is tracked
Word splits text across many <w:r> runs (revision ids, spell-check markers), so a phrase you can see in the document often doesn't exist as a contiguous string in the XML. merge_runs.py merges adjacent identically-formatted runs in word/document.xml without changing content or rendering; it also accepts a .docx directly (python scripts/merge_runs.py doc.docx -o merged.docx).
…
帮助你构建、调试并优化 Claude API 与 Anthropic SDK 应用
引导用户协作撰写文档、方案与技术规格,并通过迭代完善内容质量。
帮助用户设计并生成高质量、可生产的前端界面与网页组件代码
处理PDF文档的读取提取、合并拆分、表单填写与OCR识别等任务
用于创建、编辑与优化AI技能,并评测其效果与触发准确性。
帮助用户制作适配 Slack 的动画 GIF,并检查规格与动画效果。
用于创建、编辑和分析Word文档,支持修订、批注与格式保留。
帮助用户规范排版中文 Word 文档,快速生成专业统一的版式效果
通过 Markdown 中转统一读写编辑 Office 与 PDF 文档,并保留原有格式。
用自然语言生成办公文档与表格演示,并为 Word 文档提供 AI 审阅意见。
帮助用户自动创建、编辑、转换并模板化多种 Office 与 PDF 邮件文档。
创建、读取、编辑与整理 PPTX 演示文稿及其中的文本和备注内容。