Noah

Office-Editor

办公效率v1.0.1
作者:Noah更新于 2026-05-11共 2 个版本 · 最新版本发布于 2026-03-12office-editor@clawhub_noah-wu66/office-editor
文档处理表格处理PPT 生成#Spreadsheets#Document

据 AlphaMoat 统计,截至 2026-09,Office-Editor 累计下载 4,073 次、获 2 个星标,在全部 5,078 个 AI 技能中排名第 2,487 位,在「办公效率」分类(435 个)中排名第 206 位。

累计安装
363
累计下载
4,073
星标
2
全站排名
#2,487
全站前 49% · 「办公效率」前 48%
平台累计安装累计下载星标评论
ClawHub ↗582,160--
SkillHub ↗3634,0732—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

按格式选择 python-docx、openpyxl 或 python-pptx,先检查导入,缺包时报告而不自动安装。电子表格的相关任务可选用 Pandas 和 Pillow。优先结构修改再排版,使用明确输出文件名,除非明确要求覆盖,否则另存以保留原件。使用前需审阅输出文件。

资料发布于 2026-10-27

可以用来做什么

  • 以明确输出路径创建或修改 Office 文件

什么时候用

  • 文档、工作簿或演示文件需要本地 Python 编辑时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

检查所需库,提出结构调整,并另存结果以保留原件。

月度数据趋势

累计下载4,073
1,0852,6904,2942026-03 · 累计下载 1,3062026-05 · 累计下载 2,3192026-06 · 累计下载 2,5132026-07 · 累计下载 2,8272026-08 · 累计下载 3,2862026-09 · 累计下载 4,07326-0326-09
星标2
0122026-03 · 星标 -2026-05 · 星标 22026-06 · 星标 22026-07 · 星标 22026-08 · 星标 22026-09 · 星标 226-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-094,073—2
2026-083,286+16.2%2
2026-072,827+12.5%2
2026-062,513+8.4%2
2026-052,319—2
2026-031,306—-

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

5.7 KB · ClawHub v1.0.1
---
name: office-editor
description: Create or modify Word (.docx), Excel (.xlsx), and PowerPoint (.pptx) files. Use when the user mentions Office, Word, Excel, PowerPoint, docx, xlsx, pptx, spreadsheets, presentations, or document export. Check dependencies first, and if a core library is missing, report it directly instead of installing anything automatically.
user-invocable: true
metadata: {"openclaw":{"emoji":"📄"}}
---

# Office Document Handling

Use this skill for `.docx`, `.xlsx`, and `.pptx` files. Identify the file type first, check the required dependencies next, and then decide whether to create a new file or modify an existing one.
展开全部(共 181 行)

## Follow These Rules First

1. Confirm the target format first: Word uses `python-docx`, Excel uses `openpyxl`, and PowerPoint uses `python-pptx`.
2. Check whether the required dependency can be imported. If something is missing, tell the user exactly which package is required. Do not run `pip`, `pip3`, `python -m pip`, `sudo`, or similar install commands automatically.
3. When editing an existing file, preserve the original by default and save the result as a new file. Only overwrite the original if the user explicitly asks for that.
4. Do structural edits before visual fine-tuning. Avoid writing a large amount of low-value formatting code upfront.
5. Only open the matching document in `references/` when an advanced API is needed. Do not load every reference file into context at once.

## Dependency Tiers

### Core Dependencies

- `python-docx`: for Word documents.
- `openpyxl`: for Excel workbooks.
- `python-pptx`: for PowerPoint presentations.

### Optional Dependencies

- `pandas`: only needed when converting between DataFrames and Excel.
- `pillow`: only needed when inserting images into Excel.

## Check Dependencies

Use a read-only import check like this. If the check fails, stop implementation and report the missing package(s) directly.

```python
import importlib

PACKAGE_MAP = {
    "docx": "python-docx",
    "openpyxl": "openpyxl",
    "pptx": "python-pptx",
    "pandas": "pandas",
    "PIL": "pillow",
}

missing = []
for module_name, package_name in PACKAGE_MAP.items():
    try:
        importlib.import_module(module_name)
    except ModuleNotFoundError:
        missing.append(package_name)

print(missing)
```

Choose what to check based on the task:

- `.docx` tasks: check `docx`
- `.xlsx` tasks: check `openpyxl`
- `.pptx` tasks: check `pptx`
- DataFrame-related Excel tasks: also check `pandas`
- Excel image tasks: also check `PIL`

## Handle Word Documents

Use `python-docx` for `.docx` files.

### Create a New File

```python
from docx import Document

document = Document()
document.add_heading("Document Title", level=1)
document.add_paragraph("This is a paragraph.")
document.save("new_doc.docx")
```

### Modify an Existing File

```python
from docx import Document

document = Document("existing_doc.docx")
document.add_paragraph("Appended content")
document.save("updated_doc.docx")
```

### Read These Resources First

- Core API summary: `{baseDir}/references/docx_api_summary.md`
- Create example: `{baseDir}/scripts/create_basic_doc.py`
- Edit example: `{baseDir}/scripts/edit_existing_doc.py`

## Handle Excel Workbooks

Use `openpyxl` for `.xlsx` files.

### Create a New File

```python
from openpyxl import Workbook

wb = Workbook()
ws = wb.active
ws.title = "Data"
ws["A1"] = "Hello"
ws.append(["Data 1", "Data 2", "Data 3"])
wb.save("new_workbook.xlsx")
```

### Modify an Existing File

```python
from openpyxl import load_workbook

wb = load_workbook("existing_workbook.xlsx")
ws = wb["Sheet1"]
ws["A1"] = "Updated value"
wb.save("updated_workbook.xlsx")
```

### Read These Resources First

- Create example: `{baseDir}/scripts/create_basic_workbook.py`
- Charts: `{baseDir}/references/xlsx_charts.md`
- Advanced features: `{baseDir}/references/xlsx_features.md`
- DataFrame integration: `{baseDir}/references/xlsx_pandas.md`

## Handle PowerPoint Presentations

Use `python-pptx` for `.pptx` files.

### Create a New File

```python
from pptx import Presentation

prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[1])
slide.shapes.title.text = "Slide Title"
slide.placeholders[1].text = "This is the content placeholder."
prs.save("new_presentation.pptx")
```

### Modify an Existing File

```python
from pptx import Presentation

prs = Presentation("existing_presentation.pptx")
slide = prs.slides.add_slide(prs.slide_layouts[1])
slide.shapes.title.text = "New Slide"
slide.placeholders[1].text = "Additional content"
prs.save("updated_presentation.pptx")
```

### Read These Resources First

- API quick reference: `{baseDir}/references/pptx_api_reference.md`
- Chart guide: `{baseDir}/references/pptx_chart_guide.md`
- Full example: `{baseDir}/scripts/create_presentation.py`

## Resource Selection Rules

- Basic Word file creation only: start with `{baseDir}/scripts/create_basic_doc.py`
- Modify an existing Word file: start with `{baseDir}/scripts/edit_existing_doc.py`
- Basic Excel creation only: start with `{baseDir}/scripts/create_basic_workbook.py`
- Excel charts or conditional formatting: read `{baseDir}/references/xlsx_charts.md` or `{baseDir}/references/xlsx_features.md` first
- DataFrame, CSV to Excel, or worksheet analysis: confirm `pandas` is available, then read `{baseDir}/references/xlsx_pandas.md`
- Basic PowerPoint generation only: start with `{baseDir}/scripts/create_presentation.py`
- PowerPoint charts: read `{baseDir}/references/pptx_chart_guide.md` first

## Output Rules

- Always save to a concrete target filename. Do not leave changes only in memory.
- If the user does not provide a filename, use a clear default such as `report.docx`, `budget.xlsx`, or `deck.pptx`.
- For edits to existing files, default to `updated_*.ext` to avoid accidental overwrites.

「办公效率」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。