用于创建、编辑与整理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 | unpack → 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.title, heading1, heading2…) in styles.default: heading1: { run: { font: "Arial", size: 32, bold: true }, paragraph: { spacing: { before: 240, after: 120 }, keepNext: true } }. Every level needs its own font (even with a document default), before and after (even if 0) and keepNext: the built-in styles set none of them.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:
zip -d output.docx '*/' >/dev/null || true # drop the ZIP's folder entries: Word has refused a file that has them when opened through a cloud co-editing service
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.
python3 -c "import sys,zipfile; zipfile.ZipFile(sys.argv[1]).extractall('unpacked')" doc.docx # not unzip, which restores symlinks — 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 -XrDy ../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).
…
用 p5.js 与可控随机参数生成原创算法艺术与交互式视觉作品
用于创建、编辑与优化AI技能,并评测其效果与触发准确性。
帮助用户制作适配 Slack 的动画 GIF,并检查规格与动画效果。
帮助用户用 React、Tailwind 与 shadcn/ui 构建复杂网页组件与交互原型
处理或生成电子表格文件,支持清洗、编辑、转换与公式图表操作。
帮助用户设计并生成高质量、可生产的前端界面与网页组件代码
用于创建、编辑和分析Word文档,支持修订、批注与格式保留。
通过 Markdown 中转统一读写编辑 Office 与 PDF 文档,并保留原有格式。
将 Markdown 快速转换为可定制样式的 Word 文档,便于交付与排版。
以保留原有格式的方式精细编辑 Word 与 ODT 文档内容。
帮助用户生成带企业模板与页眉页脚的专业 Word 文档。
创建、读取、编辑与整理 PPTX 演示文稿及其中的文本和备注内容。