# Pptgen Drawio

根据论文或汇报内容生成多页 Draw.io 格式 PPT，支持论文答辩与通用汇报两种模式，自动导出为 .pptx。当用户提到论文答辩 PPT、答辩幻灯片、通用 PPT、汇报...

- Repository: https://github.com/xstongxue/best-skills (3090 stars)
- Category: Documents
- License: Apache-2.0
- Last updated: 2026-09-13
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add xstongxue/best-skills --skill pptgen-drawio -g -a claude-code -y`
Codex: `npx skills add xstongxue/best-skills --skill pptgen-drawio -g -a codex -y`
Cursor: `npx skills add xstongxue/best-skills --skill pptgen-drawio -g -a cursor -y`
Gemini CLI: `npx skills add xstongxue/best-skills --skill pptgen-drawio -g -a gemini-cli -y`

## Description

根据论文或汇报内容生成多页 Draw.io 格式 PPT，支持论文答辩与通用汇报两种模式，自动导出为 .pptx。当用户提到论文答辩 PPT、答辩幻灯片、通用 PPT、汇报 PPT、根据模板生成 PPT、drawio2pptx 时使用。

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# PPT 多页 Draw.io 生成（论文答辩 + 通用汇报）

本 skill 支持两种模式，**共用** `ppt_template/`、`scripts/`、`reference/` 目录，以及 **Step 0 自定义模板**、**Step 1 确定内容与风格**、**Step 3 & 4 输出与导出** 全流程。

---

## 模式识别

| 模式 | 使用时机 | 内容来源 | 默认页序 | 输出文件 |
|------|----------|----------|----------|----------|
| **论文答辩** | 学位论文答辩、开题、预答辩 | paper-write 结构化提取 | 封面→目录→背景→现状→方法→创新点→实验→结论→致谢→Q&A | `paper-defense.drawio` |
| **通用汇报** | 工作汇报、产品介绍、演讲 | 用户消息提取/生成 | 封面→目录→节标题→内容页→总结→致谢→Q&A | `general-presentation.drawio` |

---

## Step 0：用户自定义模板（可选，两种模式共用）

若用户提供了自己的 `.pptx` 模板文件：

1. **模板放置**：将 `.pptx` 放入 `ppt_template/` 目录
2. **运行样式提取**：在 skill 根目录下执行：
   ```
   python scripts/analyze_pptx.py ppt_template/xxx.pptx reference/style-custom.md
   ```
3. 读取 `reference/style-custom.md` 作为「自定义风格」继续

**目录约定**：`ppt_template/` 存放模板、`scripts/analyze_pptx.py` 样式提取、`reference/` 风格文件

---

## Step 1：确定内容与风格（两种模式共用）

### 1.1 确定内容

- **论文答辩**：若用户只有论文全文：先调用 paper-write 的「结构化信息提取」；若已提供结构化信息：从消息中提取【论文题目】【学科方向】【答辩时长】【论文结构/目录】【各章核心内容】【创新点/贡献】等，缺失则追问
- **通用汇报**：从用户消息中提取幻灯片大纲及内容，或根据核心需求扩展为完整结构

### 1.2 选择风格

两种模式均可选择以下风格之一，**读取对应 reference 文件**获取配色、字体、版式规则与 XML 样式片段：

| # | 风格 | 主色 | 强调色 | 有无顶栏装饰 | reference 文件 |
|---|------|------|--------|---|---------------|
| 1 | 经典学术 / 商务严谨 | `#1B2A4A` | `#C9A84C` | 有：顶栏 150px + 金线 8px | `reference/style1-classic-academic.md` |
| 2 | 现代极简 / 大字报感 | `#231F20` | `#F5C638` | **无**，靠留白和字号差 | `reference/style2-minimal-bigtype.md` |
| 3 | 暖色学术 / 亲和力 | `#2C5160` | `#B7472A` | 有，同风格一结构 | `reference/style3-warm-academic.md` |
| 4 | 科技明快 / 现代前沿 | `#0170C1` | 同主色 | 有 | `reference/style4-tech-modern.md` |
| 5 | 自定义 | 从 style-custom.md 提取 | | 看模板 | `reference/style-custom.md` |

- **论文答辩**：用户未指定时默认风格 1
- **通用汇报**：用户选择或根据语境自动推荐
- 风格 1 / 3 / 4 是同一套版式换配色（顶栏 + 细线 + 页脚），**只有风格 2 是真正不同的版式**。用户想要「看起来不一样」时推风格 2；传统工科院校答辩推风格 1

---

## Step 2：生成多页 Draw.io XML

**必须先读取所选风格的 reference 文件**，基于该风格生成 XML。

- 画布：16:9（pageWidth=1920，pageHeight=1080）
- 页序：按模式识别表中的默认页序
- 页数：**由 Step 1.1 拿到的答辩时长决定**，见下面 2.1

### 2.1 论文答辩模式页序（按时长换算）

The rest: https://github.com/xstongxue/best-skills/blob/HEAD/skills/pptgen-drawio/SKILL.md
