Skip to content

Akxan/ppt-agent-skill

ppt-agent

Verified

专业 PPT 演示文稿全流程 AI 生成助手。模拟顶级 PPT 设计公司的完整工作流(需求调研 -> 资料搜集 -> 大纲策划 -> 策划稿 -> 设计稿),输出高质量 HTML 格式演示文稿。当用户提到制作 PPT、做演示文稿、做 slides、做幻灯片、做汇报材料、做培训课件、做路演 deck、做产品介绍页面时触发此技能。即使用户只说"帮我做个关于 X 的介绍"或"我要给老板汇报 Y",只要暗示需要结构化的多页演示内容,都应该触发。也适用于用户说"帮我把这篇文档做成 PPT"、"把这个主题做成演示"等需要将内容转化为演示格式的场景。

FileKindSize
SKILL.mdskill md20.3 KB
assets/architecture.pngbinary2.0 MB
assets/architecture.svgother17.7 KB
assets/hero-all.pngbinary1.3 MB
assets/hero-cultural-oriental.pngbinary250.3 KB
assets/hero-dark-professional.pngbinary585.1 KB
assets/hero-light-premium.pngbinary639.5 KB
assets/hero-natural-retro.pngbinary403.2 KB
assets/hero-vibrant.pngbinary279.1 KB
assets/logo.svgother1.7 KB
references/README.mdmarkdown2.9 KB
references/bento-grid.mdmarkdown6.2 KB
references/blocks/README.mdmarkdown2.1 KB
references/blocks/card-styles.mdmarkdown5.6 KB
references/blocks/comparison.mdmarkdown1.8 KB
references/blocks/diagram.mdmarkdown1.9 KB
references/blocks/image-hero.mdmarkdown1.9 KB
references/blocks/matrix-chart.mdmarkdown1.9 KB
references/blocks/people.mdmarkdown1.6 KB
references/blocks/quote.mdmarkdown1.6 KB
references/blocks/timeline.mdmarkdown1.7 KB
references/charts/advanced.mdmarkdown39.0 KB
references/charts/basic.mdmarkdown57.9 KB
references/charts/complex.mdmarkdown83.7 KB
references/charts/index.mdmarkdown4.9 KB
references/design-runtime/css-weapons.mdmarkdown10.9 KB
references/design-runtime/data-type-visual-mapping.mdmarkdown7.9 KB
references/layouts/README.mdmarkdown4.8 KB
references/layouts/asymmetric.mdmarkdown1.2 KB
references/layouts/hero-top.mdmarkdown2.0 KB
references/layouts/l-shape.mdmarkdown1.6 KB
references/layouts/mixed-grid.mdmarkdown2.3 KB
references/layouts/primary-secondary.mdmarkdown1.8 KB
references/layouts/single-focus.mdmarkdown1.5 KB
references/layouts/symmetric.mdmarkdown1.5 KB
references/layouts/t-shape.mdmarkdown1.4 KB
references/layouts/three-column.mdmarkdown1.5 KB
references/layouts/waterfall.mdmarkdown1.3 KB
references/method.mdmarkdown2.8 KB
references/page-templates/cover.mdmarkdown2.4 KB
references/page-templates/end.mdmarkdown2.3 KB
references/page-templates/section.mdmarkdown1.9 KB
references/page-templates/toc.mdmarkdown1.9 KB
references/pipeline-compat.mdmarkdown7.5 KB
references/principles/README.mdmarkdown2.1 KB
references/principles/cognitive-load.mdmarkdown2.2 KB
references/principles/color-psychology.mdmarkdown2.2 KB
references/principles/composition.mdmarkdown2.6 KB
references/principles/data-visualization.mdmarkdown2.1 KB
references/principles/failure-modes.mdmarkdown4.9 KB
references/principles/narrative-arc.mdmarkdown2.7 KB
references/principles/visual-hierarchy.mdmarkdown2.9 KB
references/prompts.mdmarkdown32.8 KB
references/strict-mode.mdmarkdown6.4 KB
references/styles/cultural.mdmarkdown8.3 KB
references/styles/dark.mdmarkdown21.3 KB
references/styles/index.mdmarkdown11.8 KB
references/styles/light.mdmarkdown21.9 KB
references/styles/natural.mdmarkdown11.1 KB
references/styles/vibrant.mdmarkdown10.6 KB
references/typography.mdmarkdown8.6 KB
scripts/README.mdmarkdown2.3 KB
scripts/build_hero.pyscript7.2 KB
scripts/contracts.pyscript12.8 KB
scripts/gallery.pyscript10.3 KB
scripts/html2png.pyscript2.9 KB
scripts/html2svg.pyscript24.2 KB
scripts/html_packager.pyscript10.1 KB
scripts/png2pptx.pyscript2.4 KB
scripts/pptx_motion.pyscript8.8 KB
scripts/resource_loader.pyscript7.0 KB
scripts/smoke_test.pyscript16.3 KB
scripts/svg2pptx.pyscript45.3 KB
scripts/validate.pyscript23.0 KB

references/pipeline-compat.md

View on GitHub
# HTML -> SVG -> PPTX 管线兼容性

写 HTML 设计稿时要知道:哪些效果进 PPTX 后仍是可编辑的形状和文字,哪些会变成图片,哪些会丢。本文件的结论都来自用真实 PowerPoint 渲染对照浏览器截图的实测,规则的代码真源是 `scripts/contracts.py` 里的 `COMPAT_RULES`。

预览页(`preview.html`)和像素级保真版(`presentation-hd.pptx`)不经过这条管线,任何 CSS 都原样保留。以下只针对可编辑的 `presentation.pptx`。

---

## 1. 管线怎么处理一页

1. `html2svg.py` 用 Puppeteer 打开 HTML,先把 dom-to-svg 画不出来的绘制**截成图层**嵌回页面,再调用 dom-to-svg 输出 SVG(文字是 `<text>`)
2. `svg2pptx.py` 把 SVG 逐元素翻成 PowerPoint 原生形状、文本框和图片,卡片打成组合,写入切换与动画

---

## 2. 三类结果

### A. 保持矢量(PPT 里可编辑)

| 写法 | 进 PPTX 后 |
|------|-----------|
| 纯色 / `linear-gradient` 背景的块、边框、圆角 | 矩形 / 圆角矩形,渐变填充 |
| 文字:字号、字重、斜体、字距、颜色、透明度、竖排(`writing-mode`) | 文本框,逐行定位 |
| `::before` / `::after`(纯色块、文字内容) | 与普通元素相同 |
| 内联 SVG:`rect` `circle` `ellipse` `line` `polygon` `polyline` `path`(含弧线 A 与曲线 C/S/Q/T) | 对应形状或自定义路径 |
| SVG 环形进度:`fill="none"` + `stroke-dasharray="弧长 周长"` | 弧形,起始角按 `rotate` 换算 |
| `<img>`(本地路径或 data URI),`object-fit` | 图片,cover 时居中裁剪 |
| `opacity`(元素或祖先) | 形状/图片透明度 |
| CSS border 三角形(宽高为 0) | 三角形路径 |

### B. 自动转图层(外观保真,但这一块在 PPT 里是图片)

| 写法 | 说明 |
|------|------|
| `radial-gradient` / `conic-gradient` / `repeating-*-gradient` / 多层背景 | 最常见:页面氛围背景、光晕、纹理 |
| CSS `background-image: url(...)` | |
| `filter`(blur 等)、`mask-image`、`clip-path`、`mix-blend-mode` | |
| `transform` 含旋转或斜切 | 印章、倾斜徽标 |
| 被祖先 `overflow: hidden` 裁掉一部分的装饰元素 | PPT 没有裁剪,只能整体入图 |
| 内联 SVG 含 `filter` `pattern` `mask` `clipPath` `use`,或描边用了带透明色标的渐变 | 整个 `<svg>` 入图 |

怎么入图取决于元素里有没有文字:

- **没有文字的装饰元素**:整棵子树截成一张透明图
- **有文字的容器**(如带径向背景的卡片、`body`):只把背景、边框和伪元素烘焙成图,里面的文字仍是可编辑文本框
- **旋转的元素**:连文字一起入图

想强制把某个元素整体转成图片(比如特别复杂的图表),给它加 `data-pptx="raster"`。

### C. 会丢失或退化

| 写法 | 结果 | 建议 |
|------|------|------|
| `text-shadow` | 丢失 | 不要靠辉光保证文字可读 |
| `background-clip: text` 渐变文字 | 变成渐变的第一个颜色 | 关键标题直接用 `color` |
| `backdrop-filter` | 模糊丢失,半透明填充保留 | 玻璃卡片可用,但别依赖模糊做对比 |
| `box-shadow` | 丢失(元素本身被转图层时除外) | |
| `::first-letter` / `::first-line` / `::marker` | 样式丢失 | 首字下沉用独立 `<span>` |
| 带文字的容器上的 `filter` / `mask` / `mix-blend-mode` | 效果丢失,文字与背景保留 | 把效果放到没有文字的子元素上 |
| `overflow: hidden` 对文字的裁剪 | 不裁剪,文字完整显示 | 控制字数,不要靠裁剪藏文字 |
| `stroke-dashoffset` | 被忽略 | 环形图用 `stroke-dasharray="弧长 周长"` |
| 内联 SVG 里的 `<text>` | 可编辑,但位置可能偏 3-5px | 标注用 HTML 元素叠在 SVG 上 |
| 网页字体 | 默认映射到 Office 自带字体并按宽度缩字号 | 见第 4 节 |

### D. 禁止

| 写法 | 原因 |
|------|------|
| `<script>` | 幻灯片必须是静态 HTML;预览页的沙箱 iframe 不执行脚本 |
| `@keyframes` / `animation` | 转换只取静态一帧。动效用 `svg2pptx.py --animate` |
| `<canvas>` / `<video>` / `<iframe>` | 不会被转换 |
| 远程图片(`http://...`) | 不会嵌入 PPTX,先下载到 `images/` |

---

## 3. 写法约定

**卡片根节点打标记**——导出时据此打成组合、做入场动画:

```html
<div class="card" data-card-id="s03-revenue">...</div>
```

没写 `data-card-id` 时,退而识别 class 以 `card` 结尾的最外层元素(`card`、`stat-card`、`glass-card`)。

**环形图**——SVG 只画弧,中心文字用 HTML 叠加:

```html
<div style="position:relative; width:120px; height:120px;">
  <svg viewBox="0 0 120 120" style="width:100%; height:100%;">
    <circle cx="60" cy="60" r="50" fill="none" stroke="var(--card-border)" stroke-width="8"/>
    <!-- 弧长 = 2πr × 百分比,周长 = 2πr;rotate(-90) 让起点在 12 点钟 -->
    <circle cx="60" cy="60" r="50" fill="none" stroke="var(--accent-1)" stroke-width="8"
            stroke-dasharray="235 314" stroke-linecap="round" transform="rotate(-90 60 60)"/>
  </svg>
  <div style="position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); text-align:center;">
    <div style="font-size:22px; font-weight:700;">75%</div>
  </div>
</div>
```

**图表的轴标签、图例、数据标注**——用 HTML `<span>` / `<div>` 绝对定位叠在 SVG 上,不写 SVG `<text>`。

**配图**——用 `<img>` 加 `object-fit: cover`;渐隐用盖在图上的 `linear-gradient` 遮罩 `<div>`。

---

## 4. 字体

PowerPoint 只能用打开文件那台机器上装了的字体,Google Fonts 多数人没装。`svg2pptx.py` 的两种策略:

| `--fonts` | 行为 | 适用 |
|-----------|------|------|
| `safe`(默认) | 按字体栈的类别映射到 Office 自带字体:无衬线 -> Arial,衬线 -> Georgia,等宽 -> Courier New,粗黑展示体 -> Arial Black;中文 -> 微软雅黑 / 宋体 / 楷体。替换后比网页字体宽时自动缩字号,避免相邻文字相撞 | 要发给别人的文件 |
| `design` | 保留字体栈里的第一个字体名 | 放映机器上装了设计字体 |

---

## 5. 切换与动画

| 能力 | 参数 | 说明 |
|------|------|------|
| 页间切换 | `--transition fade`(默认)`push` `wipe` `cover` `split` `zoom` `dissolve` `none` | 写入每页的进入效果 |
| 自动翻页 | `--advance-after 秒数` | 默认仅点击翻页 |
| 卡片入场 | `--animate fade` `wipe` `rise` `zoom`(默认 `none`) | 按卡片在 HTML 里的先后顺序 |
| 触发方式 | `--animate-trigger click`(默认)/ `auto` | 每点一下出一张 / 进入页面后依次自动出现 |

入场动画作用在卡片组合上,所以页面必须有带标记的卡片。动画在 PowerPoint 里验证过;WPS、Keynote、Google Slides 对动画的支持不完整。

`html_packager.py` 接受同名的 `--animate` / `--animate-trigger`,在浏览器预览里用同样的卡片识别规则和时长(500ms,间隔 150ms)模拟入场效果,不需要 PowerPoint 就能看动效。

---

## 6. 写完一页后的检查

- [ ] 画布 1280x720,没有 `<script>`、CSS 动画、`<canvas>`
- [ ] 卡片根节点带 `class="card"` 和 `data-card-id`
- [ ] 关键文字不依赖 text-shadow、渐变填充或 `overflow` 裁剪
- [ ] 图表标注是 HTML 元素,环形图用 `stroke-dasharray` 两值写法
- [ ] 图片是本地文件

机器检查:`python3 scripts/validate.py slides OUTPUT_DIR/slides`。ERROR 对应 D 类,WARN 对应 C 类,INFO 列出会转图层的 B 类写法。
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall