QoderWork-PPT
When a user wants to generate a QoderWork-style presentation, use this skill. Based on the user's topic and requirements, it automatically generates content, matches suitable templates, and outputs an editable PowerPoint file.
Execution Flow
0. Prepare output directory
Create the output directories if they don't exist:
CODEBLOCK0
1. Understand requirements & generate content document
Read rules/content-rules.md (in this skill directory), then convert the user's requirements into a structured content document at output/content.md.
- - Extract from user input: topic, audience, key points, page count preferences, etc.
- Generate a well-structured plain-text document following content-rules
- Content should be complete, logically clear, and ready for template matching
- CRITICAL — page budget: unless the user explicitly requests more, plan for 8–15 slides total (including cover, TOC, section dividers, and closing). Count your planned slides before proceeding to step 2. If the outline exceeds 15, merge or cut sections.
2. Match templates & generate slide sequence
Read rules/template-matching.md and templates/manifest.json, then generate output/slides.json based on content.md.
- - slides.json array length MUST be ≤ 15 (unless the user explicitly requested more). Count before writing the file.
- Format per slide: INLINECODE5
- A full example (one slide per template type) is available at
rules/slides-example.json — copy and adapt it - Strictly follow template-matching rules; slot values must conform to manifest constraints (type, maxLength, etc.)
Cover background:cover 模板的 coverBackground 槽位勿主动填写,使用模板默认背景。仅当用户明确要求自定义封面图时才填。
Section-divider 插图:03 章节分隔页右侧的 image 槽位尽量勿填,使用模板默认插图。仅当用户明确要求更换章节配图时才填。
Image slots (type: image) accept any of:
| Format | Example | When to use |
|---|
| INLINECODE9 | INLINECODE10 | Icon-style images (preferred for column cards in 06/07/08) |
| Image URL |
https://example.com/photo.jpg | Web images |
| Local path |
output/images/slide-03.png | After generating/saving an image locally |
When you must generate/search for real images: slots marked aiGeneratable: true that need a real photograph or illustration (not an icon) — typically section-divider image, content-left-text-right-image image, and full-image background. Call generate_image or web_search to obtain them, save to output/images/, and fill the path into slots. These image slots are required — do NOT leave the default placeholder.
3. Fill HTML templates
Working directory (cwd): must be the project root (where output/ lives).
Script path: relative to this skill directory. Replace SKILL_SCRIPTS below with the actual path (e.g., resources/skills-market/qoderwork-ppt/scripts if using this repo as workspace, or ~/.qoderwork/skills/qoderwork-ppt/scripts if installed from market).
Optional — validate first:
CODEBLOCK1
Then fill templates (or use the one-click pipeline below):
CODEBLOCK2
Recommended — one-click pipeline (steps 3+4 combined):
CODEBLOCK3
Output file is auto-named with a timestamp (e.g. output/presentation-2026-03-06-10-30-00.pptx) to avoid overwriting previous runs.
4. Convert to PPTX
If you didn't use the one-click pipeline above, run separately:
CODEBLOCK4
Reads filled HTML from output/filled/, renders via Puppeteer, and converts to PPTX using dom-to-pptx — preserving background images, rounded corners, fonts, and full styling.
5. Inform the user
Tell the user the PPT has been generated at output/presentation.pptx, with a brief summary of page count and structure.
Resumability (Agent checkpoint recovery)
- - Step 1: If
output/content.md already exists and the user didn't ask to "regenerate content", skip to step 2. - Step 2: Always (re-)generate
output/slides.json from content.md. - Step 3+4: If only slides.json changed, just re-run
run-pipeline.js (overwrites output/filled/ and output/presentation.pptx).
Key Files (in this skill directory)
| File | Purpose |
|---|
| INLINECODE32 | Content generation rules & document structure |
| INLINECODE33 |
Template matching rules & image slot conventions |
|
rules/slides-example.json | Full slides.json example (one slide per template type) |
|
templates/manifest.json | 14 template definitions with slot specs |
|
templates/*.html | 14 HTML template files (1920×1080) |
|
scripts/validate-slides.js | Pre-validation for slides.json |
|
scripts/fill-template.js | Fills slot values into HTML templates |
|
scripts/html-to-pptx-dom.js | High-fidelity HTML → PPTX conversion |
|
scripts/run-pipeline.js | One-click: validate → fill → convert |
Output Files (in project root output/)
| File | Purpose |
|---|
| INLINECODE42 | Intermediate: structured content |
| INLINECODE43 |
Intermediate: slide sequence + slot values |
|
output/images/ | Generated/downloaded images for slides |
|
output/filled/*.html | Filled single-page HTML files |
|
output/presentation.pptx | Final PowerPoint file |
Dependencies
Before first use, install dependencies in this skill directory:
CODEBLOCK5
Required packages: jsdom, puppeteer, dom-to-pptx, lucide-static. Icons are loaded from local lucide-static (no network at runtime).
QoderWork-PPT
当用户想要生成QoderWork风格的演示文稿时,使用此技能。根据用户的主题和需求,自动生成内容、匹配合适的模板,并输出可编辑的PowerPoint文件。
执行流程
0. 准备输出目录
如果输出目录不存在,则创建它们:
bash
mkdir -p output output/images
1. 理解需求并生成内容文档
读取rules/content-rules.md(位于此技能目录中),然后将用户需求转换为结构化的内容文档,保存至output/content.md。
- - 从用户输入中提取:主题、受众、关键点、页数偏好等
- 按照内容规则生成结构清晰的纯文本文档
- 内容应完整、逻辑清晰,并准备好进行模板匹配
- 关键——页数预算:除非用户明确要求更多页,否则规划总共8-15张幻灯片(包括封面、目录、章节分隔页和结束页)。在进入步骤2之前,统计你规划的幻灯片数量。如果大纲超过15页,则合并或删减章节。
2. 匹配模板并生成幻灯片序列
读取rules/template-matching.md和templates/manifest.json,然后基于content.md生成output/slides.json。
- - slides.json数组长度必须≤15(除非用户明确要求更多页)。在写入文件前进行计数。
- 每张幻灯片的格式:{ templateId: xxx, slots: { slotId: value, ... } }
- 完整示例(每种模板类型一张幻灯片)可在rules/slides-example.json中找到——复制并调整
- 严格遵守模板匹配规则;槽位值必须符合manifest约束(类型、最大长度等)
封面背景:封面模板的coverBackground槽位请勿主动填写,使用模板默认背景。仅当用户明确要求自定义封面图时才填写。
章节分隔页插图:03章节分隔页右侧的image槽位尽量不填,使用模板默认插图。仅当用户明确要求更换章节配图时才填写。
图片槽位(类型:image)接受以下任意格式:
| 格式 | 示例 | 使用场景 |
|---|
| lucide:<图标名称> | lucide:shield-check | 图标风格图片(优先用于06/07/08的列卡片) |
| 图片URL |
https://example.com/photo.jpg | 网络图片 |
| 本地路径 | output/images/slide-03.png | 在本地生成/保存图片后使用 |
何时必须生成/搜索真实图片:标记为aiGeneratable: true且需要真实照片或插图(非图标)的槽位——通常是section-divider图片、content-left-text-right-image图片和full-image背景。调用generateimage或websearch获取它们,保存到output/images/,并将路径填入槽位。这些图片槽位是必需的——不要保留默认占位符。
3. 填充HTML模板
工作目录(cwd):必须是项目根目录(output/所在位置)。
脚本路径:相对于此技能目录。将下面的SKILL_SCRIPTS替换为实际路径(例如,如果使用此仓库作为工作区,则为resources/skills-market/qoderwork-ppt/scripts;如果从市场安装,则为~/.qoderwork/skills/qoderwork-ppt/scripts)。
可选——先进行验证:
bash
node SKILL_SCRIPTS/validate-slides.js output/slides.json
然后填充模板(或使用下面的一键流水线):
bash
node SKILL_SCRIPTS/fill-template.js output/slides.json
推荐——一键流水线(步骤3+4合并):
bash
node SKILL_SCRIPTS/run-pipeline.js output/slides.json
输出文件自动以时间戳命名(例如output/presentation-2026-03-06-10-30-00.pptx),避免覆盖之前的运行结果。
4. 转换为PPTX
如果未使用上述一键流水线,请单独运行:
bash
node SKILL_SCRIPTS/html-to-pptx-dom.js output/filled
从output/filled/读取填充后的HTML,通过Puppeteer渲染,并使用dom-to-pptx转换为PPTX——保留背景图片、圆角、字体和完整样式。
5. 通知用户
告知用户PPT已生成在output/presentation.pptx,并简要说明页数和结构。
可恢复性(Agent检查点恢复)
- - 步骤1:如果output/content.md已存在且用户未要求重新生成内容,则跳至步骤2。
- 步骤2:始终从content.md(重新)生成output/slides.json。
- 步骤3+4:如果仅slides.json发生变化,只需重新运行run-pipeline.js(覆盖output/filled/和output/presentation.pptx)。
关键文件(在此技能目录中)
| 文件 | 用途 |
|---|
| rules/content-rules.md | 内容生成规则和文档结构 |
| rules/template-matching.md |
模板匹配规则和图片槽位约定 |
| rules/slides-example.json | 完整的slides.json示例(每种模板类型一张幻灯片) |
| templates/manifest.json | 14个模板定义及槽位规格 |
| templates/*.html | 14个HTML模板文件(1920×1080) |
| scripts/validate-slides.js | slides.json的预验证 |
| scripts/fill-template.js | 将槽位值填充到HTML模板中 |
| scripts/html-to-pptx-dom.js | 高保真HTML→PPTX转换 |
| scripts/run-pipeline.js | 一键操作:验证→填充→转换 |
输出文件(在项目根目录output/中)
| 文件 | 用途 |
|---|
| output/content.md | 中间文件:结构化内容 |
| output/slides.json |
中间文件:幻灯片序列+槽位值 |
| output/images/ | 为幻灯片生成/下载的图片 |
| output/filled/*.html | 填充后的单页HTML文件 |
| output/presentation.pptx | 最终的PowerPoint文件 |
依赖项
首次使用前,在此技能目录中安装依赖项:
bash
cd <此技能目录路径> && npm install
所需包:jsdom、puppeteer、dom-to-pptx、lucide-static。图标从本地lucide-static加载(运行时无需网络)。