office-format
/office-format
办公文档处理规范:读 xlsx/docx/pptx/pdf 一律用 office_read,生成 Excel 一律用 office_write 并自动套用统一样式;报告与纪要先以 Markdown 交付。当用户提到 Excel 表格、Word 文档、PPT、PDF,或要求整理表格、生成报表、撰写周报纪要时使用。
- Author
- fengchen122123-sudo ↗
- Repository
- xingyao-y-code ↗
- Licence
- MIT
- Last repository change
- 13.11.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
办公文档处理规范:读 xlsx/docx/pptx/pdf 一律用 office_read,生成 Excel 一律用 office_write 并自动套用统一样式;报告与纪要先以 Markdown 交付。当用户提到 Excel 表格、Word 文档、PPT、PDF,或要求整理表格、生成报表、撰写周报纪要时使用。
Original author description
办公文档处理规范:读 xlsx/docx/pptx/pdf 一律用 office_read,生成 Excel 一律用 office_write 并自动套用统一样式;报告与纪要先以 Markdown 交付。当用户提到 Excel 表格、Word 文档、PPT、PDF,或要求整理表格、生成报表、撰写周报纪要时使用。
How it works
- 一、先读再写
- 二、写入走 officewrite
- 三、Word / PPT 暂不直出
- 四、常见错误
- 五、交付前自检
SKILL.md preview
---
name: office-format
description: 办公文档处理规范:读 xlsx/docx/pptx/pdf 一律用 office_read,生成 Excel 一律用 office_write 并自动套用统一样式;报告与纪要先以 Markdown 交付。当用户提到 Excel 表格、Word 文档、PPT、PDF,或要求整理表格、生成报表、撰写周报纪要时使用。
triggers: Excel,表格,报表,周报,会议纪要,Word,PPT,PDF,办公文档,office,整理表格
version: 1.0.0
---
# 办公文档处理规范
星瑶不是办公套件,是帮你把活干完的搭档。判断标准只有一条:**产物交出去能不能直接用**,不是「能不能生成文件」。
## 一、先读再写
涉及已有文件的办公任务,第一步都是 `office_read`:
| 用户说 | 先做什么 |
|---|---|
| 「整理一下这个表格」 | `office_read` 读出全部工作表 |
| 「参考去年的模板」 | `office_read` 读模板结构(表头、列顺序、汇总行位置) |
| 「这份 PDF 里写了啥」 | `office_read` 提取全文,再总结 |
| 「把这堆数据做成周报」 | 先确认数据来源文件,`office_read` 读出来再加工 |
**不要用 `read_file` 读 xlsx / docx / pptx / pdf**——二进制文件读出来是乱码。
大表要控制读取量:`sheet` 指定工作表、`max_rows` 限制行数,别一次把几万行拉进上下文。
## 二、写入走 office_write
生成 Excel 时一律用 `office_write`,不要自己拼 openpyxl 脚本——工具里已经内置了验证过的样式规范:
- 表头:蓝底(#2563EB)白字、加粗、居中、自动换行
- 正文:微软雅黑 10.5、细边框、偶数行浅灰斑马纹
- 列宽:按显示宽度自适应(中文按 2 计),下限 8、上限 40
- 交互:冻结首行、首行自动筛选
- 打印:横向、缩放到一页宽、跨页重复表头
数据结构:`sheets` 是数组,每个工作表 `{name, rows}`,`rows` 是二维数组,第一行当表头。
```json
{
"path": "工单汇总.xlsx",
"sheets": [
{"name": "工单", "rows": [["工单号", "产品", "数量"], ["WO-001", "减速机壳体", 120]]},
{"name": "汇总", "rows": [["状态", "数量"], ["在制", 1]]}
]
}
```
**覆盖保护**:目标文件已存在时默认拒绝写入。要改旧表,正确流程是 `office_read` 读出 → 在内存里改 → `overwrite=true` 整体重写。直接覆盖前必须先告诉用户会丢内容。
## 三、Word / PPT 暂不直出
- **报告、纪要、方案**:先用 Markdown 交付。结构清晰、随时能改、能直接进公众号或文档库
- **用户明确要 Word 文件**:说明这是当前能力边界,让用户决定用 Markdown 还是手工转
- **PPT**:只给大纲 + 每页要点 + 讲稿,不生成 .pptx。版式设计是审美活,生成的模板通常还不如用户自己套
## 四、常见错误
| 错误 | 正确做法 |
|---|---|
| 用 `read_file` 读 .xlsx | 用 `office_read` |
| 自己写 openpyxl 脚本拼样式 | 用 `office_write`,样式已内置 |
| 大表一次全读进上下文 | `sheet` 指定工作表、`max_rows` 限制行数 |
| 直接覆盖已有文件 | 先读出内容再重写,或明确告知用户会覆盖 |
| 把 CSV 当 Excel 交付 | CSV 没有样式、没有多工作表,用户要的是 .xlsx |
## 五、交付前自检
1. 文件真的写出来了吗(看返回的路径与行数)
2. 表头和数据对得上吗(列数一致、没有错位)
3. 数字是数字还是文本(文本会左对齐且影响后续计算)
4. 要不要再 `office_read` 读一遍确认
Versions
The database has no other skills named office-format.
Database snapshot: 13.11.2026 · package version f35c02be2d8f (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 90office-documents
Create, edit and convert Word, Excel, PowerPoint and PDF artifacts with format-aware verification. Use when producing docx, xlsx, pptx or PDF files; preserve templates and actual document structure, and render or recalculate before delivery. - 88memory-office-docs
Use when 创建/修改/验证 Word、Excel、PPT、PDF 等 Office 文档及生成代码:docx-js、openpyxl、python-pptx、PyMuPDF、OMML 公式、soffice/LibreOffice 转换、mupdf 渲染、批量插图、教学讲义与报告生成。遇到 docx 打开报错、Excel 写入异常、PDF/中文字体问题、文档验证超时等踩坑时使用。含用户长期沉淀的文档生成经验。 - 85office-parser
Parse Microsoft Office documents — Word (.docx), PowerPoint (.pptx), and Excel (.xlsx) — with streaming extraction and chunking. Use when working with Office documents, spreadsheets, presentations, or when the user mentions docx, pptx, xlsx, Word, Excel, PowerPoint, Office files. - 100office-to-md
Convert Office documents (Word, Excel, PowerPoint, PDF) to Markdown format. ONLY use this skill when the user explicitly requests to CONVERT, TRANSFORM or PARSE a specific office file into Markdown. Do NOT trigger for general questions, documentation reading, or discussions about files. - 98office-file-process
处理 Office 文档的一站式 skill:Word(.doc/.docx/.dotx)、Excel(.xls/.xlsx/.xlsm/.csv)、PowerPoint(.ppt/.pptx/.potx) 的创建、读取、编辑、提取、转换、校验。触发:『读取 word 文档』『提取 excel 内容』『看 ppt 讲了什么』、.doc 老格式打不开、生成/编辑 Word 报告/合同/模板、制作幻灯片/deck/演示文稿、写带公式的电子表格。读取优先 pandoc/markitdown 等官方工具,环境没有则走 Windows Office COM… - 95Documents
Read, write, convert, and analyze documents — routes to PDF, DOCX, XLSX, PPTX sub-skills for creation, editing, extraction, and format conversion. USE WHEN document, process file, create document, convert format, extract text, PDF, DOCX, XLSX, PPTX, Word, Excel, spreadsheet,…