PowerPoint
Use this skill whenever a PowerPoint deck is involved. For new decks, pass a trusted PptxGenJS build script directly to the pptx_write tool. For filling or editing an existing template, call pptx_template_analyze first and then pptx_template_fill with the exact IDs returned by analysis.
Workflow
- Decide the deck outline and choose a visual system: palette, typography, repeated motif, and slide rhythm.
- Write JavaScript module content that exports
default async function build(pptx, ctx) or named build(pptx, ctx).
- In the script, add slides directly with PptxGenJS. Do not generate HTML for this workflow.
- Call
pptx_write with path, script, optional assets_dir, and optional data.
- Verify the result with
pptx_read; for visual QA, convert the PPTX to images if the environment has LibreOffice and Poppler.
Template Workflow
- Use
pptx_template_analyze when the user provides a .pptx template or wants to preserve existing layouts, charts, images, tables, or SmartArt.
- Build a
template_fill_pptx_plan.v1 plan from the returned slide IDs and object IDs, then call pptx_template_fill.
- For SmartArt, use
smartarts[*].smartart_id and smartarts[*].nodes[*].node_id in smartart_edits. This edits existing node text only; it does not create, delete, or relayout SmartArt nodes.
Script Creation
- Put the complete JavaScript module in the
script argument.
- Do not use
local_file_write or shell commands to create a temporary .mjs file for this workflow.
- If revising a deck, update the
script content and call pptx_write again.
Tool Contract
{
"tool": "pptx_write",
"arguments": {
"path": "deck.pptx",
"script": "export default async function build(pptx, ctx) {\\n pptx.layout = \"LAYOUT_WIDE\";\\n}",
"assets_dir": "/absolute/path/to/assets",
"data": {"title": "Quarterly Review"}
}
}
The worker creates the PptxGenJS instance and writes the output file. The script only adds slides and content.
export default async function build(pptx, ctx) {
pptx.layout = "LAYOUT_WIDE";
pptx.author = "OpenAgent";
const slide = pptx.addSlide();
slide.background = { color: "FFFFFF" };
slide.addText("Title", {
x: 0.6, y: 0.4, w: 8, h: 0.6,
fontSize: 36, bold: true, color: "1F2937",
margin: 0,
});
slide.addNotes("speaker notes");
}
ctx includes:
ctx.data: JSON data passed from the tool call.
ctx.assetsDir: resolved asset directory.
ctx.outPath: final PPTX path.
ctx.resolveAsset("image.png"): absolute path under assets_dir.
ctx.imageData("image.png"): base64 image data URL.
ctx.iconSvgData("check", "16A34A"): Font Awesome solid icon as SVG data.
Design Rules
- Avoid plain white bullet decks. Every slide should have a visual element: shape, image, chart, icon, timeline, stat callout, or diagram.
- Vary layouts across the deck: title, divider, two-column, card grid, process flow, quote/callout, and conclusion.
- Pick topic-specific colors. Use one dominant color, one or two supporting tones, and one accent.
- Use strong hierarchy: titles around 36-44 pt, section labels around 20-24 pt, body text around 14-18 pt.
- Keep at least 0.5 inch margins and consistent gaps around 0.3-0.5 inch.
- Use editable text wherever practical; use images for photos, screenshots, logos, or complex visual backgrounds.
- Add speaker notes when useful;
pptx_read can surface them later.
PptxGenJS Reference
For API patterns, chart examples, bullets, image sizing, icons, and common file-corruption pitfalls, load pptxgenjs.md.
Required QA
- Run
pptx_read on the generated file and check slide order, missing text, typo risk, and notes.
- Inspect generated XML or render slides when visual precision matters.
- Watch for overlap, text overflow, low contrast, cramped spacing, repeated layouts, and leftover placeholder text.
- If a visual issue is found, edit the
.mjs script and rewrite the PPTX.
1---2name: powerpoint3description: Create designed, editable PowerPoint .pptx presentations with PptxGenJS. Use when the user asks to create, generate, update, or inspect a deck, slide deck, presentation, or .pptx file.4---5
6# PowerPoint
7
8Use this skill whenever a PowerPoint deck is involved. For new decks, pass a trusted PptxGenJS build script directly to the `pptx_write` tool. For filling or editing an existing template, call `pptx_template_analyze` first and then `pptx_template_fill` with the exact IDs returned by analysis.
9
10## Workflow
11
121. Decide the deck outline and choose a visual system: palette, typography, repeated motif, and slide rhythm.
132. Write JavaScript module content that exports `default async function build(pptx, ctx)` or named `build(pptx, ctx)`.
143. In the script, add slides directly with PptxGenJS. Do not generate HTML for this workflow.
154. Call `pptx_write` with `path`, `script`, optional `assets_dir`, and optional `data`.
165. Verify the result with `pptx_read`; for visual QA, convert the PPTX to images if the environment has LibreOffice and Poppler.
17
18## Template Workflow
19
20- Use `pptx_template_analyze` when the user provides a `.pptx` template or wants to preserve existing layouts, charts, images, tables, or SmartArt.
21- Build a `template_fill_pptx_plan.v1` plan from the returned slide IDs and object IDs, then call `pptx_template_fill`.
22- For SmartArt, use `smartarts[*].smartart_id` and `smartarts[*].nodes[*].node_id` in `smartart_edits`. This edits existing node text only; it does not create, delete, or relayout SmartArt nodes.
23
24## Script Creation
25
26- Put the complete JavaScript module in the `script` argument.
27- Do not use `local_file_write` or shell commands to create a temporary `.mjs` file for this workflow.
28- If revising a deck, update the `script` content and call `pptx_write` again.
29
30## Tool Contract
31
32```json
33{
34 "tool": "pptx_write",
35 "arguments": {
36 "path": "deck.pptx",
37 "script": "export default async function build(pptx, ctx) {\\n pptx.layout = \"LAYOUT_WIDE\";\\n}",
38 "assets_dir": "/absolute/path/to/assets",
39 "data": {"title": "Quarterly Review"}
40 }
41}
42```
43
44The worker creates the PptxGenJS instance and writes the output file. The script only adds slides and content.
45
46```javascript
47export default async function build(pptx, ctx) {
48 pptx.layout = "LAYOUT_WIDE";
49 pptx.author = "OpenAgent";
50
51 const slide = pptx.addSlide();
52 slide.background = { color: "FFFFFF" };
53 slide.addText("Title", {
54 x: 0.6, y: 0.4, w: 8, h: 0.6,
55 fontSize: 36, bold: true, color: "1F2937",
56 margin: 0,
57 });
58 slide.addNotes("speaker notes");
59}
60```
61
62`ctx` includes:
63
64- `ctx.data`: JSON data passed from the tool call.
65- `ctx.assetsDir`: resolved asset directory.
66- `ctx.outPath`: final PPTX path.
67- `ctx.resolveAsset("image.png")`: absolute path under `assets_dir`.
68- `ctx.imageData("image.png")`: base64 image data URL.
69- `ctx.iconSvgData("check", "16A34A")`: Font Awesome solid icon as SVG data.
70
71## Design Rules
72
73- Avoid plain white bullet decks. Every slide should have a visual element: shape, image, chart, icon, timeline, stat callout, or diagram.
74- Vary layouts across the deck: title, divider, two-column, card grid, process flow, quote/callout, and conclusion.
75- Pick topic-specific colors. Use one dominant color, one or two supporting tones, and one accent.
76- Use strong hierarchy: titles around 36-44 pt, section labels around 20-24 pt, body text around 14-18 pt.
77- Keep at least 0.5 inch margins and consistent gaps around 0.3-0.5 inch.
78- Use editable text wherever practical; use images for photos, screenshots, logos, or complex visual backgrounds.
79- Add speaker notes when useful; `pptx_read` can surface them later.
80
81## PptxGenJS Reference
82
83For API patterns, chart examples, bullets, image sizing, icons, and common file-corruption pitfalls, load `pptxgenjs.md`.
84
85## Required QA
86
87- Run `pptx_read` on the generated file and check slide order, missing text, typo risk, and notes.
88- Inspect generated XML or render slides when visual precision matters.
89- Watch for overlap, text overflow, low contrast, cramped spacing, repeated layouts, and leftover placeholder text.
90- If a visual issue is found, edit the `.mjs` script and rewrite the PPTX.