PPT小助手

👤 user_0e56f9a3 📦 v1.0.0 ⭐ 4.5 ⬇️ 823 下載
📄 辦公效率 免費

📖 技能介紹


version:"1.0.0" author:jm-jsjkxyjs02-ys-1701 name: ppt-generator description: Use when the user asks to generate, create, or make a PPT/PowerPoint presentation, slides, or .pptx file. Supports both natural language descriptions and Markdown outlines as input. Covers teaching materials, business reports, project summaries, and general presentations.


PPT Generator

Overview

Generate professional .pptx files using python-pptx. Accept input as natural language ("make a 10-slide deck about AI safety") or structured Markdown outlines.

Workflow

  1. Parse input — extract topic, slide count, style hints from user's natural language or Markdown outline
  2. Design outline — plan each slide: layout type, title, content summary
  3. Present outline to user — show a numbered slide list for confirmation before writing code

    7w4.net小蔥技能站,你的AI助手技能庫。

  4. Generate script — write a self-contained Python script using python-pptx
  5. Execute and verify — run the script, confirm the .pptx file was created

Never skip step 3. Always get user approval on the outline before writing code.

Typography Rules

These are mandatory defaults. Only deviate if the user explicitly overrides.

Element Font Size Weight Color
Slide title 32pt Bold #1a1a2e
Subtitle 18pt Normal #555555
Body text 14pt Normal #333333
Small label 11pt Normal #888888

Margins: left/right 1.5 inch, top/bottom 1.2 inch (when using manual text boxes). For built-in layouts, leave at defaults.

Color Themes

Four preset themes. Default is "Professional Blue". User can switch by name.

Theme Primary Secondary Accent Background
Professional Blue #1a1a2e #16213e #0f3460 #ffffff
Warm Orange #e07a5f #3d405b #81b29a #f4f1de
Clean Green #2d6a4f #40916c #52b788 #ffffff
Dark Mode #e0e0e0 #bb86fc #03dac6 #121212

Slide Types

Title Slide

Centered title, subtitle, author/date. Use PPT_LAYOUT_TITLE (layout index 0).

Content Slide (Bullet List)

Title at top, bullet points in body. Use PPT_LAYOUT_BODY (layout index 1) or manual text box for multi-level lists.

Two-Column

Title, two text columns side by side. Use manual text boxes positioned at 0.5" and 5.0" horizontally.

Image + Text

Title, image on one side, text on the other. Use add_picture() with manual placement.

Table Slide

Title + table. Use add_table(rows, cols).

Ending Slide

Centered "Thank You" or "Q&A" with contact info. Same layout as title slide.

Code Patterns

Bootstrap every script like this:

from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
import os

prs = Presentation()
prs.slide_width = Inches(13.333)  # 16:9 widescreen
prs.slide_height = Inches(7.5)

# Theme colors (Professional Blue)
PRIMARY = RGBColor(0x1a, 0x1a, 0x2e)
SECONDARY = RGBColor(0x16, 0x21, 0x3e)
ACCENT = RGBColor(0x0f, 0x34, 0x60)
BG = RGBColor(0xff, 0xff, 0xff)

# Helper: add a text box
def add_textbox(slide, left, top, width, height, text, font_size=Pt(14),
                bold=False, color=RGBColor(0x33, 0x33, 0x33), alignment=PP_ALIGN.LEFT):
    txBox = slide.shapes.add_textbox(Inches(left), Inches(top),
                                      Inches(width), Inches(height))
    tf = txBox.text_frame
    tf.word_wrap = True
    p = tf.paragraphs[0]
    p.text = text
    p.font.size = font_size
    p.font.bold = bold
    p.font.color.rgb = color
    p.alignment = alignment
    return tf

# Helper: add bullet points from a list
def add_bullet_list(slide, left, top, width, height, items, font_size=Pt(14)):
    txBox = slide.shapes.add_textbox(Inches(left), Inches(top),
                                      Inches(width), Inches(height))
    tf = txBox.text_frame
    tf.word_wrap = True
    for i, item in enumerate(items):
        if i == 0:
            p = tf.paragraphs[0]
        else:
            p = tf.add_paragraph()
        p.text = item
        p.font.size = font_size
        p.font.color.rgb = RGBColor(0x33, 0x33, 0x33)
        p.level = 0
        p.space_after = Pt(6)
    return tf

Title slide:

slide = prs.slides.add_slide(prs.slide_layouts[6])  # blank layout
add_textbox(slide, 1.5, 2.0, 10, 1.5, "Presentation Title",
            Pt(36), True, PRIMARY, PP_ALIGN.CENTER)
add_textbox(slide, 1.5, 3.5, 10, 0.8, "Subtitle or Author",
            Pt(18), False, RGBColor(0x55, 0x55, 0x55), PP_ALIGN.CENTER)
add_textbox(slide, 1.5, 4.5, 10, 0.5, "2024-01-15",
            Pt(11), False, RGBColor(0x88, 0x88, 0x88), PP_ALIGN.CENTER)

Content slide with bullets:

slide = prs.slides.add_slide(prs.slide_layouts[6])
add_textbox(slide, 0.8, 0.4, 10, 0.8, "Slide Title", Pt(32), True, PRIMARY)
items = ["Point one: key insight", "Point two: supporting detail", "Point three: takeaway"]
add_bullet_list(slide, 1.0, 1.5, 11, 4.5, items)

Save the file:

output_path = os.path.expanduser("~/Desktop/presentation.pptx")
prs.save(output_path)
print(f"Saved to {output_path}")

Input Formats

Natural Language

User says: "做一個關於時間管理的5頁PPT" → Claude designs the outline, presents it, then generates.

Markdown Outline

User provides:

# 時間管理
## 1. 為什麼需要時間管理
- 提高效率
- 減少壓力
## 2. 四象限法則
- 重要緊急
- 重要不緊急
...

→ Claude maps each ## heading to a slide, each bullet to a list item, and generates.

Common Mistakes

Mistake Fix
Text overflowing slide Break long text into multiple slides or reduce font size
Missing font file for Chinese Always use a font that supports CJK (e.g., "Microsoft YaHei", "SimSun"). Add p.font.name = 'Microsoft YaHei' for Chinese text
Using wrong layout index Layout 0 = title, 1 = content, 6 = blank. Check with prs.slide_layouts if unsure
Forgetting Inches/Pt wrappers All dimensions must use Inches() or Pt() from pptx.util
Not setting word_wrap Long text without word_wrap = True overflows horizontally

Reference Files

  • reference/python-pptx-api.md — Full python-pptx API quick reference
  • scripts/ppt_helpers.py — Ready-to-import helper functions for common slide patterns

🤖 AI 評測

這個 PPT 生成工具質量不錯,文件清晰易懂,操作步驟明確。它提供了多種幻燈片模板和配色方案,能滿足大多數演示需求。不過缺少直觀的示例展示,實際生成效果難以預覽,對新手不太友好。功能比較全面,但實操體驗還有提升空間。

📊 多維度評分

適應性4.4
規範性4.6
有效性4.5
可靠性4
可信度4.9

📁 包含檔案 (3 個)

📄 SKILL.md 6.3 KB
📄 reference/python-pptx-api.md 4.6 KB
📄 scripts/ppt_helpers.py 9.5 KB