Loading...
Loading...
Create and manipulate PowerPoint PPTX files programmatically. Use when the user needs to generate presentations, modify PPTX templates, extract slide content, create thumbnail previews, or automate PowerPoint workflows. Supports both template-based generation (for branding compliance) and from-scratch creation. Keywords: PowerPoint, PPTX, presentation, slides, template, deck, slideshow, corporate, branding.
npx skill4agent add jwynia/agent-skills pptx-generator{{PLACEHOLDERS}}deno run --allow-read scripts/analyze-template.ts corporate-template.pptx > inventory.json{
"filename": "corporate-template.pptx",
"slideCount": 10,
"textElements": [
{
"slideNumber": 1,
"shapeId": "shape-2",
"shapeName": "Title 1",
"placeholderType": "ctrTitle",
"position": { "x": 1.5, "y": 2.0, "w": 7.0, "h": 1.2 },
"paragraphs": [
{ "text": "{{TITLE}}", "fontSize": 44, "bold": true }
]
}
]
}replacements.json{
"textReplacements": [
{ "tag": "{{TITLE}}", "value": "Q4 2024 Results" },
{ "tag": "{{SUBTITLE}}", "value": "Financial Overview" },
{ "tag": "{{DATE}}", "value": "December 2024" },
{ "tag": "{{AUTHOR}}", "value": "Finance Team", "slideNumbers": [1] }
]
}deno run --allow-read --allow-write scripts/generate-from-template.ts \
corporate-template.pptx replacements.json output.pptxdeno run --allow-read scripts/generate-thumbnails.ts slide-library.pptxdeno run --allow-read --allow-write scripts/generate-thumbnails.ts \
slide-library.pptx --extract-thumb --output-dir ./previewsselections.json{
"slideSelections": [
{ "slideNumber": 1 },
{ "slideNumber": 5 },
{ "slideNumber": 12 },
{ "slideNumber": 3 }
],
"textReplacements": [
{ "tag": "{{TITLE}}", "value": "Custom Presentation" }
]
}deno run --allow-read --allow-write scripts/generate-from-template.ts \
slide-library.pptx selections.json custom-deck.pptxspec.json{
"title": "Product Launch 2025",
"author": "Marketing Team",
"slides": [
{
"background": { "color": "003366" },
"elements": [
{
"type": "text",
"x": 1, "y": 2.5, "w": 8, "h": 1.5,
"options": {
"text": "Product Launch 2025",
"fontSize": 44,
"bold": true,
"color": "FFFFFF",
"align": "center"
}
},
{
"type": "text",
"x": 1, "y": 4, "w": 8, "h": 0.5,
"options": {
"text": "Revolutionizing the Industry",
"fontSize": 24,
"color": "CCCCCC",
"align": "center"
}
}
]
},
{
"elements": [
{
"type": "text",
"x": 0.5, "y": 0.5, "w": 9, "h": 0.7,
"options": {
"text": "Key Features",
"fontSize": 32,
"bold": true,
"color": "003366"
}
},
{
"type": "table",
"x": 0.5, "y": 1.5, "w": 9, "h": 3,
"options": {
"rows": [
["Feature", "Description", "Benefit"],
["Speed", "2x faster processing", "Save time"],
["Quality", "HD output", "Better results"],
["Integration", "Works with existing tools", "Easy adoption"]
],
"border": { "pt": 1, "color": "CCCCCC" }
}
}
]
}
]
}deno run --allow-read --allow-write scripts/generate-scratch.ts spec.json output.pptx# 1. Analyze template for replaceable content
deno run --allow-read scripts/analyze-template.ts quarterly-template.pptx --pretty
# 2. Create replacements.json with Q4 data
# 3. Generate report
deno run --allow-read --allow-write scripts/generate-from-template.ts \
quarterly-template.pptx replacements.json Q4-2024-Report.pptx# 1. View available slides
deno run --allow-read scripts/generate-thumbnails.ts pitch-library.pptx
# 2. Create selections.json picking slides 1, 3, 7, 12, 15
# 3. Generate custom deck
deno run --allow-read --allow-write scripts/generate-from-template.ts \
pitch-library.pptx selections.json acme-pitch.pptx# 1. Transform your data into spec.json format
# 2. Generate presentation
deno run --allow-read --allow-write scripts/generate-scratch.ts data-spec.json report.pptx| Script | Purpose | Permissions |
|---|---|---|
| Extract text inventory from PPTX | |
| Get slide info and extract previews | |
| Modify templates (replace/combine) | |
| Create PPTX from JSON specification | |
| Type | Description | Key Options |
|---|---|---|
| Text box | |
| Image from file or base64 | |
| Data table | |
| Geometric shapes | |
| Charts and graphs | |
{{PLACEHOLDER}}analyze-template.tsslideNumbersslideSelectionsTheme → Slide Master → Slide Layout → Slide{{placeholder}}<a:lstStyle/><a:lstStyle><p:ph type="..." idx="..."/>typeidx<a:buNone/><a:lstStyle><a:rPr><!-- Layout: Color in lstStyle (GOOD - inheritable) -->
<p:txBody>
<a:lstStyle>
<a:lvl1pPr algn="ctr">
<a:buNone/> <!-- Suppress bullets -->
<a:defRPr sz="4400" b="1">
<a:solidFill><a:srgbClr val="FFFFFF"/></a:solidFill>
</a:defRPr>
</a:lvl1pPr>
</a:lstStyle>
<a:p>
<a:r><a:rPr lang="en-US"/><a:t>{{placeholder}}</a:t></a:r>
</a:p>
</p:txBody><!-- Slide: Empty lstStyle to inherit from layout -->
<p:sp>
<p:nvSpPr>
<p:cNvPr id="2" name="title 2"/>
<p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr>
<p:nvPr>
<p:ph type="ctrTitle"/> <!-- Links to layout placeholder -->
</p:nvPr>
</p:nvSpPr>
<p:spPr/> <!-- Empty = inherit position from layout -->
<p:txBody>
<a:bodyPr/>
<a:lstStyle/> <!-- Empty = inherit formatting from layout -->
<a:p>
<a:r>
<a:rPr lang="en-US"/> <!-- Empty = inherit character formatting -->
<a:t>{{placeholder}}</a:t> <!-- Content must be here -->
</a:r>
</a:p>
</p:txBody>
</p:sp>| Issue | Cause | Solution |
|---|---|---|
| Text shows as black instead of white | Color defined in | Move color to layout's |
| Unwanted bullets appearing | Master's bodyStyle has bullets, layout doesn't override | Add |
| Placeholder text not appearing | Text only in layout, not in slide | Include text content in slide's |
| Formatting not applying | Slide has explicit formatting | Use empty |
| Type | Usage |
|---|---|
| Centered title (title slides) |
| Standard title |
| Subtitle |
| Content area (use |
| Picture placeholder |
| Date/time |
| Footer |
| Slide number |