pw-aippt-old
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAIPPT - AI PPT 生成工作流
AIPPT - AI PPT Generation Workflow
定位: 完全自动化 PPT 生成工作流 依赖: pw-image-generation skill 核心: 垫图约束风格 + 提示词替换内容 + AI 生图 + 打包 PPTX
Positioning: Fully automated PPT generation workflow Dependency: pw-image-generation skill Core: Reference image style constraint + prompt content replacement + AI image generation + PPTX packaging
快速开始
Quick Start
1. 准备项目
1. Prepare the project
bash
mkdir my-ppt-project && cd my-ppt-project
mkdir -p template prompts imagesbash
mkdir my-ppt-project && cd my-ppt-project
mkdir -p template prompts images2. 准备模板(垫图)
2. Prepare templates (reference images)
方法 1: PDF 自动转换(推荐)
bash
node ~/.claude/skills/pw-aippt/scripts/pdf-to-images.js template.pdf ./template 150需要安装 poppler:
brew install poppler方法 2: PowerPoint/Keynote 导出
导出为 PNG 图片,保存到 目录。详见
template/references/01_导出方法.mdMethod 1: Automatic PDF conversion (recommended)
bash
node ~/.claude/skills/pw-aippt/scripts/pdf-to-images.js template.pdf ./template 150Poppler installation required:
brew install popplerMethod 2: PowerPoint/Keynote export
Export as PNG images and save to the directory. See for details.
template/references/01_导出方法.md3. 生成提示词
3. Generate prompts
bash
undefinedbash
undefined在 Claude Code 中执行
Execute in Claude Code
/pw-aippt https://example.com/article
/pw-aippt https://example.com/article
或
or
/pw-aippt "文章内容..."
skill 会自动分析模板、拆解内容、生成提示词文件到 `prompts/` 目录。/pw-aippt "article content..."
The skill will automatically analyze the template, split the content, and generate prompt files to the `prompts/` directory.4. 生成图片
4. Generate images
bash
node ~/.claude/skills/pw-image-generation/scripts/generate-image.jsbash
node ~/.claude/skills/pw-image-generation/scripts/generate-image.js5. 打包 PPTX
5. Package into PPTX
bash
node ~/.claude/skills/pw-image-generation/scripts/merge-to-pptx.js ./images output.pptxbash
node ~/.claude/skills/pw-image-generation/scripts/merge-to-pptx.js ./images output.pptx核心概念
Core Concepts
工作流程
Workflow
导出图片 → 风格提取 → 分析模板 → 内容分段 → 内容映射 → 生成提示词 → 生成图片 → 打包PPTX
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
垫图 风格定义 布局库 页面规划 提示词文件 prompts/ PNG文件 .pptx新增步骤说明:
- 风格提取: 按照标准化规范提取模板的设计美学、背景系统、字体系统、颜色系统、视觉元素和风格约束,形成可复用的风格定义文档
Export images → Style extraction → Template analysis → Content segmentation → Content mapping → Generate prompts → Generate images → Package PPTX
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
Reference Style def Layout lib Page plan Prompt file prompts/ PNG files .pptxNew step description:
- Style extraction: Extract the design aesthetics, background system, font system, color system, visual elements and style constraints of the template according to standardized specifications, and form a reusable style definition document
提示词结构
Prompt structure
markdown
undefinedmarkdown
undefined提示词
Prompt
参考这张 PPT 模板图片: {垫图URL}
生成新的内容页。
【风格约束】(严格遵守)Refer to this PPT template image: {reference image URL}
Generate a new content page.
【Style Constraints】(strictly follow)设计美学
Design Aesthetics
{从模板分析中提取的设计美学描述}
{Design aesthetic description extracted from template analysis}
背景系统
Background System
- 颜色: {精确 Hex 值}
- 纹理: {纹理描述}
- 渐变: {渐变信息}
- Color: {exact Hex value}
- Texture: {texture description}
- Gradient: {gradient information}
字体系统
Font System
标题字体
Title Font
- 字体: {字体名称}
- 粗细: {粗细}
- 大小: {大小}
- 颜色: {Hex 值}
- Font: {font name}
- Weight: {weight}
- Size: {size}
- Color: {Hex value}
正文字体
Body Font
- 字体: {字体名称}
- 粗细: {粗细}
- 大小: {大小}
- 颜色: {Hex 值}
- Font: {font name}
- Weight: {weight}
- Size: {size}
- Color: {Hex value}
颜色系统
Color System
{从模板分析中提取的颜色表格}
{Color table extracted from template analysis}
视觉元素
Visual Elements
{装饰元素列表}
{List of decorative elements}
风格规则
Style Rules
应该保持
Should be kept
- {保持的特征列表}
- {List of features to keep}
禁止改变
Prohibited to change
- 不添加幻灯片编号、页脚或 Logo (除非模板原有)
- {其他禁止项}
【不可改区域】(严格保持原样)
- {具体的不可改元素}
【可改区域】
- 页面标题改为: {新标题}
- 内容区改为: {新内容}
【生成指令】
保持专业风格,内容清晰易读。
absolutely no watermark, clean output only
undefined详细示例见
references/05_提示词模板示例.md风格库使用:
- 可以从 目录选择预定义的风格模板
references/styles/ - 支持的风格: corporate (商务), minimal (简约), technical (技术), creative (创意)
- 复制风格定义到提示词的【风格约束】部分,根据实际模板微调
- Do not add slide numbers, footers or Logos (unless existing in the template)
- {Other prohibited items}
【Unchangeable Area】(keep strictly as is)
- {Specific unchangeable elements}
【Modifiable Area】
- Page title changed to: {new title}
- Content area changed to: {new content}
【Generation Instruction】
Maintain professional style, content is clear and easy to read.
absolutely no watermark, clean output only
undefinedSee for detailed examples.
references/05_提示词模板示例.mdStyle library usage:
- You can select predefined style templates from the directory
references/styles/ - Supported styles: corporate, minimal, technical, creative
- Copy the style definition to the [Style Constraints] section of the prompt, and fine-tune according to the actual template
核心原则
Core Principles
视觉一致性(重要)
Visual Consistency (Important)
系列图最常见的问题是风格不一致。必须保持一致的要素:
- 视觉风格: 配色、装饰、字体、背景与模板一致
- 布局比例: 保持相似的留白比例和元素位置
- 装饰元素: 使用相同类型的装饰
- LOGO/页码: 所有图片都要包含(如果模板有)
实现方法:
- 使用垫图约束风格(图生图)
- 提示词中明确不可改区域
- 后续图片明确要求"保持与模板相同的风格"
常见问题:
- 背景颜色改变 → 在"不可改区域"中明确约束背景
- 装饰元素消失 → 详细列出每个装饰元素的位置和样式
- 字体大小不一致 → 在所有提示词中统一字体大小规范
The most common problem with series of images is inconsistent style. Elements that must be consistent:
- Visual style: Color matching, decoration, font, background are consistent with the template
- Layout ratio: Keep similar white space ratio and element position
- Decorative elements: Use the same type of decoration
- LOGO/page number: All images should include (if available in the template)
Implementation method:
- Use reference images to constrain style (image to image)
- Clearly define unchangeable areas in the prompt
- Explicitly require subsequent images to "maintain the same style as the template"
Common problems:
- Background color changed → Explicitly constrain the background in the "unchangeable area"
- Decorative elements disappeared → List the position and style of each decorative element in detail
- Inconsistent font size → Unify font size specifications in all prompts
内容拆解
Content Disassembly
- 封面页: 主标题 + 副标题,强烈视觉冲击力
- 目录页: 章节列表,清晰的导航
- 内容页: 每页聚焦 1 个核心观点
- 结束页: 总结/感谢/联系方式
页面数量:
- 简单内容(<1500字): 10-15 页
- 中等复杂度(1500-3000字): 15-20 页
- 深度内容(>3000字): 25-30 页
文件命名: 使用序号前缀,如 ,
01_封面页.md02_目录页.md- Cover page: Main title + subtitle, strong visual impact
- Table of contents page: Chapter list, clear navigation
- Content page: Each page focuses on 1 core idea
- Closing page: Summary/thank you/contact information
Number of pages:
- Simple content (<1500 words): 10-15 pages
- Medium complexity (1500-3000 words): 15-20 pages
- In-depth content (>3000 words): 25-30 pages
File naming: Use serial number prefix, such as ,
01_封面页.md02_目录页.md参考文档
Reference Documents
| 文件 | 说明 |
|---|---|
| PPT 导出为图片(垫图) |
| 分析模板,输出布局库和风格定义 |
| 内容拆分为页面 |
| 内容匹配布局,生成提示词 |
| 提示词格式示例(推荐) |
| 风格库使用说明 |
| 商务风格模板 |
| 简约风格模板 |
| 技术风格模板 |
| 创意风格模板 |
| File | Description |
|---|---|
| Export PPT as images (reference images) |
| Analyze templates, output layout library and style definition |
| Split content into pages |
| Match content to layout, generate prompts |
| Prompt format example (recommended) |
| Style library usage instructions |
| Corporate style template |
| Minimal style template |
| Technical style template |
| Creative style template |
注意事项
Notes
- 垫图质量: 导出的模板图片分辨率要高(建议 1920x1080 或更高)
- 提示词准确性: 明确描述可改/不可改区域,避免 AI 随意修改
- 视觉一致性: 使用垫图约束风格,确保所有页面风格一致
- 第一张图很重要: 生成第一张图后,仔细对比模板,确认无误后再批量生成
- 避免 Markdown 格式: 提示词中不要使用 等格式标记
**加粗**
- Reference image quality: The exported template image should have high resolution (1920x1080 or higher recommended)
- Prompt accuracy: Clearly describe modifiable/unchangeable areas to avoid arbitrary modification by AI
- Visual consistency: Use reference images to constrain the style to ensure consistent style of all pages
- The first image is very important: After generating the first image, carefully compare it with the template, and confirm it is correct before batch generation
- Avoid Markdown format: Do not use format markers such as in prompts
**bold**