← 返回 Skills 市场
scottliu007

create-pptx

作者 fanzhuo · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
609
总下载
0
收藏
3
当前安装
1
版本数
在 OpenClaw 中安装
/install create-pptx
功能描述
Create PowerPoint presentations (PPTX) using Python and python-pptx. Handles timelines, charts, diagrams, slide layouts, custom colors, shapes, connectors, t...
使用说明 (SKILL.md)

Create PowerPoint (python-pptx)

Setup

pip install python-pptx   # or: uv pip install python-pptx

Output scripts to a logical location (e.g., 前端开发/demo/ or project folder), then run with python3 \x3Cscript.py> and open the result.

Core helpers

Read and import scripts/pptx_helpers.py for ready-made drawing primitives: background, horizontal/vertical lines, textboxes, ovals, diagonal connectors, and fade transitions. Copy or import as needed.

Key units: EMU (English Metric Units). 1 pt = 12700 EMU, 1 cm ≈ 360000 EMU. Standard 16:9 slide = 12192000 × 6858000 EMU.

Workflow

  1. Understand the content — milestones, categories, colors, # slides
  2. Plan layout — compute X/Y positions in EMU up front; avoid magic numbers
  3. Build shapes — use helpers or slide.shapes.add_shape/add_textbox
  4. Add transitions — always call add_fade_transition(slide) from helpers
  5. Run and openpython3 script.py && open output.pptx

Multi-slide instead of click animations (WPS-safe default)

WPS does not reliably support click-triggered PowerPoint animations. Always use multiple slides to reveal content progressively:

Slide 1 → skeleton / structure only
Slide 2 → skeleton + first data layer
Slide 3 → skeleton + all data layers

Add a fade transition (add_fade_transition) to each slide for smooth switching.

If the user explicitly asks for animations AND they are using Microsoft PowerPoint (not WPS), you may attempt XML-based animations — but read references/wps-compat.md first for the XML structure and known pitfalls.

Common patterns

Colors & theme

Define all colors as RGBColor constants at the top. Dark backgrounds look premium — use near-black (0x06, 0x0D, 0x1E) with bright accents.

Timeline layout

TL_L, TL_R = 850000, 11950000        # left/right margins (EMU)
TL_W  = TL_R - TL_L
M_STEP = TL_W // 11                   # 12 months → 11 intervals

def month_x(m):                       # 1-based month → EMU x-position
    return TL_L + M_STEP * (m - 1)

Collision resolution

When multiple cards share the same or nearby X position, spread them:

def resolve_collisions(events, card_w, gap):
    events.sort(key=lambda e: e['cx'])
    need = card_w + gap
    for _ in range(120):
        moved = False
        for i in range(len(events) - 1):
            a, b = events[i], events[i+1]
            if b['cx'] - a['cx'] \x3C need:
                push = (need - (b['cx'] - a['cx'])) / 2
                a['cx'] -= push; b['cx'] += push; moved = True
        if not moved:
            break

Shape IDs for animation

python-pptx assigns shape IDs automatically. To retrieve them after creation:

shp = slide.shapes.add_shape(...)
shape_id = shp.shape_id        # use this in animation XML

For connectors added via raw XML, read back the max existing ID first:

def _max_existing_id(slide):
    return max((int(el.get('id')) for el in slide.element.iter()
                if el.get('id') and el.get('id').isdigit()), default=1)

Template assets

Ready-to-use .pptx base files in assets/. Use them as the starting Presentation() object to inherit their design/theme:

from pptx import Presentation
prs = Presentation('/Users/scott/.cursor/skills/create-pptx/assets/business-dark.pptx')
File Style Source
assets/business-dark.pptx 深色商务 · Pitch Deck 风格 · 60 slides Slidesgo "Product Vision Pitch Deck" (Attribution required)
assets/education.pptx 明亮教育 · 笔记本课程风格 · 多 slides Slidesgo "Notebook Lesson XL" (Attribution required)

Attribution: Free Slidesgo templates require keeping the attribution slide. When using these files, do NOT delete the last "Credits" slide.

Reference files

Read the relevant file based on the task:

  • references/pptx-patterns.md — EMU 单位速查、预设形状 ID、连接器 XML、 过渡 XML、多段落文字框、典型脚本结构
  • references/charts.md — python-pptx 原生图表 API:柱状、折线、饼图、散点、 多系列、样式设置(当用户需要数据图表时读此文件)
  • references/standard-slides.md — 标准商务幻灯片函数库:标题页、目录页、 要点页、图文并排、数据页、章节分隔页、结尾页(当用户需要完整 PPT 结构时读此文件)
  • references/wps-compat.md — WPS 动画兼容性踩坑记录(当用户提到 WPS 或 动画效果异常时读此文件)
安全使用建议
This skill appears to do exactly what it claims: provide python-pptx helpers and documentation for building presentations. Before running anything: (1) inspect scripts/pptx_helpers.py yourself (it is included) and only run code you trust; (2) install python-pptx from PyPI via a trusted network, not from unknown URLs; (3) the SKILL.md references template files and an absolute path (/Users/scott/...) that are not bundled — replace with templates you provide or remove that example; (4) note Slidesgo templates may require keeping an attribution slide (license/credit); (5) the helper uses raw XML injection (parse_xml) to build connectors/transitions — this is normal for advanced pptx manipulation but review if you have strict security concerns. If you want extra assurance, ask the author for the missing assets or confirm the origin of the templates before use.
功能分析
Type: OpenClaw Skill Name: create-pptx Version: 1.0.0 The 'create-pptx' skill bundle is a legitimate toolset for generating PowerPoint presentations using the 'python-pptx' library. It contains helper scripts (scripts/pptx_helpers.py) and extensive documentation (references/) for creating charts, layouts, and handling WPS Office compatibility. No evidence of data exfiltration, malicious execution, or harmful prompt injection was found; the instructions and code logic are entirely consistent with the stated purpose of slide generation.
能力评估
Purpose & Capability
Name/description match the included Python helper (scripts/pptx_helpers.py) and reference docs. No unrelated credentials, binaries, or external services are requested. Minor note: SKILL.md references template assets and an example local path (/Users/scott/...) that are not present in the file manifest — this looks like a leftover developer example, not a required secret.
Instruction Scope
Runtime instructions are limited to installing python-pptx, importing the helper module, and running local Python scripts to generate .pptx files. The SKILL.md does not instruct reading unrelated system files or sending data to external endpoints. It does advise using template files (assets/) and to keep attribution slides for Slidesgo templates.
Install Mechanism
No install spec in the registry; the SKILL.md suggests 'pip install python-pptx' which is appropriate and expected. There are no downloads from arbitrary URLs or extraction steps in the manifest.
Credentials
The skill requests no environment variables, credentials, or config paths. The only filesystem reference is an example absolute path to a local template file (developer-specific); ensure you supply or replace templates with files you control.
Persistence & Privilege
Skill does not request persistent or privileged platform presence (always: false). It does not attempt to modify other skills or system-wide agent settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install create-pptx
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /create-pptx 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of create-pptx: generate PowerPoint (PPTX) presentations using python-pptx. - Supports timelines, charts, diagrams, custom slide layouts, themes, colors, shapes, connectors, text formatting, and transitions. - Includes helpers for common drawing tasks and guides on EMU units, slide planning, and WPS compatibility. - Provides template assets (business dark, education) and references for patterns, charts, standard slides, and WPS issues. - Workflow designed for multi-slide progressive reveals to ensure full compatibility with WPS.
元数据
Slug create-pptx
版本 1.0.0
许可证 MIT-0
累计安装 3
当前安装数 3
历史版本数 1
常见问题

create-pptx 是什么?

Create PowerPoint presentations (PPTX) using Python and python-pptx. Handles timelines, charts, diagrams, slide layouts, custom colors, shapes, connectors, t... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 609 次。

如何安装 create-pptx?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install create-pptx」即可一键安装,无需额外配置。

create-pptx 是免费的吗?

是的,create-pptx 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

create-pptx 支持哪些平台?

create-pptx 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 create-pptx?

由 fanzhuo(@scottliu007)开发并维护,当前版本 v1.0.0。

💬 留言讨论