跳到正文
Skillpedia
PDF、Word 与幻灯片14k · #11285

slide-making-skill

它能做什么

这项技能指导使用 PptxGenJS 库制作单张 PowerPoint 幻灯片。适合通过代码生成幻灯片、并需要正确尺寸、字体和样式的开发者。

适用场景

  • ✓当你编写或修复一个用代码生成 PowerPoint 页面的幻灯片文件的时候。
  • ✓当你需要在使用 PptxGenJS 制作的幻灯片中添加文字、图片或图表的时候。
  • ✓当你希望输出为能在 PowerPoint 中打开的原生 .pptx 文件的时候。

技能链接

https://github.com/MiniMax-AI/skills/blob/main/plugins/pptx-plugin/skills/slide-making-skill/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/MiniMax-AI/skills/blob/main/plugins/pptx-plugin/skills/slide-making-skill/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请用 PptxGenJS 做一张 PowerPoint 幻灯片,包括标题、两个要点和一个柱状图。”

每周 5 个新技能,1 分钟读完。

工作原理

这项技能列出了 PptxGenJS 在尺寸、位置、字体和颜色方面的规则。智能体会遵循这些规则,编写一个可导出为标准 PowerPoint 格式的幻灯片文件。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

PptxGenJS Slide Making Skill

This skill teaches how to generate native .pptx slides using PptxGenJS (JavaScript).

PptxGenJS Reference

Read pptxgenjs.md for the complete PptxGenJS API reference, including:

  • Setup & basic structure
  • Text & formatting
  • Lists & bullets
  • Shapes & shadows
  • Images & icons
  • Slide backgrounds
  • Tables & charts

Font Rules

Font Family Standards

Language Default Alternatives
Chinese Microsoft YaHei (微软雅黑) —
English Arial Georgia, Calibri, Cambria, Trebuchet MS
fontFace: "Microsoft YaHei"  // Chinese text
fontFace: "Arial"            // English text (or approved alternative)

Use system-safe fonts for cross-platform compatibility. Header/body can use different fonts (e.g., Georgia + Calibri).

No Bold for Body Text

Plain body text and caption/legend text must NOT use bold.

  • Body paragraphs, descriptions → normal weight
  • Captions, legends, footnotes → normal weight
  • Reserve bold for titles and headings only
// ✅ Correct
slide.addText("Main Title", { bold: true, fontSize: 36, fontFace: "Arial" });
slide.addText("Body text here.", { bold: false, fontSize: 14, fontFace: "Arial" });

// ❌ Wrong
slide.addText("Body text here.", { bold: true, fontSize: 14 });

Color Palette Rules (MANDATORY)

Strict Palette Adherence

Use ONLY the provided color palette. Do NOT create or modify colors.

  • All colors must come from the user-provided palette
  • Do NOT use colors outside the palette
  • Do NOT modify palette colors (brightness, saturation, mixing)
  • Only exception: Add transparency using the transparency property (0-100)
// ✅ Correct: Using palette colors
slide.addShape(pres.shapes.RECTANGLE, { fill: { color: theme.primary } });
slide.addText("Title", { color: theme.accent });

// ❌ Wrong: Colors outside palette
slide.addShape(pres.shapes.RECTANGLE, { fill: { color: "1a1a2e" } });

No Gradients

Gradients are prohibited. Use solid colors only.

// ✅ Correct: Solid colors
slide.background = { color: theme.bg };

// ✅ Correct: Solid + transparency for overlay
slide.addShape(pres.shapes.RECTANGLE, { fill: { color: theme.accent, transparency: 50 } });

No Animations

Animations and transitions are prohibited. All slides must be static.


Page Number Badge (REQUIRED)

All slides except Cover Page MUST include a page number badge in the bottom-right corner.

  • Position: x: 9.3", y: 5.1"
  • Show current number only (e.g. 3 or 03), NOT "3/12"
  • Use palette colors, keep subtle

Circle Badge (Default)

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"
});

Pill Badge

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"
});

Theme Object Contract (MANDATORY)

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 Light accent "c9ada7"
theme.bg Background color "f2e9e4"

NEVER use other key names like background, text, muted, darkest, lightest.


Subagent Output Format

Each subagent outputs 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",  // English text uses Arial
    color: theme.primary, bold: true, align: "center"
  });

  return slide;
}

// Standalone preview - use slide-specif
常见问题

它推荐哪些字体?

中文文字推荐微软雅黑,英文推荐 Arial,并给出几个安全的替代字体。

正文应该加粗吗?

不应该。这项技能说明正文和说明文字应保持常规字重,加粗只用于标题。

它能制作图表吗?

能。这项技能涵盖 PptxGenJS 的图表和表格选项。

详情

作者的原始描述

Implement single-slide PowerPoint pages with PptxGenJS. Use when writing or fixing slide JS files: dimensions, positioning, text/image/chart APIs, styling rules, and export expectations for native .pptx output.

repo: MiniMax-AI/skills

热度

GitHub 星标
14k
排名
#11285
许可证
MIT
更新时间
2026/4/18

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能