Skip to content
Skills Library
Documents & office · Building & coding

document

/document

Generate and inspect Office documents (DOCX, PPTX, XLSX). Generate by writing Python scripts that call python-docx, python-pptx, and openpyxl APIs directly. Inspect with `scrinium document inspect` to verify layout, content, and catch issues (overflow, missing elements). Use when the user wants to create Word reports, PowerPoint presentations, Excel data sheets, or inspect any Office document.

Repository
scrinium ↗
Licence
GPL-3.0
Last repository change
14.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 14.10.2026, without references to retired models or APIs.

Licence

GPL-3.0, otwarta.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: templates/starter/build_report.py

What it does and when to use it

Generate and inspect Office documents (DOCX, PPTX, XLSX). Generate by writing Python scripts that call python-docx, python-pptx, and openpyxl APIs directly. Inspect with `scrinium document inspect` to verify layout, content, and catch issues (overflow, missing elements). Use when the user wants to create Word reports, PowerPoint presentations, Excel data sheets, or inspect any Office document.

Original author description

Generate and inspect Office documents (DOCX, PPTX, XLSX). Generate by writing Python scripts that call python-docx, python-pptx, and openpyxl APIs directly. Inspect with `scrinium document inspect` to verify layout, content, and catch issues (overflow, missing elements). Use when the user wants to create Word reports, PowerPoint presentations, Excel data sheets, or inspect any Office document.

How it works

  1. 何时使用
  2. 核心思路
  3. PPT 主题与偏好
  4. 选型决策
  5. 执行逻辑(生成 → inspect 闭环)
  6. 文档检查(inspect)
  7. 可编辑副本与差异复核
  8. 与其他 skill 的组合
  9. 快捷方式
  10. 示例
Original SKILL.md headings · 131 lines, 502 words
SKILL.md preview
---
name: document
description: Generate and inspect Office documents (DOCX, PPTX, XLSX). Generate by writing Python scripts that call python-docx, python-pptx, and openpyxl APIs directly. Inspect with `scrinium document inspect` to verify layout, content, and catch issues (overflow, missing elements). Use when the user wants to create Word reports, PowerPoint presentations, Excel data sheets, or inspect any Office document.
version: 1.0.0
author: wszqkzqk/scrinium
license: GPL-3.0-or-later
tags: ["document", "docx", "pptx", "xlsx", "office", "report"]
---

# Office 文档生成与检查

直接用 Python API 生成 Word / PowerPoint / Excel 文档,并通过 `scrinium document inspect` 检查文档结构和布局。

## 何时使用

适用:
- 生成正式 Word 报告、简报、带 TOC 的综述文档
- 生成 PowerPoint 汇报 / 答辩幻灯片
- 生成带样式、筛选、图表的 Excel 数据表
- 检查任何 Office 文档的结构与布局问题(溢出、缺失元素)

不适用:
- 简单的 Markdown → DOCX 转换(用 `scrinium export docx`,见 `/export` skill)
- 纯 Markdown 写作(直接写 `.md` 即可,无需 Office 文档)

## 核心思路

**生成**:不要用 `scrinium export docx`(那个只是简单的 Markdown 转换器)。本 skill 直接编写 Python 脚本调用 Office 库 API,类似 draw skill 直接调用 Inkscape API 画图。

**检查**:生成后必须用 `scrinium document inspect <file>` 检查文档,确认布局、内容、图片尺寸无误,再交付给用户。

输出目录:`workspace/` 下(如 `workspace/reports/`、`workspace/figures/`)。

## PPT 主题与偏好

默认主题唯一定义在 `scrinium/presentation/theme.py` 的 `DEFAULT_THEME`。生成脚本从 `scrinium.presentation.pptx_style` 导入样式组件,在创建 presentation 前用 `configure_theme()` 配置;可从 `templates/starter/build_report.py` 复制最小示例开始。

用户的定制主题放在 `preferences/theme/<name>/theme.py`,通过 `replace(DEFAULT_THEME, ...)` 覆盖所需字段,Logo 等资源放在该主题自己的 `assets/` 下。生成的 PPTX 留在对应报告 workspace 的相应子目录。可选的逐页预览由报告根据当前环境自行安排,预览产物放在报告的 `preview/`。

用户要求新建主题时,先确认主题名称和本次希望定制的字体、主题色、Logo、页脚等内容,未指定的属性沿用默认主题,不必逐项追问。随后在对应主题目录中定义主题对象,把引用资源放入该主题的 `assets/`,并在报告生成脚本中导入该对象、传给 `configure_theme()`。

开始制作 PPT 前,优先参考当前自定义主题的 `preferences/theme/<name>/style-guide.md` 的指导,如果没有,参考 `scrinium/presentation/style-guide.md`。

## 选型决策

| 需求 | 格式 | 库 |
|------|------|-----|
| 报告 / 综述 / 简报 / 论文 | DOCX | `python-docx` |
| 汇报 / 演示 / 答辩 | PPTX | `python-pptx` |
| 数据表 / 统计 / 列表 | XLSX | `openpyxl` |

用户未指定时按内容性质选择,默认 DOCX。

**详细 API 速查与可运行模板见 [reference.md](reference.md)**(三个库的导入方式、文档结构模板、API 速查表、TOC 字段、表格样式、图表等),写生成脚本时按需加载,不必预读。

## 执行逻辑(生成 → inspect 闭环)

1. **判断输出格式**:按上表选型
2. **收集内容**:调用其他 skill/CLI 获取数据
   - `scrinium search` — 搜索论文
   - `scrinium show --layer 2/3` — 获取摘要/结论
   - `scrinium top-cited` — 高引论文
   - `scrinium topics <tag>` — 主题(标签)下的论文
   - `scrinium workspace show <name>` — 工作区论文列表
3. **生成图表**(如需要):用 draw skill 生成 PNG/SVG 到 `workspace/figures/`
4. **编写 Python 脚本**:参照 [reference.md](reference.md) 中对应库的模板与 API 速查,在一个脚本中完成全部操作
5. **输出到 `workspace/`**:
   ```
   workspace/
   └── reports/
       ├── research_brief.docx
       ├── presentation.pptx
       └── paper_stats.xlsx
   ```
6. **检查文档**:运行 `scrinium document inspect <file>` 检查生成结果
   - PPTX:确认图片未溢出、文字未超出容器、布局合理
   - DOCX:确认标题层级正确、表格完整、图片已嵌入
   - XLSX:确认数据完整、图表标题正确、冻结窗格生效
   - 如发现问题 → 修改脚本 → 重新生成 → 再次 inspect
7. **告知用户**输出路径

## 文档检查(inspect)

```bash
# 检查 PPTX:逐页输出 shape 位置/尺寸/文字/图片信息 + 溢出警告
scrinium document inspect presentation.pptx

# 检查 DOCX:段落/标题/表格/图片结构 + 样式摘要
scrinium document inspect report.docx

# 检查 XLSX:Sheet 概览 + 数据预览 + 图表列表
scrinium document inspect data.xlsx
```

**输出内容**:

| 格式 | 检查项 |
|------|--------|
| PPTX | 每页 shape 类型、位置(英寸)、尺寸、文字预览、图片大小、表格维度、**溢出检测** |
| DOCX | 标题层级、段落内容、表格结构、嵌入图片、样式统计 |
| XLSX | Sheet 列表、数据范围、冻结窗格、合并单元格、表头预览、数据预览、图表类型和标题 |

## 可编辑副本与差异复核

1. 运行 `scrinium document editable report.pptx` 准备用户可编辑副本;已有副本时先确认其中是否有人工修改。
2. 用户编辑后运行 `scrinium document diff report.pptx report_editable.pptx`(需要结构化结果时加 `--json`),查看文本、位置、字体与段落等属性、页序、增删、Notes,以及主题、母版、媒体和嵌入对象等包级差异;纯元数据单独标记。
3. 需要重新生成时,Agent 根据语义差异修改生成脚本;主题、母版、关系或嵌入对象等包级差异需人工定位。先构建候选文件并再次 diff,复核后才替换人工版本。

## 与其他 skill 的组合

| 组合 | 流程 |
|------|------|
| draw + document | draw 生成 PNG/SVG → `doc.add_picture()` 嵌入 DOCX/PPTX |
| search + document | 搜索结果 → 表格写入 DOCX/XLSX |
| literature-review + document | 生成综述内容 → 带 TOC 的正式 Word 文档 |
| paper-writing + document | 论文章节 → 排版完整的 Word 文件 |
| topics + document | 主题分析 → 可视化报告(PPTX 幻灯片) |

## 快捷方式

对于简单的 Markdown → DOCX 转换(不需要高级排版),仍可使用:
```bash
scrinium export docx --input file.md --output file.docx
```

## 示例

用户说:"帮我总结一下文献库,写个简报到 Word 文件"
→ 调用 `top-cited`、`topics`、`insights` 收集数据 → 参照 reference.md 写 python-docx 脚本生成带标题、目录、表格、图片的 DOCX

用户说:"把 phd-thesis 工作区的论文做成 PPT 给导师汇报"
→ 调用 `workspace show phd-thesis` 获取论文列表 → 按主题分组 → 参照 reference.md 写 python-pptx 脚本生成幻灯片

用户说:"导出所有论文的统计数据到 Excel"
→ 遍历 `data/papers/*/meta.json` 提取字段 → 参照 reference.md 写 openpyxl 脚本生成带筛选和图表的 XLSX

用户说:"画一个流程图然后嵌入到报告里"
→ 先用 draw skill 生成 PNG → 再用 python-docx 的 `add_picture()` 嵌入 DOCX
Files in this package (3)
  • SKILL.md 7 KB
  • reference.md 12 KB
  • templates/starter/build_report.py 1 KB

Versions

RepositoryScoreLicence
This page · wszqkzqk/scrinium100GPL-3.0
team-blue-Hub/scripta100Apache-2.0
awrshift/agent-memory-kit100MIT
metabase/metabase-cli100AGPL-3.0
rossumai/claude-marketplace100MIT
zimoliao/scholaraio100MIT
archcore-ai/archcore100Apache-2.0
hellblazer/nexus100AGPL-3.0
R0drig0V1/claude-code-herdr100MIT

Database snapshot: 13.11.2026 · package version c7135f006772 (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

  • 95aurochs-office
    Inspect, build, and verify Office documents (PPTX, DOCX, XLSX) using the aurochs CLI. Use this skill when: (1) Inspecting existing Office files, (2) Building PPTX/DOCX/XLSX from JSON spec, (3) Previewing slide/document/sheet content in terminal, (4) Extracting text or data, (5)…
  • 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.
  • 95document-processing
    Create, edit, and analyze office documents (PDF, DOCX, PPTX, XLSX). Use when working with PDFs, Word documents, PowerPoint presentations, or Excel spreadsheets. Covers text extraction, form filling, document creation, and data analysis.
  • 100office-docs
    Office document ingestion for RAG: DOCX (python-docx, mammoth to markdown), PPTX (python-pptx with image extraction), XLSX (openpyxl, pandas, table-aware chunking), plus Notion/Confluence/Quip export to markdown. Preserves headings, lists, comments, and embedded images. USE…
  • 88memory-office-docs
    Use when 创建/修改/验证 Word、Excel、PPT、PDF 等 Office 文档及生成代码:docx-js、openpyxl、python-pptx、PyMuPDF、OMML 公式、soffice/LibreOffice 转换、mupdf 渲染、批量插图、教学讲义与报告生成。遇到 docx 打开报错、Excel 写入异常、PDF/中文字体问题、文档验证超时等踩坑时使用。含用户长期沉淀的文档生成经验。
  • 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…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.