技能图谱SKILLSGROVE
技能图谱/办公文档/workspace-dex/open-agent/office

office

安装

$npx skills add https://github.com/workspace-dex/open-agent --skill office
$git clone --depth 1 https://github.com/workspace-dex/open-agent.git /tmp/open-agent && mkdir -p ~/.claude/skills && cp -r /tmp/open-agent/skills/office ~/.claude/skills/office
请帮我安装这个 Agent Skill:https://github.com/workspace-dex/open-agent/tree/f6d53458f4014e5e8b301a682f2b5d4f5e3f057e/skills/office ,先阅读它的 SKILL.md 和脚本,确认安全后再安装到我的技能目录。

简介

原文描述 · MITOffice document tools - docx, xlsx, pptx, pdf creation/editing
以下 SKILL.md 内容转载自 workspace-dex/open-agent(提交 f6d5345),依据 MIT 许可证转载正文(文字未改动;仅省略文件头元数据、将图片显示为链接,超长内容会截断);版权归 2026 Shakib S. 所有。许可证:LICENSE。仅展示说明文件,附带脚本请在原仓库查看。

Office Documents Skill

Overview

Process Word, Excel, PowerPoint, and PDF files using command-line tools.

PDF (pdf)

# Install
pip install pypdf pdfplumber

# Extract text
python -c "
from pypdf import PdfReader
r = PdfReader('file.pdf')
print(f'Pages: {len(r.pages)}')
for p in r.pages:
    print(p.extract_text()[:500])
"

# Merge PDFs
python -c "
from pypdf import PdfWriter, PdfReader
w = PdfWriter()
for f in ['a.pdf', 'b.pdf']:
    r = PdfReader(f)
    for p in r.pages: w.add_page(p)
with open('merged.pdf', 'wb') as out: w.write(out)
"

Excel (xlsx)

# Install
pip install openpyxl pandas

# Create spreadsheet
python -c "
import openpyxl
wb = openpyxl.Workbook()
ws = wb.active
ws['A1'] = 'Name'
ws['B1'] = 'Value'
ws['A2'] = 'Item 1'
ws['B2'] = 100
wb.save('data.xlsx')
"

# Read with pandas
python -c "
import pandas as pd
df = pd.read_excel('data.xlsx')
print(df)
"

Word (docx)

# Install
pip install python-docx

# Create document
python -c "
from docx import Document
doc = Document()
doc.add_heading('Title', 0)
doc.add_paragraph('Content here')
doc.save('doc.docx')
"

PowerPoint (pptx)

# Install  
pip install python-pptx

# Create presentation
python -c "
from pptx import Presentation
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[0])
title = slide.shapes.title
title.text = 'Title'
prs.save('deck.pptx')
"
查看许可证全文(MIT)
MIT License

Copyright (c) 2026 Shakib S.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.