四大功能:生成、模板仿照、编辑现有PPT 和 本地文件操作。
前提条件
API Key 配置(使用前必须)
此技能使用前需要配置
SKYWORK_API_KEY。
如果你还没有 API Key,请访问:
https://skywork.ai
详细设置说明见:
references/apikey-fetch.md
隐私与远程调用(使用前必读)
- 远程上传和处理:层级 1/2/4 会上传本地文件并将完整的用户查询发送到 Skywork 服务。除非你信任远程服务及其数据处理策略,否则避免上传敏感或机密内容。
- 轮询行为:生成/编辑工作流包含定期状态轮询(约每 5 秒),等待后端任务完成。这是正常行为。
路由 — 先识别用户意图
| 用户意图 | 使用哪个路径 |
|---|
| 从主题、需求或参考文件生成新 PPT | 层级 1 — 生成 |
| 使用现有 .pptx 作为布局/样式模板创建新演示文稿 | 层级 2 — 仿照 |
| 编辑现有 PPT:修改幻灯片、添加幻灯片、更改样式、拆分/合并 | 层级 4 — 编辑 |
| 删除/重排/提取/合并本地文件中的幻灯片(无后端) | 层级 3 — 本地操作 |
环境检查(始终先运行此步骤)
此技能需要 Python 3(>=3.8)。在运行任何脚本前执行以下命令以定位有效的 Python 二进制文件并安装依赖。
PYTHON_CMD=""
for cmd in python3 python python3.13 python3.12 python3.11 python3.10 python3.9 python3.8; do
if command -v "$cmd" &>/dev/null && "$cmd" -c "import sys; exit(0 if sys.version_info >= (3,8) else 1)" 2>/dev/null; then
PYTHON_CMD="$cmd"
break
fi
doneif [ -z "$PYTHON_CMD" ]; then
echo "ERROR: Python 3.8+ not found."
echo "Install on macOS: brew install python3 or visit https://www.python.org/downloads/"
exit 1
fi
echo "Found Python: $PYTHON_CMD ($($PYTHON_CMD --version))"
$PYTHON_CMD -m pip install -q --break-system-packages python-pptx
echo "Dependencies ready."
此检查后,将所有后续命令中的 python 替换为发现的 $PYTHON_CMD(如 python3)。
层级 1 — 生成 PPT
步骤
- 必须先执行 — 立即阅读 workflow_generate.md,然后再执行任何其他操作。阅读后,输出:
✅ workflow_generate.md loaded. — 然后继续。
- 环境检查 — 运行上方检查获取
$PYTHON_CMD。
- 上传参考文件(如果用户提供本地文件作为内容来源)— 使用 script/parse_file.py 中的工具解析文件,将结果传给
--files。见下方 --files 说明。
- 网络搜索(如果对话中尚无相关内容则必须)— 调用脚本中的 web_search 工具搜索主题,将结果提炼为 ≤ 2000 字的
reference-file 文件。
- 运行脚本:
>
重要:设置 exec 工具的
yieldMs 为
600000(10 分钟)。
- 交付 — 提供绝对
.pptx 路径和下载 URL。
层级 2 — 仿照 PPT(基于模板的生成)
步骤
- 必须先执行 - 在执行任何操作前立即阅读 workflow_imitate.md!!!
- 环境检查 — 运行上方检查获取
$PYTHON_CMD。
- 定位模板 — 从用户消息中提取本地
.pptx 的绝对路径;如不明确则询问用户。
- 上传模板 — 上传并从输出中提取
TEMPLATE_URL。
- 上传参考文件(如果用户提供额外的本地文件作为内容来源)— 使用 script/parse_file.py 中的工具解析文件,将结果传给
--files。见 --files 说明。
- 网络搜索(如果对话中尚无相关内容则必须)— 调用脚本中的 web_search 工具搜索新主题,将结果提炼为 ≤ 2000 字的
reference-file 文件。
- 运行脚本:
>
重要:设置 exec 工具的
yieldMs 为
600000(10 分钟)。
- 交付 — 提供绝对
.pptx 路径、下载 URL 和使用的模板文件名。
层级 4 — 编辑 PPT(AI 驱动的修改)
当用户想用自然语言修改现有 PPT 时使用此层级。需要 PPTX 的 OSS/CDN URL(来自之前的生成或上传)。
步骤
- 详细工作流 - 在执行任何操作前立即阅读 workflow_edit.md!!!
- 环境检查 — 运行上方检查获取
$PYTHON_CMD。
- 获取 PPTX URL — 从用户消息中获取或先上传本地文件。
- 使用
--pptx-url 运行脚本:
$PYTHON_CMD scripts/run_ppt_write.py "编辑指令" \
--language Chinese \
--pptx-url "https://cdn.example.com/file.pptx" \
-o /absolute/path/output.pptx
>
重要:设置 exec 工具的
yieldMs 为
600000(10 分钟)。
层级 3 — PPT 文件操作
# 检查幻灯片数量和标题
$PYTHON_CMD scripts/local_pptx_ops.py info --file my.pptx# 删除幻灯片(1为起始索引;支持范围如 3,5,7-9;省略 -o 则原地覆盖)
$PYTHON_CMD scripts/local_pptx_ops.py delete --file my.pptx --slides 3,5,7-9 -o trimmed.pptx
# 重排幻灯片(必须列出每张幻灯片,不可遗漏)
$PYTHON_CMD scripts/local_pptx_ops.py reorder --file my.pptx --order 2,1,4,3,5
# 提取部分幻灯片到新文件
$PYTHON_CMD scripts/local_pptx_ops.py extract --file my.pptx --slides 1-3 -o subset.pptx
# 合并多个文件
$PYTHON_CMD scripts/local_pptx_ops.py merge --files a.pptx b.pptx -o merged.pptx
在执行任何操作前立即阅读 workflow_local.md!!!
错误处理
- 权益不足:调用脚本(生成、仿照或编辑)时,脚本或日志可能显示
Insufficient benefit. Please upgrade your account at {url} 等消息,表示用户的权益等级不满足此技能的要求。
权益不足时的回复方式
检测到上述情况时,用用户当前语言回复 — 不要回显英文消息。使用此模式:
- 传达:"抱歉,PPT 生成失败。此技能需要升级您的 Skywork 会员才能使用。"然后一个行动链接。
- 格式:用户语言的一句短话 + 链接如
立即升级 → 或对应语言版本。
- URL:从日志/脚本输出中提取升级 URL(如
at https://... 部分)。
注意:仅在错误为 Insufficient benefit 时建议升级。对于 NO_TOKEN / INVALID_TOKEN / 401 / "invalid API key" 等认证错误,保留错误代码/原始消息并引导用户更新 SKYWORK_API_KEY。不要建议升级会员。
依赖
- Python 3.8+(必须)—
python3 / python 必须在 PATH 中
- 层级 3 本地操作:
pip install python-pptx --break-system-packages
(环境检查步骤会自动安装所有必需依赖。)
触发哪个层级?
| 场景 | 使用 |
|---|
| 从主题或现有参考文件生成 PPT | 层级 1 |
| 仿照现有 .pptx 的布局/样式 | 层级 2 |
| 通过自然语言编辑/修改现有 PPT | 层级 4 |
| 删除/重排/提取/合并本地 .pptx 文件(无后端) | 层级 3 |
Four capabilities: generate, template imitation, edit existing PPT, and local file operations.
Prerequisites
API Key Configuration (Required First)
This skill requires a
SKYWORK_API_KEY to be configured before use.
If you don't have an API key yet, please visit:
https://skywork.ai
For detailed setup instructions, see:
references/apikey-fetch.md
Privacy & Remote Calls (Read Before Use)
- Remote upload & processing: Layers 1/2/4 upload local files and send the full, verbatim user query to the Skywork service. Avoid sensitive or confidential content unless you trust the remote service and its data handling policies.
- Polling behavior: The generation/edit workflows include periodic status polling (about every 5 seconds) while waiting for backend jobs. This is expected.
Routing — Identify the user's intent first
| User intent | Which path |
|---|
| Generate a new PPT from a topic, set of requirements or reference files | Layer 1 — Generate |
| Use an existing .pptx as a layout/style template to create a new presentation | Layer 2 — Imitate |
| Edit an existing PPT: modify slides, add slides, change style, split/merge | Layer 4 — Edit |
| Delete / reorder / extract / merge slides in a local file (no backend) | Layer 3 — Local ops |
Environment check (always run this first)
This skill requires Python 3 (>=3.8). Run the following before any script to locate a valid Python binary and install dependencies.
PYTHON_CMD=""
for cmd in python3 python python3.13 python3.12 python3.11 python3.10 python3.9 python3.8; do
if command -v "$cmd" &>/dev/null && "$cmd" -c "import sys; exit(0 if sys.version_info >= (3,8) else 1)" 2>/dev/null; then
PYTHON_CMD="$cmd"
break
fi
doneif [ -z "$PYTHON_CMD" ]; then
echo "ERROR: Python 3.8+ not found."
echo "Install on macOS: brew install python3 or visit https://www.python.org/downloads/"
exit 1
fi
echo "Found Python: $PYTHON_CMD ($($PYTHON_CMD --version))"
$PYTHON_CMD -m pip install -q --break-system-packages python-pptx
echo "Dependencies ready."
After this check, replace python with the discovered $PYTHON_CMD (e.g. python3) in all subsequent commands.
Layer 1 — Generate PPT
Steps
- REQUIRED FIRST STEP — Read workflow_generate.md NOW, before taking any other action. After reading, output exactly:
✅ workflow_generate.md loaded. — then proceed.
- Environment check — run the check above to get
$PYTHON_CMD.
- Upload reference files (if the user provides local files as content source) — parse the file using tool in script/parse_file.py and pass the result to
--files. See the --files note below.
- Web search (required if no relevant content is already in the conversation) — call web_search tool in script to search the topic and distill results into a
reference-file file of ≤ 2000 words.
- Run the script:
>
Important: set exec tool
yieldMs to
600000 (10 minutes).
- Deliver — provide the absolute
.pptx path and the download URL.
Layer 2 — Imitate PPT (template-based generation)
Steps
- REQUIRED FIRST STEP - Read workflow_imitate.md immidiately before any action you do!!!
- Environment check — run the check above to get
$PYTHON_CMD.
- Locate the template — extract the absolute path of the local
.pptx from the user's message; ask the user if it's unclear.
- Upload the template — upload it and extract
TEMPLATE_URL from the output.
- Upload reference files (if the user provides additional local files as content source) — parse the file using tool in script/parse_file.py and pass the result to
--files. See the --files
- Web search (required if no relevant content is already in the conversation) — call web_search tool in script to search the new topic and distill results into a
reference-file file of ≤ 2000 words.
- Run the script:
>
Important: set exec tool
yieldMs to
600000 (10 minutes).
- Deliver — provide the absolute
.pptx path, the download URL, and the template filename used.
Layer 4 — Edit PPT (AI-powered modification)
Use this layer when the user wants to modify an existing PPT using natural language. Requires an OSS/CDN URL of the PPTX (from a previous generation or upload).
Steps
- Detailed workflow - Read workflow_edit.md immediately before any action you do!!!
- Environment check — run the check above to get
$PYTHON_CMD.
- Get PPTX URL — from the user's message or upload a local file first.
- Run the script with
--pptx-url:
$PYTHON_CMD scripts/run_ppt_write.py "edit instruction" \
--language Chinese \
--pptx-url "https://cdn.example.com/file.pptx" \
-o /absolute/path/output.pptx
>
Important: set exec tool
yieldMs to
600000 (10 minutes).
- Deliver — provide download link, local path, and summary of changes.
Layer 3 — PPT File operations
# Inspect slide count and titles
$PYTHON_CMD scripts/local_pptx_ops.py info --file my.pptx# Delete slides (1-based index; supports ranges like 3,5,7-9; omit -o to overwrite in place)
$PYTHON_CMD scripts/local_pptx_ops.py delete --file my.pptx --slides 3,5,7-9 -o trimmed.pptx
# Reorder slides (must list every slide, no omissions)
$PYTHON_CMD scripts/local_pptx_ops.py reorder --file my.pptx --order 2,1,4,3,5
# Extract a subset of slides into a new file
$PYTHON_CMD scripts/local_pptx_ops.py extract --file my.pptx --slides 1-3 -o subset.pptx
# Merge multiple files
$PYTHON_CMD scripts/local_pptx_ops.py merge --files a.pptx b.pptx -o merged.pptx
Read workflow_local.md immidiately before any action you do!!!
Error Handling
- Insufficient benefit: When calling scripts (generate, imitate, or edit), the script or log may show a message like
Insufficient benefit. Please upgrade your account at {url}, meaning the user's benefit level does not meet the requirement for this skill.
How to reply when benefit is insufficient
When you detect the above, reply in the user's current language — do not echo the English message. Use this pattern:
- Convey: "Sorry, PPT generation failed. This skill requires upgrading your Skywork membership to use." then a single call-to-action link.
- Format: One short sentence in the user's language + a link like
Upgrade now → or the equivalent in their language .
- URL: Extract the upgrade URL from the log/script output (e.g. the
at https://... part).
Note: Only suggest upgrading when the error is Insufficient benefit. For auth errors like NO_TOKEN / INVALID_TOKEN / 401 / “invalid API key”, keep the error code / raw message and guide users to update SKYWORK_API_KEY. Do not suggest upgrading membership.
Dependencies
- Python 3.8+ (required) —
python3 / python must be on PATH
- Layer 3 local ops:
pip install python-pptx --break-system-packages
(The environment check step installs all required dependencies automatically.)
Which layer to trigger?
| Scenario | Use |
|---|
| Generate a PPT from a topic or existing reference files | Layer 1 |
| Imitate the layout/style of an existing .pptx | Layer 2 |
| Edit/modify an existing PPT via natural language | Layer 4 |
| Delete / reorder / extract / merge local .pptx files (no backend) | Layer 3 |