跳到正文
Skillpedia
PDF、Word 与幻灯片260k · #610

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

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

可以这样问 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 with soffice --headless --convert-to docx|pptx|xlsx old-file when LibreOffice is installed.
  • Not for .odt/.odp/.ods, or WYSIWYG layout work.

Prerequisites

  • Python 3.10+ with python-docx, python-pptx, and openpyxl (import names docx, pptx, openpyxl).

  • Pick the interpreter with terminal. Use python when it already imports the libraries (the Hermes Docker image ships them). Otherwise, when hermes is 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 --help
    

    Run 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. Never pip install into the interpreter that runs Hermes or into the hermes pm environment one; Hermes owns both.

  • Optional: LibreOffice (soffice) for PDF export, Excel recalculation, and slide rendering, plus poppler (pdftoppm or pdftocairo) 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。

详情

作者的原始描述

Create, read, and edit Word, PowerPoint, and Excel files.

repo: NousResearch/hermes-agent

热度

GitHub 星标
260k
排名
#610
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能