microsoft-office
它能做什么
这项技能让你的 AI 使用 Python 工具制作和修改 Word 文档、PowerPoint 演示文稿和 Excel 工作簿。适合需要由 AI 制作或更新 Office 文件的人。
适用场景
- ✓你想制作或编辑 Word 报告、信件或模板的时候。
- ✓你想制作、更新 PowerPoint 演示文稿或为其添加演讲者备注的时候。
- ✓你想创建带有公式、图表或格式化表格的 Excel 工作簿的时候。
技能链接
https://github.com/NousResearch/hermes-agent/blob/main/skills/productivity/microsoft-office/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请创建一个 Excel 工作簿,包含三个工作表,分别用于月度预算、支出和储蓄,并带有合计和图表。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能使用 Python 库直接写入 .docx、.pptx 和 .xlsx 文件。无需安装 Microsoft Office,不过在转换旧格式文件或渲染页面时需要 LibreOffice。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Microsoft Office Skill
Create, read, edit, and template Word (.docx), PowerPoint (.pptx), and
Excel (.xlsx, .csv) files offline with small Python CLIs built on
python-docx, python-pptx, and openpyxl. Office itself is never needed. It does
not open legacy binary formats (.doc, .ppt, .xls) and does not render
pages without LibreOffice.
When to Use
Pick the format, then read its reference with skill_view before working:
| File | Reference | Typical asks |
|---|---|---|
.docx |
references/word.md |
reports, letters, contracts, {{token}} templates, tracked changes, comments |
.pptx |
references/powerpoint.md |
pitch decks, brand-template decks, chart refreshes, speaker notes, slide PNGs |
.xlsx, .csv |
references/excel.md |
styled multi-sheet workbooks, formulas, charts, CSV conversion, row/column restructures |
Deeper notes: references/revisions-and-comments.md (Word review markup) and
references/restructuring.md (Excel reference shifting).
- Not for
.doc/.ppt/.xls: convert first withsoffice --headless --convert-to docx|pptx|xlsx old-filewhen LibreOffice is installed. - Not for
.odt/.odp/.ods, or WYSIWYG layout work.
Prerequisites
Python 3.10+ with
python-docx,python-pptx, andopenpyxl(import namesdocx,pptx,openpyxl).Pick the interpreter with
terminal. Usepythonwhen it already imports the libraries (the Hermes Docker image ships them). Otherwise, whenhermesis on PATH, let Hermes build its shared, pinned documents environment under the Hermes home: it survives container restarts, never touches the Hermes install itself, and is safe to run from several agents at once. When it is not (the terminal runs in a Docker sandbox, which has no Hermes), the block builds a venv in the sandbox home with the same pinned versions. Use this exact block in every document skill so they all share one environment:python -c "import docx, pptx, openpyxl" 2>/dev/null && PY=python || if command -v hermes >/dev/null 2>&1; then PY="$(hermes pm environment documents --extra documents --extra documents-pdf)" else PY="$HOME/.cache/hermes-docs-venv/bin/python" "$PY" -c "import docx, openpyxl, pptx, reportlab, pypdf, pdfplumber, pypdfium2" 2>/dev/null || ( # Safe to run from several agents at once: each caller builds a private venv, # a symlink publishes the first finished one atomically, the others delete theirs; # a published build is replaced and deleted only while it still fails to import. mkdir -p "$HOME/.cache" && cd "$HOME/.cache" && stage="$(mktemp -d hermes-docs-venv.XXXXXX)" || exit 1 old="$(readlink hermes-docs-venv)" # the published build, if any (another agent may have just published it) python3 -m venv "$stage" && "$stage/bin/python" -m pip install -q --disable-pip-version-check python-docx==1.2.0 openpyxl==3.1.5 python-pptx==1.0.2 reportlab==5.1.0 pypdf==6.21.2 pdfplumber==0.11.10 pypdfium2==5.14.0 && "$stage/bin/python" -c "import docx, openpyxl, pptx, reportlab, pypdf, pdfplumber, pypdfium2" && if [ -z "$old" ]; then python3 -c 'import os, sys; os.symlink(*sys.argv[1:])' "$stage" hermes-docs-venv elif [ "$(readlink hermes-docs-venv)" = "$old" ] && ! "$old/bin/python" -c "import docx, openpyxl, pptx, reportlab, pypdf, pdfplumber, pypdfium2" 2>/dev/null; then ln -s "$stage" "$stage.lnk" && python3 -c 'import os, sys; os.replace(*sys.argv[1:])' "$stage.lnk" hermes-docs-venv && case "$old" in hermes-docs-venv.??????) rm -rf "$old" ;; esac fi 2>/dev/null [ "$(readlink hermes-docs-venv)" = "$stage" ] || rm -rf "$stage" "$stage.lnk" ) fi export PY "$PY" scripts/docx_create.py --helpRun every helper with
"$PY". In PowerShell (Hermes runs on that host, so it is on PATH):$env:PY = hermes pm environment documents --extra documents --extra documents-pdf. Neverpip installinto the interpreter that runs Hermes or into thehermes pm environmentone; Hermes owns both.Optional: LibreOffice (
soffice) for PDF export, Excel recalculation, and slide rendering, plus poppler (pdftoppmorpdftocairo) for slide PNGs. The helpers that need them report what is missing and exit 0.
How to Run
Every helper lives in scripts/, is an argparse CLI with --help, prints
JSON to stdout, and exits non-zero on failure. Run them with terminal from
the skill
常见问题
它能打开旧版 Office 文件吗?
不能。技能说明它不能打开 .doc、.ppt 或 .xls 文件,这些文件必须先进行转换。
需要 Microsoft Office 吗?
不需要。技能说明它通过 Python 库离线工作,从不需要 Office 本身。
需要哪个 Python 版本?
技能要求 Python 3.10 或更新版本,并需要 python-docx、python-pptx 和 openpyxl。
详情
热度
- GitHub 星标
- 260k
- 排名
- #610
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-merge-conflict-arbiter
260k以中立第三方的身份,解决两个智能体分支之间的 git 合并冲突,为代码仓库生成一个合并结果。
antigravity-cli
260k指导你安装、更新和排查 Antigravity 命令行工具,包括其插件、登录和沙盒。
blackbox
260k让你的智能体把编程任务交给 Blackbox AI 命令行工具,它会运行多个 AI 模型并挑选最佳结果。
dynamic-workflow
260k教你的智能体把大量相似的工作保存为脚本批量运行,使只有经过验证的结果才返回主对话。