PPT Write Skill
Four capabilities: generate, template imitation, edit existing PPT, and local file operations.
Prerequisites
API Key Configuration (Required First)
This skill requires a
SKYWORKAPIKEY 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.
CODEBLOCK0
After this check, replace python with the discovered $PYTHON_CMD (e.g. python3) in all subsequent commands.
Layer 1 — Generate PPT
Steps
- 0. REQUIRED FIRST STEP — Read workflowgenerate.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/parsefile.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).
- 5. Deliver — provide the absolute
.pptx path and the download URL.
Layer 2 — Imitate PPT (template-based generation)
Steps
- 0. REQUIRED FIRST STEP - Read workflowimitate.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/parsefile.py and pass the result to
--files. See the INLINECODE15 - 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).
- 7. 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
- 0. 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).
- 4. Deliver — provide download link, local path, and summary of changes.
Layer 3 — PPT File operations
CODEBLOCK2
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 →](url) 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: INLINECODE33
(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 |
技能名称: Skywork-ppt
详细描述:
PPT 编写技能
四大能力:生成、模板模仿、编辑现有PPT、本地文件操作。
前置条件
API 密钥配置(必须先完成)
此技能需要先配置
SKYWORKAPIKEY 才能使用。
如果您还没有 API 密钥,请访问:
https://skywork.ai
详细设置说明请参见:
references/apikey-fetch.md
隐私与远程调用(使用前请阅读)
- - 远程上传与处理:第1/2/4层会上传本地文件,并将用户查询的完整原文发送至 Skywork 服务。除非您信任该远程服务及其数据处理策略,否则请避免包含敏感或机密内容。
- 轮询行为:生成/编辑工作流在等待后端任务时会包含定期状态轮询(约每5秒一次)。这是预期行为。
路由——首先识别用户意图
| 用户意图 | 对应路径 |
|----------|----------|
| 根据主题、需求或参考文件生成新PPT | 第1层 — 生成 |
| 使用现有 .pptx 作为布局/样式模板创建新演示文稿 | 第2层 — 模仿 |
| 编辑现有PPT:修改幻灯片、添加幻灯片、更改样式、拆分/合并 | 第4层 — 编辑 |
| 删除/重新排序/提取/合并本地文件中的幻灯片(无需后端) | 第3层 — 本地操作 |
环境检查(始终先执行此步骤)
此技能需要 Python 3(>=3.8)。在任何脚本运行前,先执行以下命令以找到有效的 Python 二进制文件并安装依赖。
bash
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
done
if [ -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: $PYTHONCMD ($($PYTHONCMD --version))
$PYTHON_CMD -m pip install -q --break-system-packages python-pptx
echo Dependencies ready.
完成此检查后,在所有后续命令中将 python 替换为找到的 $PYTHON_CMD(例如 python3)。
第1层 — 生成PPT
步骤
- 0. 必须的第一步 — 立即阅读 workflowgenerate.md,然后再执行任何其他操作。阅读后,输出:✅ workflowgenerate.md loaded. — 然后继续。
- 环境检查 — 运行上述检查以获取 $PYTHONCMD。
- 上传参考文件(如果用户提供本地文件作为内容来源)— 使用 script/parsefile.py 中的工具解析文件,并将结果传递给 --files。参见下面的 --files 说明。
- 网络搜索(如果对话中尚无相关内容,则必须执行)— 调用 script 中的 web_search 工具搜索主题,并将结果提炼为不超过 2000 词的 reference-file 文件。
- 运行脚本:
>
重要:将 exec 工具的 yieldMs 设置为 600000(10分钟)。
- 5. 交付 — 提供 .pptx 的绝对路径和下载 URL。
第2层 — 模仿PPT(基于模板的生成)
步骤
- 0. 必须的第一步 — 立即阅读 workflowimitate.md,然后再执行任何操作!!!
- 环境检查 — 运行上述检查以获取 $PYTHONCMD。
- 定位模板 — 从用户消息中提取本地 .pptx 的绝对路径;如果不明确,则询问用户。
- 上传模板 — 上传模板并从输出中提取 TEMPLATEURL。
- 上传参考文件(如果用户提供额外的本地文件作为内容来源)— 使用 script/parsefile.py 中的工具解析文件,并将结果传递给 --files。参见 --files 说明。
- 网络搜索(如果对话中尚无相关内容,则必须执行)— 调用 script 中的 web_search 工具搜索新主题,并将结果提炼为不超过 2000 词的 reference-file 文件。
- 运行脚本:
>
重要:将 exec 工具的 yieldMs 设置为 600000(10分钟)。
- 7. 交付 — 提供 .pptx 的绝对路径、下载 URL 以及使用的模板文件名。
第4层 — 编辑PPT(AI驱动的修改)
当用户希望通过自然语言修改现有PPT时使用此层。需要PPTX的OSS/CDN URL(来自之前的生成或上传)。
步骤
- 0. 详细工作流 — 立即阅读 workflowedit.md,然后再执行任何操作!!!
- 环境检查 — 运行上述检查以获取 $PYTHONCMD。
- 获取PPTX URL — 从用户消息中获取,或先上传本地文件。
- 运行脚本,使用 --pptx-url:
bash
$PYTHON
CMD scripts/runppt_write.py 编辑指令 \
--language Chinese \
--pptx-url https://cdn.example.com/file.pptx \
-o /absolute/path/output.pptx
> 重要:将 exec 工具的 yieldMs 设置为 600000(10分钟)。
- 4. 交付 — 提供下载链接、本地路径以及更改摘要。
第3层 — PPT文件操作
bash
检查幻灯片数量和标题
$PYTHON
CMD scripts/localpptx_ops.py info --file my.pptx
删除幻灯片(基于1的索引;支持范围如3,5,7-9;省略 -o 则原地覆盖)
$PYTHON
CMD scripts/localpptx_ops.py delete --file my.pptx --slides 3,5,7-9 -o trimmed.pptx
重新排序幻灯片(必须列出所有幻灯片,不能遗漏)
$PYTHON
CMD scripts/localpptx_ops.py reorder --file my.pptx --order 2,1,4,3,5
提取部分幻灯片到新文件
$PYTHON
CMD scripts/localpptx_ops.py extract --file my.pptx --slides 1-3 -o subset.pptx
合并多个文件
$PYTHON
CMD scripts/localpptx_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 时建议升级。对于认证错误如 NOTOKEN / INVALIDTOKEN / 401 / “invalid API key”,保留错误代码/原始消息,并引导用户更新 SKYWORKAPIKEY。不要建议升级会员。
依赖项
- - Python 3.8+(必需)— python3 / python 必须在 PATH 中
- 第3层本地操作:pip install python-pptx --break-system-packages
(环境检查步骤会自动安装所有必需的依赖项。)
触发哪个层?
| 场景 | 使用 |