一键导入
pptx
PowerPoint 演示文稿处理。用于读取现有 PPTX 基本信息、文本、表格、图表基础数据与备注,创建新演示文稿,并提取媒体文件。支持在新建演示文稿时添加文本、图片、表格、图表、形状、媒体与演讲者备注。当用户提到 .pptx 文件或需要操作 PowerPoint 时触发。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
PowerPoint 演示文稿处理。用于读取现有 PPTX 基本信息、文本、表格、图表基础数据与备注,创建新演示文稿,并提取媒体文件。支持在新建演示文稿时添加文本、图片、表格、图表、形状、媒体与演讲者备注。当用户提到 .pptx 文件或需要操作 PowerPoint 时触发。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
文件系统操作。⚠️读取前先调用info获取文件信息:图片用read_file(mode='data_url'),大文件用from/lines分块。
Excel 文件处理。用于读取、写入、编辑 .xlsx/.xls/.csv 文件,支持工作表管理、格式化、公式计算、数据查询和格式转换。当用户需要操作电子表格文件时触发。
发票专用解析技能。支持中国增值税发票、普通发票、电子发票的结构化提取。基于 pdfjs-dist 实现坐标提取,可提取发票号码、日期、买卖双方信息、商品明细、金额等字段。
PDF 文件处理。用于读取、提取文本/表格/图片、合并、拆分、旋转、水印、加密/解密、表单填写、页面渲染。当用户提到 .pdf 文件或需要操作 PDF 时触发。
PDF 文件处理(Python 版)。使用 PyMuPDF 实现,内存效率高,适合处理大文件。用于读取、提取文本/表格/图片、合并、拆分、旋转、水印、加密/解密、页面渲染。当用户提到 .pdf 文件或需要操作 PDF 时触发。
Word 文档处理。用于读取、写入、编辑、模板填充 .docx 文件。支持页眉页脚、超链接、目录、图片操作。使用 Patcher API 保留原文档样式。当用户需要操作 Word 文档时触发。
| name | pptx |
| description | PowerPoint 演示文稿处理。用于读取现有 PPTX 基本信息、文本、表格、图表基础数据与备注,创建新演示文稿,并提取媒体文件。支持在新建演示文稿时添加文本、图片、表格、图表、形状、媒体与演讲者备注。当用户提到 .pptx 文件或需要操作 PowerPoint 时触发。 |
| license | MIT |
| argument-hint | [file|slide|object|master] [action] [path] |
| user-invocable | true |
依赖:pptxgenjs 4.0+ (创建演示文稿) + adm-zip (读取现有 PPTX)
pptxgenjs 4.0 只能创建新演示文稿,无法编辑现有文件!
编辑现有文件的替代方案:
file read 读取现有文件内容file create 创建新文件,添加修改后的内容本技能提供四个工具:
| 工具 | 最终名称 | 说明 |
|---|---|---|
file | pptx__file | 文件级操作(读取、创建、提取) |
slide | pptx__slide | 幻灯片创建(仅限新建演示文稿) |
object | pptx__object | 内容对象操作(添加、提取) |
master | pptx__master | 模板母版(定义、列出) |
通过 action 参数区分具体操作:
| action | 功能 | 关键参数 |
|---|---|---|
read | 读取演示文稿信息 | scope, slideNumbers |
create | 创建演示文稿 | source, slides, markdown |
extract | 提取媒体文件 | outputDir, extractType |
参数:
action (string, required): "read"path (string, required): PPTX 文件路径scope (string, optional): 读取范围
info: 基本信息(幻灯片数量、元数据)text: 提取所有文本内容structure: 提取页面级粗粒度结构信息(文本形状、图片、表格、图表、媒体引用、对象顺序及基础变换信息)normalized: 提取标准化 slide object model,可直接作为 JSON 中间表示消费media: 提取媒体信息(图片、视频列表)和幻灯片引用关系tables: 提取表格内容charts: 提取图表基础数据(类型、系列、标签、数值)notes: 提取演讲者备注文本includeAssets (boolean, optional): 当 scope = "normalized" 时,是否内联 presentation.assetMap,用于直接 round-trip 重建资源对象structure 结果会按幻灯片返回 summary、notes 与 objects。它更适合作为分析视图使用,用于理解页面内容与结构,不建议作为默认编辑入口。
normalized 在 structure 基础上提供显式的标准化导出入口,返回更收敛的 schema:仅保留 presentation、slides[].summary 和 slides[].objects[] 下的核心字段,适合直接持久化为 JSON 或作为后续重建输入。当前 read/create 结果都会回显 schema 元信息,其中包含 presentation、slide、object 三层契约定义。
当前实现中,normalized 的支持矩阵与对象校验已经共享同一套 schema 定义,requirements / requirementsAnyOf 与 warningCode 会同时体现在支持矩阵和创建阶段反馈中。schema 里还会显式回显字段级 required、properties、defaults 和 example,便于 LLM 或调用方按字段约束生成/修正对象。
默认推荐工作流:
file read with scope: "normalized"file create with source: "normalized"支持矩阵(normalized -> create):
text: full,要求 content.text
image: partial,要求 source.path、source.data 或 source.assetKey;仅有 embedId 时会返回 image-resource-mapping-required
table: partial,要求 content.previewRows
chart: basic,要求 content.chartType 与 content.series
shape: basic,支持基础 shape 参数
notes: full,要求 content.text
media: partial,要求 source.path / source.data / source.assetKey;缺失资源映射时会返回 media-resource-mapping-required
slideNumbers (number[], optional): 指定幻灯片编号
示例:
// 读取基本信息
pptx__file({ action: "read", path: "presentation.pptx", scope: "info" })
// 提取文本
pptx__file({ action: "read", path: "presentation.pptx", scope: "text" })
// 提取结构
pptx__file({ action: "read", path: "presentation.pptx", scope: "structure" })
// 导出标准化模型
pptx__file({ action: "read", path: "presentation.pptx", scope: "normalized" })
// 导出可直接 round-trip 的标准化模型(内联资源)
pptx__file({ action: "read", path: "presentation.pptx", scope: "normalized", includeAssets: true })
// 提取备注
pptx__file({ action: "read", path: "presentation.pptx", scope: "notes" })
参数:
action (string, required): "create"path (string, required): 输出文件路径source (string, optional): 创建来源 - data、markdown 或 normalized(默认: data)slides (object[], optional): 幻灯片数据数组markdown (string, optional): Markdown 内容(当前支持一级标题、二级标题、普通文本、无序列表)normalized (object, optional): 标准化 slide object model,可选包含 assetMapproperties (object, optional): 文档属性
title: 标题author: 作者company: 公司layout: 布局(LAYOUT_16x9, LAYOUT_4x3, LAYOUT_WIDE)示例:
// 从数据创建
pptx__file({
action: "create",
path: "new.pptx",
slides: [
{ title: "第一章", content: "这是内容" },
{ title: "第二章", texts: ["要点一", "要点二"] }
],
properties: { title: "我的演示", author: "张三" }
})
// 从 Markdown 创建
pptx__file({
action: "create",
path: "markdown.pptx",
source: "markdown",
markdown: "# 标题页\n\n## 内容\n- 要点一\n- 要点二"
})
// 从标准化模型重建(当前最小支持 text/table/notes/chart/shape/image)
pptx__file({
action: "create",
path: "normalized.pptx",
source: "normalized",
normalized: {
slides: [
{
number: 1,
objects: [
{ kind: "text", content: { text: "标题" }, transform: { inches: { x: 0.5, y: 0.5, w: 4, h: 0.5 } } },
{ kind: "table", content: { previewRows: [["A", "B"], ["1", "2"]] }, transform: { inches: { x: 0.5, y: 1.5, w: 5 } } },
{ kind: "chart", name: "销量", content: { chartType: "bar", series: [{ name: "Sales", labels: ["Q1", "Q2"], values: [10, 20] }] }, transform: { inches: { x: 0.5, y: 3.5, w: 5, h: 3 } } },
{ kind: "notes", content: { text: "讲解备注" } }
]
}
]
}
})
使用 source: "normalized" 创建时,返回结果会额外包含 rebuildStats、结构化 warnings、normalized 版本元信息和支持矩阵回显,便于判断哪些对象已成功重建、哪些对象被跳过。warnings 现在还会附带 suggestedFix,方便基于 warning code 自动修正对象。image 当前支持 source.path、source.data,也支持通过 normalized.assetMap 或 normalized.presentation.assetMap 配合 source.assetKey 重建;仅有 embedId 时仍需要外部资源映射。media 同样支持 source.path、source.data 或 source.assetKey + assetMap。
参数:
action (string, required): "extract"path (string, required): PPTX 文件路径outputDir (string, optional): 输出目录extractType (string, optional): 提取类型 - images, media, all示例:
// 提取图片
pptx__file({
action: "extract",
path: "presentation.pptx",
outputDir: "images",
extractType: "images"
})
创建新的演示文稿并添加幻灯片。
参数:
action (string, required): "add"output (string, required): 输出文件路径title (string, optional): 幻灯片标题content (string | string[], optional): 幻灯片内容slides (object[], optional): 多个幻灯片数据background (object, optional): 背景配置master (object, optional): 母版配置properties (object, optional): 文档属性示例:
// 创建单个幻灯片
pptx__slide({
action: "add",
output: "single.pptx",
title: "演示标题",
content: ["要点一", "要点二"]
})
// 创建多个幻灯片
pptx__slide({
action: "add",
output: "multi.pptx",
slides: [
{ title: "第一页", content: "内容一" },
{ title: "第二页", texts: ["要点A", "要点B"] }
]
})
通过 action 参数区分具体操作:
| action | 功能 | 关键参数 |
|---|---|---|
add | 创建包含对象的演示文稿 | type, text, image, chart 等 |
extract | 提取对象内容 | type, outputDir |
参数:
action (string, required): "add"output (string, required): 输出文件路径slideNumber (number, optional): 仅接受 1。当前工具会创建一个新的单页演示文稿,不支持写入指定页。type (string, required): 对象类型
text: 文本image: 图片table: 表格chart: 图表shape: 形状media: 视频/音频notes: 演讲者备注properties (object, optional): 文档属性文本示例:
pptx__object({
action: "add",
output: "text.pptx",
type: "text",
text: "Hello World",
options: { fontSize: 24, bold: true, color: "FF0000" }
})
图片示例:
pptx__object({
action: "add",
output: "image.pptx",
type: "image",
image: { path: "photo.jpg", x: 1, y: 1, w: 4, h: 3 }
})
表格示例:
pptx__object({
action: "add",
output: "table.pptx",
type: "table",
table: {
rows: [
[{ text: "姓名" }, { text: "年龄" }],
[{ text: "张三" }, { text: "25" }]
],
x: 0.5, y: 1, w: 9
}
})
图表示例:
pptx__object({
action: "add",
output: "chart.pptx",
type: "chart",
chart: {
type: "bar",
data: [
{ name: "销售额", labels: ["一月", "二月"], values: [100, 150] }
],
title: "月度销售额"
}
})
支持的图表类型:
bar, bar3D: 柱状图line, line3D: 折线图pie, pie3D: 饼图doughnut: 环形图area, area3D: 面积图scatter: 散点图radar, radar3D: 雷达图bubble, bubble3D: 气泡图参数:
action (string, required): "extract"path (string, required): PPTX 文件路径type (string, required): 提取类型 - images, media, textoutputDir (string, optional): 输出目录示例:
pptx__object({
action: "extract",
path: "presentation.pptx",
type: "images",
outputDir: "extracted"
})
通过 action 参数区分具体操作:
| action | 功能 | 关键参数 |
|---|---|---|
define | 定义母版并创建演示文稿 | name, background, objects |
list | 列出母版布局 | path |
参数:
action (string, required): "define"output (string, required): 输出文件路径name (string, required): 母版名称background (object, optional): 背景配置objects (object[], optional): 母版上的固定对象slideNumber (object, optional): 幻灯片编号配置properties (object, optional): 文档属性示例:
pptx__master({
action: "define",
output: "template.pptx",
name: "CompanyTemplate",
background: { color: "F5F5F5" },
objects: [
{ text: "公司名称", options: { x: 0.5, y: 0.2 } }
]
})
返回的是 PPTX 中可枚举的布局信息(slideLayout*.xml),可用于识别布局名称,但不是完整的母版结构解析。
参数:
action (string, required): "list"path (string, required): PPTX 文件路径示例:
pptx__master({
action: "list",
path: "template.pptx"
})
创建演示文稿时,每个幻灯片支持以下字段:
interface SlideData {
title?: string; // 标题
content?: string; // 内容文本
texts?: (string | TextItem)[]; // 文本列表
images?: ImageItem[]; // 图片列表
tables?: TableItem[]; // 表格列表
charts?: ChartItem[]; // 图表列表
shapes?: ShapeItem[]; // 形状列表
background?: Background; // 背景
notes?: string; // 演讲者备注
}
| 任务 | 工具 | action |
|---|---|---|
| 读取基本信息 | file | read (scope: info) |
| 提取文本 | file | read (scope: text) |
| 提取页面级粗粒度结构 | file | read (scope: structure) |
| 导出标准化模型 | file | read (scope: normalized) |
| 提取媒体信息与引用 | file | read (scope: media) |
| 提取表格 | file | read (scope: tables) |
| 提取图表基础数据 | file | read (scope: charts) |
| 提取备注 | file | read (scope: notes) |
| 创建演示文稿 | file | create |
| 提取媒体文件 | file | extract |
| 创建幻灯片 | slide | add |
| 添加文本 | object | add (type: text) |
| 添加图片 | object | add (type: image) |
| 添加表格 | object | add (type: table) |
| 添加图表 | object | add (type: chart) |
| 添加形状 | object | add (type: shape) |
| 添加媒体 | object | add (type: media) |
| 添加备注 | object | add (type: notes) |
| 提取对象 | object | extract |
| 定义母版 | master | define |
| 列出布局 | master | list |