跳到正文
Skillpedia
PDF、Word 与幻灯片5.1k · #15052

office-tools

它能做什么

这是一套命令行工具,用于读取文档结构、进行有针对性的编辑、处理修订记录,以及检查文件包。适合需要谨慎编辑 Office 文件、又不想冒险整体重写的人。

适用场景

  • ✓当你想读取 Word、PowerPoint 或 Excel 文件的结构时。
  • ✓当你想接受或审阅 Word 文件中的修订或批注时。
  • ✓当你想检查 Office 文件中是否存在导致无法打开的问题时。

技能链接

https://github.com/Fei2411/DS-Bot/blob/main/ds-bot/src/office/skills/office-tools/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/Fei2411/DS-Bot/blob/main/ds-bot/src/office/skills/office-tools/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请检查我的 Word 报告是否存在导致无法打开的问题,并列出其中的批注。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体运行随附的工具,读取文件的内容块并检查其文件包。编辑内容会写入新文件,只有在你要求时才会原地修改,之后它会报告发现的问题。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Office tools

A bundled command line for the jobs the format skills cannot do safely: reading a document's structure with stable ids, repairing packages, targeted edits, tracked changes, layout findings, and contact sheets of rendered pages. Run every command through the Node and CLI paths in the runtime block at the end of this skill.

Every command accepts --json and prints {"ok":true,"data":…} for a run that completed, or {"ok":false,"error":{"code","message"}} when it failed. Findings are results, not failures: they land inside data.findings with ok still true, and the exit code carries them — 0 = ok, 1 = findings remain, 2 = usage or failure. Edits write a new file (-o out) or overwrite the input (--in-place); they never touch the input otherwise.

Commands

  • unpack <file> <dir> / pack <dir> <file> — extract a package to readable XML and repack it. pack --against <original> also runs check against the original.
  • check <file|dir> [--against <original>] [--fix] — only defects that make Office refuse a file or show a repair prompt. --against reports just the issues the original lacks. --fix repairs what is safe (xml:space, duplicate ids, content-type rows, dangling relationships).
  • docx read <file> [--changes] — body blocks as p1…, t1… in reading order, with paragraph style, tables as cell rows (merges noted), headers/footers, footnotes/endnotes, comments and the paragraph each anchors to. Text shows tracked changes accepted; --changes marks them inline ({+inserted (Ana)+}, {-deleted (Ana)-}, moves, format changes, deleted paragraph marks).
  • docx fields <file> — simple and complex fields with instruction and current result.
  • docx edit <file> (-o out|--in-place) --ops <json|@file> — one batch of ops, all-or-nothing, ids from docx read of the same file: replace (cross-run text/regex, keeps formatting), set_cell, set_field, insert, delete, comment, accept_changes, reject_changes.
  • pptx inventory <file> [--slides N…] — slide size, theme fonts, and every shape per slide: id, name, kind, placeholder, resolved box in inches (group transforms applied, layout/master placeholder inherited), text with run fonts and sizes, picture media.
  • pptx layout <file> [--autofit] — overlapping text boxes and shapes off the slide, from the same resolved boxes. --autofit sets a:normAutofit on the shapes found. Overflow inside a box still needs a render.
  • pptx slides <file> -o|--in-place --order 3,1,1,5 — reorder by current positions; a repeated position duplicates the slide (notes, charts and embedded workbooks copied); positions left out are removed.
  • pptx clean <file|dir> [--dry-run] — drop slides not in the list, unreachable parts, dangling relationships/Overrides, unreferenced media (also works on docx/xlsx).
  • xlsx inventory <file> — sheets (state, dimension, cell/formula counts, merges, tables, charts), defined names, every error cell with its formula, and a note when formulas have no cached value.
  • xlsx read <file> --sheet <name> [--range A1:H40] — a grid of cached values with formulas shown; dates as ISO.
  • sheet <png…|dir> -o <contact.png> [--cols 4] [--width 320] — one contact sheet of rendered pages, labelled with page numbers.

Workflows

Word — docx read for the ids → one docx edit batch over the opened document → docx read again to confirm → check --against <the untouched original> for anything left. Keep the original copy untouched (no --in-place on it).

PowerPoint — pptx inventory → edit (python-pptx through the format skill; pptx slides/pptx clean for structure) → pptx layout for overlap/off-slide findings → when office-render is in the catalog, render → sheet over the rendered images and look at the contact sheet before single slides → fix → recheck.

Excel — xlsx inventory → edit with openpyxl (format skill) → office-recalculate → xlsx inventory again and confirm no error cells and no uncached formulas.

XML edits — only through unpack, a real XML parser, and pack --against. Never sed or string-splice XML.

Finish line — check passes clean, pptx layout findings addressed or explained, the contact sheet looked at when rendering is available, and anything that could not be verified is said in the report.

Design rules for a new deck

One idea and one visual per slide. Titles state the point. One accent colour. A locked type scale. No card behind every paragraph. Draw

常见问题

它会修改我的原始文件吗?

除非你要求原地编辑,否则不会。编辑内容会输出到新文件中。

需要先安装吗?

不需要。该技能说明它可以离线工作,无需安装任何东西。

“发现”是什么意思?

发现是检查在文件中找到的问题。运行不会因此中止,问题会被报告出来。

详情

作者的原始描述

Inspect, check, and edit .docx/.pptx/.xlsx packages in place — block-level reading, comments, tracked changes, slide inventory and layout checks, slide reorder/duplicate/cleanup, workbook errors, package checks, contact sheets. Works offline; nothing to install.

repo: Fei2411/DS-Bot

热度

GitHub 星标
5.1k
排名
#15052
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能