pptx-generator by minimax-ai/skills
npx skills add https://github.com/minimax-ai/skills --skill pptx-generator此技能处理所有 PowerPoint 任务:读取/分析现有演示文稿、通过 XML 操作编辑基于模板的幻灯片组,以及使用 PptxGenJS 从零开始创建演示文稿。它包含一个完整的设计系统(调色板、字体、样式配方)以及针对每种幻灯片类型的详细指导。
| 任务 | 方法 |
|---|---|
| 读取/分析内容 | python -m markitdown presentation.pptx |
| 编辑或基于模板创建 | 参见编辑演示文稿 |
| 从零开始创建 | 参见下方的"从零开始创建" |
| 项目 | 值 |
| --- | --- |
| 尺寸 | 10" x 5.625" (LAYOUT_16x9) |
| 颜色 | 6 位十六进制,不带 #(例如,"FF0000") |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 英文字体 | Arial(默认),或经批准的替代字体 |
| 中文字体 | 微软雅黑 |
| 页码徽章位置 | x: 9.3", y: 5.1" |
| 主题键 | primary, secondary, accent, light, bg |
| 形状 | RECTANGLE, OVAL, LINE, ROUNDED_RECTANGLE |
| 图表 | BAR, LINE, PIE, DOUGHNUT, SCATTER, BUBBLE, RADAR |
| 文件 | 内容 |
|---|---|
| slide-types.md | 5 种幻灯片页面类型(封面、目录、章节分隔页、内容页、总结页)+ 额外的布局模式 |
| design-system.md | 调色板、字体参考、样式配方(锐利/柔和/圆角/药丸形)、排版与间距 |
| editing.md | 基于模板的编辑工作流、XML 操作、格式化规则、常见陷阱 |
| pitfalls.md | QA 流程、常见错误、关键的 PptxGenJS 陷阱 |
| pptxgenjs.md | 完整的 PptxGenJS API 参考 |
# 文本提取
python -m markitdown presentation.pptx
在没有模板或参考演示文稿时使用。
搜索以了解用户需求 — 主题、受众、目的、语气、内容深度。
使用样式配方选择与演示文稿语气匹配的视觉风格(锐利、柔和、圆角或药丸形)。
将每一张幻灯片精确分类为5 种页面类型之一。规划每张幻灯片的内容和布局。确保视觉多样性 — 不要在幻灯片之间重复相同的布局。
在 slides/ 目录中为每张幻灯片创建一个 JS 文件。每个文件必须导出一个同步的 createSlide(pres, theme) 函数。遵循幻灯片输出格式以及 slide-types.md 中针对特定类型的指导。如果可用,可使用子代理并发生成最多 5 张幻灯片。
告知每个子代理:
slides/slide-01.js、slides/slide-02.js 等。slides/imgs/slides/output/"FF0000")创建 slides/compile.js 以组合所有幻灯片模块:
// slides/compile.js
const pptxgen = require('pptxgenjs');
const pres = new pptxgen();
pres.layout = 'LAYOUT_16x9';
const theme = {
primary: "22223b", // 用于背景/文本的深色
secondary: "4a4e69", // 次要强调色
accent: "9a8c98", // 高亮颜色
light: "c9ada7", // 浅色强调色
bg: "f2e9e4" // 背景颜色
};
for (let i = 1; i <= 12; i++) { // 根据需要调整数量
const num = String(i).padStart(2, '0');
const slideModule = require(`./slide-${num}.js`);
slideModule.createSlide(pres, theme);
}
pres.writeFile({ fileName: './output/presentation.pptx' });
运行命令:cd slides && node compile.js
参见 QA 流程。
slides/
├── slide-01.js # 幻灯片模块
├── slide-02.js
├── ...
├── imgs/ # 幻灯片中使用的图片
└── output/ # 最终产物
└── presentation.pptx
每张幻灯片是一个完整、可运行的 JS 文件:
// slide-01.js
const pptxgen = require("pptxgenjs");
const slideConfig = {
type: 'cover',
index: 1,
title: 'Presentation Title'
};
// 必须是同步的(非异步)
function createSlide(pres, theme) {
const slide = pres.addSlide();
slide.background = { color: theme.bg };
slide.addText(slideConfig.title, {
x: 0.5, y: 2, w: 9, h: 1.2,
fontSize: 48, fontFace: "Arial",
color: theme.primary, bold: true, align: "center"
});
return slide;
}
// 独立预览 - 使用幻灯片特定的文件名
if (require.main === module) {
const pres = new pptxgen();
pres.layout = 'LAYOUT_16x9';
const theme = {
primary: "22223b",
secondary: "4a4e69",
accent: "9a8c98",
light: "c9ada7",
bg: "f2e9e4"
};
createSlide(pres, theme);
pres.writeFile({ fileName: "slide-01-preview.pptx" });
}
module.exports = { createSlide, slideConfig };
编译脚本传递一个具有以下确切键名的主题对象:
| 键名 | 用途 | 示例 |
|---|---|---|
theme.primary | 最深的颜色,标题 | "22223b" |
theme.secondary | 深色强调色,正文文本 | "4a4e69" |
theme.accent | 中间色调强调色 | "9a8c98" |
theme.light | 浅色强调色 | "c9ada7" |
theme.bg | 背景颜色 | "f2e9e4" |
切勿使用其他键名,如 background、text、muted、darkest、lightest。
除封面页外的所有幻灯片都必须在右下角包含一个页码徽章。
3 或 03),不显示 "3/12"slide.addShape(pres.shapes.OVAL, {
x: 9.3, y: 5.1, w: 0.4, h: 0.4,
fill: { color: theme.accent }
});
slide.addText("3", {
x: 9.3, y: 5.1, w: 0.4, h: 0.4,
fontSize: 12, fontFace: "Arial",
color: "FFFFFF", bold: true,
align: "center", valign: "middle"
});
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 9.1, y: 5.15, w: 0.6, h: 0.35,
fill: { color: theme.accent },
rectRadius: 0.15
});
slide.addText("03", {
x: 9.1, y: 5.15, w: 0.6, h: 0.35,
fontSize: 11, fontFace: "Arial",
color: "FFFFFF", bold: true,
align: "center", valign: "middle"
});
pip install "markitdown[pptx]" — 文本提取npm install -g pptxgenjs — 从零开始创建npm install -g react-icons react react-dom sharp — 图标(可选)每周安装量
98
代码仓库
GitHub 星标数
3.5K
首次出现
2 天前
安全审计
已安装于
codex96
cursor95
opencode95
cline94
kimi-cli94
gemini-cli94
This skill handles all PowerPoint tasks: reading/analyzing existing presentations, editing template-based decks via XML manipulation, and creating presentations from scratch using PptxGenJS. It includes a complete design system (color palettes, fonts, style recipes) and detailed guidance for every slide type.
| Task | Approach |
|---|---|
| Read/analyze content | python -m markitdown presentation.pptx |
| Edit or create from template | See Editing Presentations |
| Create from scratch | See Creating from Scratch below |
| Item | Value |
| --- | --- |
| Dimensions | 10" x 5.625" (LAYOUT_16x9) |
| Colors | 6-char hex without # (e.g., "FF0000") |
| English font | Arial (default), or approved alternatives |
| Chinese font | Microsoft YaHei |
| Page badge position | x: 9.3", y: 5.1" |
| Theme keys | primary, secondary, accent, light, bg |
| Shapes | RECTANGLE, OVAL, LINE, ROUNDED_RECTANGLE |
| Charts | BAR, LINE, PIE, DOUGHNUT, SCATTER, BUBBLE, RADAR |
| File | Contents |
|---|---|
| slide-types.md | 5 slide page types (Cover, TOC, Section Divider, Content, Summary) + additional layout patterns |
| design-system.md | Color palettes, font reference, style recipes (Sharp/Soft/Rounded/Pill), typography & spacing |
| editing.md | Template-based editing workflow, XML manipulation, formatting rules, common pitfalls |
| pitfalls.md | QA process, common mistakes, critical PptxGenJS pitfalls |
| pptxgenjs.md | Complete PptxGenJS API reference |
# Text extraction
python -m markitdown presentation.pptx
Use when no template or reference presentation is available.
Search to understand user requirements — topic, audience, purpose, tone, content depth.
Use the Color Palette Reference to select a palette matching the topic and audience. Use the Font Reference to choose a font pairing.
Use the Style Recipes to choose a visual style (Sharp, Soft, Rounded, or Pill) matching the presentation tone.
Classify every slide as exactly one of the 5 page types. Plan the content and layout for each slide. Ensure visual variety — do NOT repeat the same layout across slides.
Create one JS file per slide in slides/ directory. Each file must export a synchronous createSlide(pres, theme) function. Follow the Slide Output Format and the type-specific guidance in slide-types.md. Generate up to 5 slides concurrently using subagents if available.
Tell each subagent:
slides/slide-01.js, slides/slide-02.js, etc.slides/imgs/slides/output/"FF0000")Create slides/compile.js to combine all slide modules:
// slides/compile.js
const pptxgen = require('pptxgenjs');
const pres = new pptxgen();
pres.layout = 'LAYOUT_16x9';
const theme = {
primary: "22223b", // dark color for backgrounds/text
secondary: "4a4e69", // secondary accent
accent: "9a8c98", // highlight color
light: "c9ada7", // light accent
bg: "f2e9e4" // background color
};
for (let i = 1; i <= 12; i++) { // adjust count as needed
const num = String(i).padStart(2, '0');
const slideModule = require(`./slide-${num}.js`);
slideModule.createSlide(pres, theme);
}
pres.writeFile({ fileName: './output/presentation.pptx' });
Run with: cd slides && node compile.js
See QA Process.
slides/
├── slide-01.js # Slide modules
├── slide-02.js
├── ...
├── imgs/ # Images used in slides
└── output/ # Final artifacts
└── presentation.pptx
Each slide is a complete, runnable JS file :
// slide-01.js
const pptxgen = require("pptxgenjs");
const slideConfig = {
type: 'cover',
index: 1,
title: 'Presentation Title'
};
// MUST be synchronous (not async)
function createSlide(pres, theme) {
const slide = pres.addSlide();
slide.background = { color: theme.bg };
slide.addText(slideConfig.title, {
x: 0.5, y: 2, w: 9, h: 1.2,
fontSize: 48, fontFace: "Arial",
color: theme.primary, bold: true, align: "center"
});
return slide;
}
// Standalone preview - use slide-specific filename
if (require.main === module) {
const pres = new pptxgen();
pres.layout = 'LAYOUT_16x9';
const theme = {
primary: "22223b",
secondary: "4a4e69",
accent: "9a8c98",
light: "c9ada7",
bg: "f2e9e4"
};
createSlide(pres, theme);
pres.writeFile({ fileName: "slide-01-preview.pptx" });
}
module.exports = { createSlide, slideConfig };
The compile script passes a theme object with these exact keys :
| Key | Purpose | Example |
|---|---|---|
theme.primary | Darkest color, titles | "22223b" |
theme.secondary | Dark accent, body text | "4a4e69" |
theme.accent | Mid-tone accent | "9a8c98" |
theme.light |
NEVER use other key names like background, text, muted, darkest, lightest.
All slides except Cover Page MUST include a page number badge in the bottom-right corner.
3 or 03), NOT "3/12"slide.addShape(pres.shapes.OVAL, {
x: 9.3, y: 5.1, w: 0.4, h: 0.4,
fill: { color: theme.accent }
});
slide.addText("3", {
x: 9.3, y: 5.1, w: 0.4, h: 0.4,
fontSize: 12, fontFace: "Arial",
color: "FFFFFF", bold: true,
align: "center", valign: "middle"
});
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 9.1, y: 5.15, w: 0.6, h: 0.35,
fill: { color: theme.accent },
rectRadius: 0.15
});
slide.addText("03", {
x: 9.1, y: 5.15, w: 0.6, h: 0.35,
fontSize: 11, fontFace: "Arial",
color: "FFFFFF", bold: true,
align: "center", valign: "middle"
});
pip install "markitdown[pptx]" — text extractionnpm install -g pptxgenjs — creating from scratchnpm install -g react-icons react react-dom sharp — icons (optional)Weekly Installs
98
Repository
GitHub Stars
3.5K
First Seen
2 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex96
cursor95
opencode95
cline94
kimi-cli94
gemini-cli94
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
44,900 周安装
| Light accent |
"c9ada7" |
theme.bg | Background color | "f2e9e4" |