Skip to content
Skills Library
Documents & office · Conversion & formats

office

/office

创建、读取、修改并校验 Word(docx)/ Excel(xlsx)/ PowerPoint(pptx)文档。当输入是这三类文件,或用户要求产出/修改文档、表格、演示文稿时使用。老式格式(.doc/.xls/.ppt)与 WPS 专有格式用 kind=com 老格式分册。

Licence
Apache-2.0
Last repository change
06.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 06.11.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/check_office.py

What it does and when to use it

创建、读取、修改并校验 Word(docx)/ Excel(xlsx)/ PowerPoint(pptx)文档。当输入是这三类文件,或用户要求产出/修改文档、表格、演示文稿时使用。老式格式(.doc/.xls/.ppt)与 WPS 专有格式用 kind=com 老格式分册。

Original author description

创建、读取、修改并校验 Word(docx)/ Excel(xlsx)/ PowerPoint(pptx)文档。当输入是这三类文件,或用户要求产出/修改文档、表格、演示文稿时使用。老式格式(.doc/.xls/.ppt)与 WPS 专有格式用 kind=com 老格式分册。

How it works

  1. 通用纪律
  2. docx 分册要点
  3. xlsx 分册要点
  4. pptx 分册要点
  5. com 分册要点(老式格式与 WPS 文档)
  6. 结构校验
Original SKILL.md headings · 75 lines, 205 words
SKILL.md preview
---
name: office
description: 创建、读取、修改并校验 Word(docx)/ Excel(xlsx)/ PowerPoint(pptx)文档。当输入是这三类文件,或用户要求产出/修改文档、表格、演示文稿时使用。老式格式(.doc/.xls/.ppt)与 WPS 专有格式用 kind=com 老格式分册。
---

# Office 文档技能

三个文档族分别使用:docx → `python-docx`;xlsx → `openpyxl`;
pptx → `python-pptx`。由助手的 `office_skill` 工具获取对应分册要点,
然后用 `run_python` 执行 Python 实际操作(`run_command` 也可用)。

## 通用纪律

- 源脚本、中间文件、成品都放在任务工作区内;技能目录是只读资源。
- 修改既有文件前,先遍历结构(段落/表格/节/页)看清再动手;
  用户没要求重设计时,保留原有样式。
- **docx / pptx 动手前先出 MD 草稿**(xlsx 不需要):新建整份文档
  先给大纲草稿(每节/每页讲什么),修改既有文档先给修改点清单
  (改哪里、改成什么样),交用户过目、同意后再动手;只有用户
  明确说「不用确认、直接做」的小改动才可跳过。
- 保存到新文件,除非用户明确要求原地修改。
- **生成后必须跑结构校验**(见下),校验通过才算完成。
- 校验器只保证包结构与文字内容;分页、截断、字体渲染它管不了,
  交付前把摘要与用户需求对一遍。

## docx 分册要点

- 直接改 `paragraph.text` 会丢掉 run 级格式;要保格式就改具体的 run。
- 中文必须同时设置 `run.font.name` 与东亚字体(rPr.rFonts 的 w:eastAsia),
  只写字体名不保证字形生效。
- 表格按所在节页面宽度设列宽;注意合并单元格与嵌套表。
- python-docx 不做分页与渲染;不要把普通替换谎报为"修订"。

## xlsx 分册要点

- openpyxl 读写同一工作簿,保留公式与格式;公式不会被计算——
  要读"计算结果"需 `data_only=True` 打开(前提是文件被 Excel 存过)。
- 大表先看 `ws.dimensions` / `max_row`,不要整表灌进上下文。
- 样式在单元格对象上设置;合并用 `ws.merge_cells`。

## pptx 分册要点

- 版式页:`slide_layouts[0]`=标题页、`[1]`=标题+内容;文本在
  shape.text_frame 的 paragraph/run 层级里。
- 图片 `add_picture` 的坐标单位是 EMU(914400 每英寸)。

## com 分册要点(老式格式与 WPS 文档)

适用:python 库读不了的老式 Office 格式(.doc/.xls/.ppt)与 WPS 专有
格式(.wps/.et/.dps)——用本机已装的 Office/WPS 软件的 COM 口处理。
本分册由 office_skill(kind=com) 提供,自动装配 pywin32。

- **run_python 必须带 `com: true` 参数**(如 `{"code": "...", "com": true}`)。
  该参数不在工具 schema 里,是本分册的专用执行通道:置 true 时脚本绕过
  OS 沙箱在宿主直接执行——COM 在沙箱内无法运行,不带此参数 Dispatch 必
  挂起或报错,不要硬试。**仅限 COM 驱动 Office/WPS 的脚本使用,其他脚本
  一律不带**;全电脑只读档下该通道不可用。
- ProgID:Word=`Word.Application`、Excel=`Excel.Application`、
  PPT=`PowerPoint.Application`;WPS 文字/表格/演示=`KWPS.Application` /
  `Ket.Application` / `KWPP.Application`(拿不准用 com-probe 技能探测)。
  报「无效的类字符串」= 该软件未装或 ProgID 不对,换一个或如实告知用户。
- 纪律:`Visible=False`、`DisplayAlerts=False`;try/finally 里必须
  `Quit()`(漏了会残留 WINWORD/WPS 进程占住文件句柄);改既有文件前先
  snapshot_file 打快照。
- 常规套路:老 .doc 先 `SaveAs` 另存 .docx(wdFormatXMLDocument=16)、
  .xls 另存 .xlsx(xlWorkbookDefault=51),再交给 python-docx/openpyxl 处理;
  转换必有细节损耗,重要版式先向用户说明。

## 结构校验

生成/修改后对本文件执行(由 `office_skill` 工具返回的命令为准):

```text
<python> <技能目录>/office/scripts/check_office.py <文档> --contains 必须出现的文字
```

校验 ZIP 完整性、关键部件 XML、关系文件,并统计 docx 段落/表格/节、
xlsx 工作表与单元格、pptx 页与形状。退出码 0 = 通过。
Files in this package (3)
  • SKILL.md 4 KB
  • manifest.json 1 KB
  • scripts/check_office.py 6 KB

Versions

RepositoryScoreLicence
This page · touzi0/jx-assistant100Apache-2.0
lynricsy/hyperskills100MIT
Q00jkf/pixel-office96MIT
okou-ai/okou-skills86MIT

Database snapshot: 13.11.2026 · package version ffaf34426975 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 98office-file-process
    处理 Office 文档的一站式 skill:Word(.doc/.docx/.dotx)、Excel(.xls/.xlsx/.xlsm/.csv)、PowerPoint(.ppt/.pptx/.potx) 的创建、读取、编辑、提取、转换、校验。触发:『读取 word 文档』『提取 excel 内容』『看 ppt 讲了什么』、.doc 老格式打不开、生成/编辑 Word 报告/合同/模板、制作幻灯片/deck/演示文稿、写带公式的电子表格。读取优先 pandoc/markitdown 等官方工具,环境没有则走 Windows Office COM…
  • 85office-parser
    Parse Microsoft Office documents — Word (.docx), PowerPoint (.pptx), and Excel (.xlsx) — with streaming extraction and chunking. Use when working with Office documents, spreadsheets, presentations, or when the user mentions docx, pptx, xlsx, Word, Excel, PowerPoint, Office files.
  • 100wps-cli
    通过 WPS Office COM 自动化操作 Word/Excel/PPT/PDF 文档。76 条 CLI 命令,100% 格式保真,--json 输出适配 AI Agent。When you need to: create/edit Word documents (.docx), manipulate Excel spreadsheets (.xlsx) with formulas/charts/data-validation, build PowerPoint presentations (.pptx), process PDF files,…
  • 88memory-office-docs
    Use when 创建/修改/验证 Word、Excel、PPT、PDF 等 Office 文档及生成代码:docx-js、openpyxl、python-pptx、PyMuPDF、OMML 公式、soffice/LibreOffice 转换、mupdf 渲染、批量插图、教学讲义与报告生成。遇到 docx 打开报错、Excel 写入异常、PDF/中文字体问题、文档验证超时等踩坑时使用。含用户长期沉淀的文档生成经验。
  • 100docview
    Show Word, Excel, PowerPoint, WPS, Pages/Keynote/Numbers, CSV and PDF files with their original layout inside the agent's own side panel or preview pane, instead of launching WPS, Microsoft Office or Preview. Use whenever the user asks to open, view, preview, read or "show me" a…
  • 90office-documents
    Create, edit and convert Word, Excel, PowerPoint and PDF artifacts with format-aware verification. Use when producing docx, xlsx, pptx or PDF files; preserve templates and actual document structure, and render or recalculate before delivery.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.